This file contains 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 request = require('request') | |
// twitter authentication | |
var twitter_oauth = { | |
consumer_key: 'TWITTER_CONSUMER_KEY', | |
consumer_secret: 'TWITTER_CONSUMER_SECRET', | |
token: 'TWITTER_ACCESS_TOKEN', | |
token_secret: 'TWITTER_ACCESS_TOKEN_SECRET' | |
} |
This file contains 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
import os | |
import sys | |
import time | |
import json | |
import requests | |
from requests_oauthlib import OAuth1 | |
MEDIA_ENDPOINT_URL = 'https://upload.twitter.com/1.1/media/upload.json' |
This file contains 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
<?php | |
// Example app consumer secret found in apps.twitter.com | |
const APP_CONSUMER_SECRET = 'z3ZX4v7mAAUGykl3EcmkqbartmuW8VFOOzCloLx9Q45P0hLrFu'; | |
// Example token provided by incoming GET request | |
$token = $_GET['crc_token']; | |
/** | |
* Creates a HMAC SHA-256 hash created from the app TOKEN and | |
* your app Consumer Secret. | |
* @param token the token provided by the incoming GET request |
This file contains 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
/* | |
Implement a key-value store that presents the following minimal interface: | |
`put(k, v)` | |
`get(k, timestamp=None)` | |
When a timestamp is specified for the `get` operation, the `get` should return | |
the value that was associated with the key at that point in time. (Semantically, | |
this should be equivalent to getting in a time machine, going back to that point | |
in time, and then asking the key-value store for the current value.) |
This file contains 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
#!/bin/bash | |
# parse command line options | |
while [[ $# -gt 1 ]] | |
do | |
key="$1" | |
case $key in | |
-u|--url) | |
target_url="$2" |
This file contains 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
import os | |
import sys | |
import time | |
import json | |
import requests | |
from requests_oauthlib import OAuth1 | |
MEDIA_ENDPOINT_URL = 'https://upload.twitter.com/1.1/media/upload.json' |
This file contains 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 nconf = require('nconf') | |
var request = require('request') | |
// load config | |
nconf.file({ file: 'config.json' }).env() | |
// twitter authentication | |
var twitter_oauth = { | |
consumer_key: nconf.get('TWITTER_CONSUMER_KEY'), |
This file contains 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 request = require('request') | |
var fs = require("fs") | |
// twitter authentication | |
var twitter_oauth = { | |
consumer_key: 'redacted', | |
consumer_secret: 'redacted', | |
token: 'redacted', | |
token_secret: 'redacted' | |
} |
This file contains 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 nconf = require('nconf') | |
var request = require('request') | |
// load config | |
nconf.file({ file: 'config.json' }).env() | |
// twitter authentication | |
var twitter_oauth = { | |
consumer_key: 'redacted', |