in code, iOS, tech

Pythonista + Fever + Instapaper = Quick RSS Magic

I Love Python. It’s a simple, easy and quick to learn language. Before learning Python, the major language I knew was Java and believe me, that’s a pain! Seeing Python grow from a simple scripting language to a major platform is also a great feeling. The recent awesomeness about Python I discovered was Pythonista for iOS. It’s a wonderful app that allows you to run python scripts of varying complexity on your iPhone or iPad without worrying about silly things like Objective C. Of course, it’s not the perfect app, there are limitations to the libraries and you can’t easily transfer scripts to the app from your desktop. But hey, as long as it’s Python, right?

So, what did I do with Pythonista? Well, my other favorite nowadays is Fever (by Shaun Inman) and I obsess over it over and over. Recently, while browsing the code (Yes, I do that), I found out that Shaun Inman’s made some changes in the upcoming v3 of the API. Those changes allow you to call the items from a particular feed or group without polling for all the items in the entire database. Or, did you not care about that? Anyways, moving on, I made a script to run in Pythonista to get the top 50 items from Group1 (why group 1? Because it’s my favorite :P) of my Kindling groups and present them to me. On clicking them, the link get’s “Instapaper-ed” and presented nice-ly. Sorry Marco Arment, I’m misusing your Instapaper Text service, so please don’t kill it yet. I’ve also added a small button on the side to send the URL to the Instapaper app. Please use the button only if you’ve got the app installed, I don’t know what happens if the app isn’t there.

Without further ado, here’s the script. It’s a Github gist, so all you Pythonistas can head over there to grab it in plain text. Make sure you replace the placeholder URL, Username and Password with your own Fever install.

The code is derived from the works of Thomas Allen over at the FeverBuddy Github repo. There is a lot of redundant code here and I fully intend to clean it all up and make a repo out of it. I’m leaving this an open ended discussion. If there is a specific request that you’d like to make, you can add it in the comments. I’ve also added points in the code where I’ve specified what you can modify it to suit your own needs. Have fun! 🙂

Oh, and a screenshot, something that my brother thinks is mandatory in tutorials and show and tell blogposts –

20130104-114940.jpg