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 nltk | |
import random | |
import re | |
STATIONS = [ | |
'Admiralty MRT', | |
'Aljunied MRT', | |
'Ang Mo Kio MRT', | |
'Bartley MRT', | |
'Bayfront MRT', |
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 simplejson, urllib | |
import re | |
import time | |
import operator | |
import os | |
import sys | |
import argparse | |
from collections import defaultdict | |
REMOVE_HTML_TAGS = r'<[^>]+>' |
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 glob | |
import os | |
import json | |
import sys | |
from collections import defaultdict | |
users = defaultdict(lambda: { 'followers': 0 }) | |
for f in glob.glob('twitter-users/*.json'): | |
data = json.load(file(f)) |
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 tweepy | |
import time | |
import os | |
import sys | |
import json | |
import argparse | |
FOLLOWING_DIR = 'following' | |
MAX_FRIENDS = 200 | |
FRIENDS_OF_FRIENDS_LIMIT = 200 |
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
log_format le_json '"time": "$time_iso8601", ' | |
'"remote_addr": "$remote_addr", ' | |
'"remote_user": "$remote_user", ' | |
'"body_bytes_sent": "$body_bytes_sent", ' | |
'"request_time": "$request_time", ' | |
'"status": "$status", ' | |
'"request": "$request", ' | |
'"request_method": "$request_method", ' | |
'"http_referrer": "$http_referer", ' | |
'"http_user_agent": "$http_user_agent"'; |