Skip to content

Instantly share code, notes, and snippets.

@AyaMorisawa
Last active June 1, 2017 14:13
Show Gist options
  • Save AyaMorisawa/4c8835e6bfe71d72790a86dd1117ba8f to your computer and use it in GitHub Desktop.
Save AyaMorisawa/4c8835e6bfe71d72790a86dd1117ba8f to your computer and use it in GitHub Desktop.
import { OAuth1Session } from 'requests_oauthlib';
import json from 'json';
let savedSession = json.load(open('./twitter.json', 'r'));
let sess = OAuth1Session(
savedSession.ck
savedSession.cs
savedSession.at
savedSession.cs
);
const baseUrl = 'https://api.twitter.com/1.1/';
sess.post(
baseUrl + 'statuses/update.json',
{data: {statuses: 'Hello, World!'}}
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment