tvaughan Posted June 13, 2016 Posted June 13, 2016 I'm new to Alfred workflows, json and python, so I'm more or less starting from scratch on this one! I want to create a workflow that will get the latest bitcoin price in GBP, using the bitcoinaverage API (https://api.bitcoinaverage.com/ticker/global/GBP/). That gives me a json file that looks something like this: {"24h_avg": 473.32,"ask": 498.26,"bid": 497.76,"last": 498.02,"timestamp": "Mon, 13 Jun 2016 14:26:07 -0000","volume_btc": 1703.35,"volume_percent": 0.7} I would like to have a simple python script that will query the API, extract the "bid" value and then give it back to me in Alfred. I'm trying to base my script off the Pinboard tutorial but it's not working so far. Can anyone help?
tvaughan Posted June 13, 2016 Author Posted June 13, 2016 After a bit more bashing, I managed to get something to work. My script is linked in case it's useful to someone, although no doubt it could use some cleaning up!
deanishe Posted June 13, 2016 Posted June 13, 2016 You could remove almost all the imports but the code looks otherwise spot-on.If you want to share the workflow, it might be a better idea to export it and put it on Packal rather than just post the script here. That way, if someone wants to use it, they can just download and install it instead of having to create their own workflow to put the script in, install Alfred-Workflow etc. tvaughan 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now