Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Access Twitter API 1.1 in browser.
- ** Get your access keys to use Twitter API 1.1: https://dev.twitter.com/docs/auth/tokens-devtwittercom
- ** Format JSON in Firefox: https://addons.mozilla.org/EN-us/firefox/addon/jsonview/
- ** You can change Twitter API URL and Twitter screen_name, then execute script from a trusted web page without CSP protection like about:blank in Firefox Scratchpad or any other browser console.
- */
- var script = document.createElement("script");
- script.setAttribute("src", "https://pastebin.com/raw/HFjqYLdG"); // http://oauth.googlecode.com/svn/code/javascript/oauth.js (down)
- document.body.appendChild(script);
- script.addEventListener("load", function() {
- var script2 = document.createElement("script");
- script2.setAttribute("src", "https://pastebin.com/raw/M0N8JKwf"); // http://pajhome.org.uk/crypt/md5/sha1.js
- document.head.appendChild(script2);
- script2.addEventListener("load", function() {
- var url = "https://api.twitter.com/1.1/statuses/user_timeline.json";
- var accessor = {
- token: "YYY",
- tokenSecret: "YYY",
- consumerKey : "YYY",
- consumerSecret: "YYY"
- };
- var message = {
- action: url,
- method: "GET",
- parameters: {screen_name: "jack"}
- };
- OAuth.completeRequest(message, accessor);
- OAuth.SignatureMethod.sign(message, accessor);
- document.location = url + '?' + OAuth.formEncode(message.parameters);
- });
- });
Add Comment
Please, Sign In to add comment