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
from xml.dom import minidom | |
from cStringIO import StringIO | |
class Graph(): | |
""" | |
Create a Graph object and get its gexf representation. | |
Add nodes and edges using add_node() and add_edge() methods. | |
Use gexf() to get the file-like object containing the graph. | |
""" |
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
#encoding:utf-8 | |
from datetime import datetime, timedelta | |
import unicodecsv | |
from delorean import parse | |
client = UserClient( | |
CONSUMER_KEY, | |
CONSUMER_SECRET, | |
ACCESS_TOKEN, |
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
""" | |
FIXME: Cannot use C extensions. See below: | |
http://www.perrygeo.com/running-python-with-compiled-code-on-aws-lambda.html | |
http://stackoverflow.com/questions/34749806/using-moviepy-scipy-and-numpy-in-amazon-lambda | |
""" | |
from datetime import datetime | |
from urlparse import urlparse | |
from os import path |
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
from twython import Twython, TwythonStreamer | |
tokens = [ | |
] | |
username = '' | |
rest_client = Twython(*tokens) | |
class Streamer(TwythonStreamer): |
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
""" | |
- Takes a file which has one name on each line | |
- Searches for Twitter users; tries combinations for names longer than 2 words | |
- Returns the most probable username | |
""" | |
from twython import Twython | |
import itertools |
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
""" | |
This script fetches tweets according to the given criteria and saves them in a CSV file. | |
How to use it: | |
- Install the dependencies: | |
$ pip install twython unicodecsv | |
- Go to https://apps.twitter.com and create an application. Under the "Keys and Access Tokens" tab get your keys and insert them below. |
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 | |
from fabric.api import abort, run, sudo, env, cd | |
from fabric.colors import red, green | |
from fabric.contrib.files import exists, put, upload_template | |
ROOT = '/home/jquick/code/' | |
WORKON = '/home/jquick/.virtualenvs' | |
VENVS = { |
NewerOlder