Rank | Popularity | Followers | Friends | Name (@twitter) |
---|---|---|---|---|
1 | 12476 | 13377 | 0 | Hacker News 20 (@newsyc20) |
2 | 5266 | 3781036 | 872 | TechCrunch (@TechCrunch) |
3 | 4600 | 17099119 | 165 | Bill Gates (@BillGates) |
4 | 3921 | 8836866 | 411 | A Googler (@google) |
5 | 3890 | 3115526 | 72 | WIRED (@WIRED) |
6 | 3562 | 31793932 | 131 | Twitter (@twitter) |
7 | 3488 | 4289712 | 2773 | Mashable (@mashable) |
8 | 3410 | 151838 | 2197 | The Hacker News (@TheHackersNews) |
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
packages: | |
yum: | |
gcc-c++: [] | |
make: [] | |
sources: | |
/home/ec2-user: http://download.redis.io/releases/redis-2.8.4.tar.gz | |
commands: | |
redis_build: | |
command: make | |
cwd: /home/ec2-user/redis-2.8.4 |
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
""" | |
Twitter API wrapper based on Tweepy using the RateLimitHandler | |
with multiple access tokens (see https://github.com/svven/tweepy). | |
It also handles API method cursors and splits input param lists in | |
chunks if neccessary. | |
""" | |
from tweepy import API, Cursor, RateLimitHandler | |
from tweepy.error import TweepError | |
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, sys, psutil | |
import requests | |
from contextlib import closing | |
def request(url): | |
with closing(requests.get(url, stream=True, timeout=10)) as response: | |
response.raise_for_status() | |
# content = response.content | |
chunk = response.iter_content(512) |
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 redis import Redis | |
from rq import Queue, Connection, Worker | |
def enqueue_urls(urls=[]): | |
if len(urls) == 0: # load from file | |
with open('urls.txt', 'r') as file: | |
for url in file: | |
urls.append(url.strip()) | |
with Connection(): | |
q = Queue('test') |
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 redis | |
r = redis.StrictRedis() | |
r.zadd('k1', 1, 'a', 2, 'b', 3, 'c') | |
r.zadd('k2', 2, 'a', 3, 'b', 4, 'c') | |
r.zadd('k3', 3, 'a', 4, 'b', 5, 'c') | |
from zunion_range_score import zunion_range_score as zunionrangescore |
Rank | Popularity | Followers | Friends | Name (@twitter) |
---|---|---|---|---|
1 | 90708 | 96859 | 1 | Hacker News (@newsycombinator) |
2 | 44661 | 4817719 | 669 | TechCrunch (@TechCrunch) |
3 | 37817 | 20816944 | 166 | Bill Gates (@BillGates) |
4 | 32030 | 10456263 | 437 | Google (@google) |
5 | 31453 | 4214811 | 194 | WIRED (@WIRED) |
6 | 30744 | 1797099 | 44 | Elon Musk (@elonmusk) |
7 | 29658 | 5110615 | 2799 | Mashable (@mashable) |
8 | 28987 | 232056 | 139 | Paul Graham (@paulg) |
Top most followed by @newsycombinator's followers
Rank | Popularity | Followers | Friends | Name (@twitter) |
---|---|---|---|---|
1 | 98020 | 105062 | 2 | Hacker News (@newsycombinator) |
2 | 48503 | 5350899 | 683 | TechCrunch (@TechCrunch) |
3 | 41285 | 23286724 | 166 | Bill Gates (@BillGates) |
4 | 35720 | 2334285 | 48 | Elon Musk (@elonmusk) |
5 | 34611 | 11758308 | 448 | Google (@google) |
6 | 34424 | 4816092 | 217 | WIRED (@WIRED) |
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
<html> | |
<head> | |
<link href="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/css/bootstrap.min.css" rel="stylesheet" /> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script> | |
<script src="//cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.5/js/bootstrap.min.js"></script> | |
<script src="//platform.twitter.com/widgets.js"></script> | |
</head> | |
<body> | |
Show tweet in popover | |
--------------------- |
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 sys, time | |
def chunks(l, n): | |
c = len(l) | |
for i in xrange(0, c, n): | |
sys.stdout.write("\r%d%%" % (min(i+n,c)*100/c,)) | |
sys.stdout.flush() | |
yield l[i:i+n] | |
for chunk in chunks(range(100), 10): |
OlderNewer