Skip to content

Instantly share code, notes, and snippets.

@no1xsyzy
Created March 9, 2019 08:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save no1xsyzy/0de2e58abedd8f57ec47ab276ad7ed64 to your computer and use it in GitHub Desktop.
Save no1xsyzy/0de2e58abedd8f57ec47ab276ad7ed64 to your computer and use it in GitHub Desktop.
((m=>`${m.replace(/([?&])name=[^&]+/, "$1name=orig")} --out=twitter${(x=>x[x.length-1])(window.location.pathname.split("/"))}.${/[&?]format=([^&]+)&/.exec(m)[1]}`)(document.querySelector(`div[data-testid="primaryColumn"] img[src^="https://pbs.twimg.com/media"]`).src))
((ms,f)=>ms.map(f(ms.length>1)).join("\n"))(Array.from(document.querySelectorAll(`div[data-testid="primaryColumn"] img[src^="https://pbs.twimg.com/media"]`)).map(x=>x.src), (l=>{var c=0;return m=>`${m.replace(/([?&])name=[^&]+/, "$1name=orig")} --out=twitter${(x=>x[x.length-1])(window.location.pathname.split("/"))}${l?"-"+("0"+(++c)).slice(-2,100):""}.${/[&?]format=([^&]+)&/.exec(m)[1]}`}))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment