Created
March 20, 2016 15:57
-
-
Save peregrinogris/9434de3589128a4ed9df to your computer and use it in GitHub Desktop.
Parse pocket links
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var texts = Array.map( | |
document.querySelectorAll('#queue .item_content'), | |
elem => { | |
let link_text = elem.querySelector('.title').text; | |
let link_url = decodeURIComponent(elem.querySelector('.original_url').href.replace('https://getpocket.com/redirect?url=', '')); | |
let tags = Array.map(elem.querySelectorAll('.tag'), elem => elem.text); | |
return [ | |
link_text, | |
link_url, | |
tags | |
] | |
} | |
); | |
console.log(texts.reduce( | |
(prev, curr) => `${prev}\n[${curr[2]}] ${curr[0]} - ${curr[1]}`, | |
'' | |
)); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can run this on your browser console while looking at your Pocket queue, it'll dump all the visible items.