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 http = require('http'), | |
https = require('https'), | |
httpProxy = require('http-proxy'); | |
httpProxy.createServer(function (req, res, proxy) { | |
console.log("Received request."); | |
proxy.proxyRequest(req, res, { | |
host: 'graph.facebook.com', | |
port: '443', | |
https: true |
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 http = require('http'), | |
https = require('https'), | |
httpProxy = require('http-proxy'); | |
var server = httpProxy.createServer({ | |
target: { host: 'graph.facebook.com', port: 443, https: true }, | |
changeOrigin: true }, | |
function (req, res, proxy) { | |
console.log("Received request."); | |
server.proxy.response_buffer = new Buffer('', 'utf8'); |
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
npm http GET https://registry.npmjs.org/colors | |
npm http GET https://registry.npmjs.org/optimist | |
npm http GET https://registry.npmjs.org/pkginfo | |
npm http GET https://registry.npmjs.org/vows | |
npm http GET https://registry.npmjs.org/request | |
npm http GET https://registry.npmjs.org/async | |
npm http GET https://registry.npmjs.org/socket.io | |
npm http 304 https://registry.npmjs.org/colors | |
npm http 304 https://registry.npmjs.org/optimist | |
npm http 304 https://registry.npmjs.org/request |
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
import unittest | |
from mock import patch | |
class Class: | |
def __init__(self): | |
self.foo = 'bar' | |
class TestClass(unittest.TestCase): | |
@patch('__main__.Class') | |
def test_class(self, MockClass): |
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
<?php | |
header('Content-type: text/xml'); | |
$message = $_REQUEST['Body']; | |
?> | |
<Response> | |
<Sms><?php | |
if ($message == "CHANNEL") { | |
echo "1) ROCK 102 2) Ethnic Channel #2 3) Another Station"; | |
} else if ($message == "COUNTRY") { | |
echo "1) United States 2) Israel 3) Ireland"; |
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
<?php | |
require_once('Services/Twilio.php'); | |
require_once('auth.php'); | |
$client = new Services_Twilio($ACCOUNT_SID, $AUTH_TOKEN); | |
foreach($client->account->sms_messages->getIterator(0, 50, array("To"=>"+15556667777")) as $msg) { | |
print_r($msg); |
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
from flask import Flask | |
from twilio import twiml | |
# Declare and configure application | |
app = Flask(__name__, static_url_path='/static') | |
# Voice Request URL | |
@app.route('/voice', methods=['GET', 'POST']) |
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
<?php | |
// Set Weather Underground API key | |
$WUNDERGROUND_API_KEY = "xxxxxxxxx"; | |
// Include Twilio helper library | |
require_once('Services/Twilio.php'); | |
// Fetch latest weather for zipcode | |
$zip = $_REQUEST['FromZip']; | |
$ch = curl_init(); |
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
<?php | |
header('Content-type: text/xml'); | |
$twilio_number = $_REQUEST['To']; | |
?> | |
<Response> | |
<Dial callerId="<?php echo $twilio_number; ?>"> | |
<Number>+15558675309</Number> | |
</Dial> | |
</Response> |
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
# A SMS Ballot Stuffer | |
# Warning: this code will cost you fifty dollars. | |
from twilio.rest import TwilioRestClient | |
client = TwilioRestClient("ACxxxxxxxxxxx", "yyyyyyyyyyyyyy") | |
target_number = "+15558675309" | |
confirm = raw_input("Are you seriously going to pay $50 to win a SMS poll? [y/n]") |