Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
{
"cells": [
{
"cell_type": "code",
"execution_count": 2,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"api_key = ''\n",
"api_secret = ''\n",
"access_token = ''\n",
"token_secret = ''\n",
"\n",
"import tweepy\n",
"\n",
"auth = tweepy.OAuthHandler(api_key, api_secret)\n",
"auth.set_access_token(access_token, token_secret)\n",
"\n",
"api = tweepy.API(auth)\n",
"\n",
"bios = []"
]
},
{
"cell_type": "code",
"execution_count": 3,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
"🛠💡\n",
"renewed love of Star Wars Nadeshot is my dad\n",
"We have the technology. 14/88 WN Baker of Zog and Stomper of Nog \n",
"If you're a keyboard warrior up your fucking game. Prima is muh wife.\n",
"Financial Markets - Technical Analysis - Portfolio Management\n",
"RTs not endorsements\n",
"It is no measure of health to be well adjusted to a profoundly sick society. - J. Krishnamurthi ........ Stand Truth to Power!\n",
"miserable failure of a man, level 10 shitposter, Franklin Pierce/Julian Edelman lookalike. blocked by Steve Shives. INTJ as fuck.\n",
"#frogtwitter\n",
"#fascist\n",
"#bodybuilder\n",
"#testosterone\n",
"Traditionalist Worker Party\n",
"\n",
"Local solutions to the globalist problem.\n",
"\n",
"This is the official account of the Traditionalist Worker Party.\n",
"Adherent to the fourteen words. White Working Class gent. Staunch anti-communist. Committed to the cause of racial survival.\n",
"#AntiAntifa\n",
"#DailyStormer\n",
"\n",
"23 | 4th year LL.B. Law student | Scottish Nationalist | Great appreciation for sarcasm | A lover of the Oxford Comma!\n",
"blocked by both @ericbolling & @dwstweets - telling, ain't it? // μολὼν λαβέ // #tcot // USAF vet /// recovering atheist // #Cruz2020\n",
"No white guilt here\n",
"self employed real estate broker and business owner Life Insurance Exams Business EMSI 003\n",
"\n",
"\n",
"Anglo Irish, brexiteer, father.\n",
"Change is in the air!!!!!\n",
"white nationalist, ambidextrous,atheist ab-,Afrikaner(German/Dutch descent),horror/paranormal/sci-fi.\n",
"family and white race first as above all others\n",
"Democrat-turned-Republican. I finally woke up! #MAGA 🇺🇸 ANTI-PC 🇺🇸 Pro #1a & #2a 🇺🇸Secure Borders 🇺🇸 #ExtremeVetting 🇺🇸 #AmericaFirst 🇺🇸 #ProLife\n",
"Born and raised Texan, but in the wrong place.\n",
"My Gab.ai account is also @GhostZodick\n"
]
}
],
"source": [
"spencer_followers = api.followers('richardbspencer', cursor=\"1565238126554761647\")\n",
"# cursors = [\n",
"# \"-1\",\"1565590391200048986\",\"1565579729561474469\",\n",
"# \"1565567881974262757\",\"1565560088164343083\",\"1565549442877952883\",\n",
"# \"1565536342815357033\",\"1565530182468622326\",\"1565524477502753390\",\n",
"# \"1565520220053361448\",\"1565512521059512882\",\"1565501591863951030\",\n",
"# \"1565489554884214789\",\"1565480039652990039\",\"1565459958232255041\",\n",
"# \"1565446531410186451\",\"1565437527955489253\",\"1565426693172033147\",\n",
"# \"1565418245859238333\",\"1565410783160187143\",\"1565401278143322882\",\n",
"# \"1565392173591331783\",\"1565380861383785956\",\"1565366317536081838\",\n",
"# \"1565354425812671972\",\"1565345099973278707\",\"1565337090581884162\",\n",
"# \"1565322580827884093\",\"1565311512832938253\",\"1565300492080905789\",\n",
"# \"1565289239192765998\",\"1565273804037537469\",\"1565262505359576232\",\n",
"# \"1565255161106617818\",\"1565245579070127261\", \"1565238126554761647\"]\n",
"\n",
"for user in spencer_followers[0]:\n",
" bio = user.description\n",
" bios.append(bio)\n",
" print bio"
]
},
{
"cell_type": "code",
"execution_count": 4,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"20"
]
},
"execution_count": 4,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"len(bios)"
]
},
{
"cell_type": "code",
"execution_count": 7,
"metadata": {},
"outputs": [
{
"data": {
"text/plain": [
"[u'\\U0001f6e0\\U0001f4a1',\n",
" u'renewed love of Star Wars Nadeshot is my dad',\n",
" u\"We have the technology. 14/88 WN Baker of Zog and Stomper of Nog \\nIf you're a keyboard warrior up your fucking game. Prima is muh wife.\",\n",
" u'Financial Markets - Technical Analysis - Portfolio Management\\nRTs not endorsements',\n",
" u'It is no measure of health to be well adjusted to a profoundly sick society. - J. Krishnamurthi ........ Stand Truth to Power!',\n",
" u'miserable failure of a man, level 10 shitposter, Franklin Pierce/Julian Edelman lookalike. blocked by Steve Shives. INTJ as fuck.',\n",
" u'#frogtwitter\\n#fascist\\n#bodybuilder\\n#testosterone',\n",
" u'Traditionalist Worker Party\\n\\nLocal solutions to the globalist problem.\\n\\nThis is the official account of the Traditionalist Worker Party.',\n",
" u'Adherent to the fourteen words. White Working Class gent. Staunch anti-communist. Committed to the cause of racial survival.\\n#AntiAntifa\\n#DailyStormer',\n",
" u'']"
]
},
"execution_count": 7,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"bios[:10]"
]
},
{
"cell_type": "code",
"execution_count": 91,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import pickle\n",
"\n",
"pickle.dump(bios, open('bios.pickle', 'wb'))"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 2",
"language": "python",
"name": "python2"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 2
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython2",
"version": "2.7.12"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.