Export from Snipplr.com to files

Today , I’m trying to use Snippets app on Mac. I always using snipplr.com. Snippets app look cool. I can sync with Dropbox my file. But we need to make symbolic link like following

ln -s /Users/macusername/Library/Application Support/Snippets/Snippets.xml Snippets.xml

I like the one feature. It can post to snipplr.com. It’s great feature for me. Sometime I want to use snippet in offline mode. But snipplr.com always need offline. I read about snipplr api. It’s using XML-PRC that is more easier to write than RESTFUL in python. Just call one import line and it can be done. But I don’t want to write new class for snipplr api. I searched on google and I found library for snipplr api. I just use and write for exporting files. It’s very easy to write when I use SnipplrPy.py . I only met one problem. It’s run None and it’s not string data type. Very hard to check this condition. Around half hour, I found a way. I used

if json.dumps(result)!=“null”:

I fixed that problem and posted into github. I’m using HTML, CSS , Javascript, PHP , Objective C for snippets. So, I didn’t add so much condition for file extension detection in my code. If you are using other language , please commit ticket in github or fork the repo.

Now, everything is working fine. Now, I can use Snippets app with old snipplr.com snippets. I can push latest one to snipplr.com. I can sync my snippets with dropbox. Wow !!! everything working fine and no need to worry about my snippets.
comments powered byDisqus