altryne Posted March 29, 2013 Posted March 29, 2013 (edited) UPDATE 25/05/13 - rewrote the whole damn thing in python, added aleoop for quick updates Hey guys, I've finished creating a pocket workflow, I know there are several already in the forums, but this one doesn't require your username/password at any point. (Not that other workflow creators are malicious!) You can download it here (https://github.com/altryne/pocket_alfred/raw/master/Pocket%20workflow.alfredworkflow) and all the code on github (the code is a bit of a mess, I was learning ruby as I was writing) Usage : First login with "pocket_login", this will redirect you to the pocket site to authorize Afterwards use "pocket" to share a URLs Supports : Chrome - if running Safari - if running Clipboard - if contains URL I've banged my head for a long time trying to achieve the sleak oAuth flow, and finally done it, if anyone's interested I can write a blogpost about it. Lemme know what you think, and what improvements/suggestions you may have. credits to https://github.com/vitorgalvao/alfred-workflows/blob/master/Pinadd/pinadd for the chrome and safari applescripts Edited May 25, 2013 by altryne phyllisstein, twinpeaks, garciamax and 5 others 8
phyllisstein Posted March 29, 2013 Posted March 29, 2013 Great work with the oAuth stuff. Gives me a nasty headache, personally. altryne 1
altryne Posted March 29, 2013 Author Posted March 29, 2013 Great work with the oAuth stuff. Gives me a nasty headache, personally. I've tried to write the process step by step on my blog, maybe will make your headache hurt less http://alexw.me/2013/03/save-url-to-pocket-with-alfred-workflow-using-oauth/ dkoder and ApeWare 2
altryne Posted March 30, 2013 Author Posted March 30, 2013 Awesome workflow! Any chance of adding the ability to browse latest entries or search for items by tag? It's a bit beyond me right now, I wasn't sure how to use gems with ruby scripts in alfred, so all the code is pure ruby 1.8 (is what ships with mnt lion) As the Pocket API returns a json object, serializing it myself is too tough of a job, unless someone can help me with it
drking Posted March 30, 2013 Posted March 30, 2013 I am getting the following message when I try to save a URL to Pocket: "Something went wrong. Try to login again". The authorization process itself goes through fine and I even get the message that I'm successfully connected to Pocket. I only get the error message when trying to save a URL.
ClintonStrong Posted March 30, 2013 Posted March 30, 2013 (edited) It's a bit beyond me right now, I wasn't sure how to use gems with ruby scripts in alfred, so all the code is pure ruby 1.8 (is what ships with mnt lion) As the Pocket API returns a json object, serializing it myself is too tough of a job, unless someone can help me with it Have a look at Duane Johnson's install_gem.sh script to easily install gems in the workflow's directory. You could also look in to using Bundler and running `bundle install --standalone --clean` after setting up your Gemfile (this is what Zhao Cai's ruby template uses). Bundler basically lets you declare all your dependencies in one file so you can easily install/update them all at once. Edited March 30, 2013 by Clinton Strong altryne 1
ebence Posted March 30, 2013 Posted March 30, 2013 I am getting the following message when I try to save a URL to Pocket: "Something went wrong. Try to login again". The authorization process itself goes through fine and I even get the message that I'm successfully connected to Pocket. I only get the error message when trying to save a URL. Same for me.
altryne Posted March 30, 2013 Author Posted March 30, 2013 Have a look at Duane Johnson's install_gem.sh script to easily install gems in the workflow's directory. You could also look in to using Bundler and running `bundle install --standalone --clean` after setting up your Gemfile (this is what Zhao Cai's ruby template uses). Bundler basically lets you declare all your dependencies in one file so you can easily install/update them all at once. If I use bundler, does that mean that everyone who uses the workflow has to have bundler installed? (i'm really new into ruby) I am getting the following message when I try to save a URL to Pocket: "Something went wrong. Try to login again". The authorization process itself goes through fine and I even get the message that I'm successfully connected to Pocket. I only get the error message when trying to save a URL. Same for me. Can you guys please go into the workflow directory, and remove the "token" file from there, and try to login again?
ClintonStrong Posted March 30, 2013 Posted March 30, 2013 If I use bundler, does that mean that everyone who uses the workflow has to have bundler installed? (i'm really new into ruby) Oh, sorry about that. When you use `bundle install --standalone`, it creates a folder called 'bundle' in the current directory and installs the gems there. If you add `require 'bundle/bundler/setup.rb'` to your file, it'll set up the paths to the gems even if Bundler isn't installed.
drking Posted March 30, 2013 Posted March 30, 2013 I tried removing the token file as suggested, as well as reinstalling the workflow and neither seemed to work for me -- still getting the same error message. Thanks
altryne Posted March 31, 2013 Author Posted March 31, 2013 Same for me. Can you please download this version : http://d.pr/f/xwXo And try to login and then post something? If it fails, please go into workflow folder and send me the log.txt file, I'll take a look.
Guest Posted March 31, 2013 Posted March 31, 2013 Same here. It can't save URLs. I've sent you a log, via Message.
drking Posted March 31, 2013 Posted March 31, 2013 Downloaded new version. Still getting the same error message. Just sent you the log file as well. Thanks
altryne Posted April 3, 2013 Author Posted April 3, 2013 Does this work for anyone at all? i've tested it a lot with different users on different macs, and it seemed to work, but when I went through the logs guys here who it didn't work for, I saw bugs I couldn't replicate (or understand) So, does this code work for anybody exept me and all my 4 macs and 2 users? This will greatly save me some time debugging/rewriting if I know that I'm the only one this works for twinpeaks 1
drking Posted April 3, 2013 Posted April 3, 2013 I got it to work 1 time yesterday after I re-downloaded the workflow. It was able to save the first URL I clicked on, but after that, any time I tried to save any other URL's, I got the error message. I've tried re-authorizing several times, re-downloading the workflow, and saving different URL's from various sites and still get the error message. Thanks for working on this. I love the workflow and would be using it frequently.
twinpeaks Posted April 3, 2013 Posted April 3, 2013 Tried many times but I still get a successful login, picks up the frontmost tab's address or clipboard if there is one, -> message saying something went wrong please login again. Tried deleting the token, whole workflow, diff browsers, - kinda lost. Thank you for the effort though!
fxv Posted April 4, 2013 Posted April 4, 2013 support for optionally adding tags to the saved url would be awesome !
donosaur Posted April 12, 2013 Posted April 12, 2013 (edited) Love the workflow, but it stopped working for me as well. Sometimes it would say that it successfully added the the page, and it would indeed show up in my Pocket app, but when opening up the article Pocket would tell me that "This page does not appear to be an article" and will not even show a thumbnail image like it usually does. Also, when trying to view the page in a web view, the page never loads. Edited April 12, 2013 by donosaur
petebocken Posted May 17, 2013 Posted May 17, 2013 What's the latest on this? I'd love to use it. I keep getting "Something went wrong. Try to login again" as well.
dkoder Posted May 23, 2013 Posted May 23, 2013 this is a great workflow and would love to use it if it wasn't for the error message. i have no problems with the oAuth login but it's saving the url and messing with it. it saves the link but when you click to go to the original page it renders an error message (you can see the garbled percentage character in the address bar) any plans on updating the workflow good friend developer?
altryne Posted May 23, 2013 Author Posted May 23, 2013 this is a great workflow and would love to use it if it wasn't for the error message. i have no problems with the oAuth login but it's saving the url and messing with it. it saves the link but when you click to go to the original page it renders an error message (you can see the garbled percentage character in the address bar) any plans on updating the workflow good friend developer? Thanx, currently started a new job and don't really have time, I hope to work on it some time soon, will update here
dkoder Posted May 24, 2013 Posted May 24, 2013 Thanx, currently started a new job and don't really have time, I hope to work on it some time soon, will update here good news in this economy thanks for the feedback, and best of luck with the new job!
altryne Posted May 25, 2013 Author Posted May 25, 2013 Love the workflow, but it stopped working for me as well. Sometimes it would say that it successfully added the the page, and it would indeed show up in my Pocket app, but when opening up the article Pocket would tell me that "This page does not appear to be an article" and will not even show a thumbnail image like it usually does. Also, when trying to view the page in a web view, the page never loads. What's the latest on this? I'd love to use it. I keep getting "Something went wrong. Try to login again" as well. this is a great workflow and would love to use it if it wasn't for the error message. i have no problems with the oAuth login but it's saving the url and messing with it. it saves the link but when you click to go to the original page it renders an error message (you can see the garbled percentage character in the address bar) any plans on updating the workflow good friend developer? Please try now guys, and lemme know if this works for ya https://github.com/altryne/pocket_alfred/raw/master/Pocket%20workflow.alfredworkflow
petebocken Posted May 25, 2013 Posted May 25, 2013 Works for me! Thanks so much!!!!!!!!!!!! Please try now guys, and lemme know if this works for ya https://github.com/altryne/pocket_alfred/raw/master/Pocket%20workflow.alfredworkflow
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