Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
Get first replies using twint
  • Loading branch information
nashtash authored Oct 7, 2019
1 parent 0031e88 commit 25a3303
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions 1_test_replies.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": [
"import nest_asyncio\n",
"import twint\n",
"\n",
"nest_asyncio.apply()\n",
"custom_query = \"\"\n",
"mentioned = {}\n",
"replied = {}\n",
"mentions = ['@Renatekuenast']\n",
"replies = ['chkuehl']\n",
"for m in mentions:\n",
" mentioned.update({m: {}})\n",
" custom_query += \"@{} OR \".format(m)\n",
"custom_query = custom_query[:-3]\n",
"\n",
"for r in replies:\n",
" replied.update({r: {}})\n",
" custom_query += \"to:{} OR \".format(r)\n",
"custom_query = custom_query[:-4]\n",
"\n",
"c = twint.Config()\n",
"c.Custom_query = custom_query\n",
"c.Store_object = True\n",
"c.Store_csv = True\n",
"c.Output = \"tweets_Renatekuenast_replies.csv\"\n",
"c.Hide_output = True\n",
"\n",
"twint.run.Search(c)\n",
"\n",
"tweets = twint.output.tweets_list"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.1"
}
},
"nbformat": 4,
"nbformat_minor": 2
}

0 comments on commit 25a3303

Please sign in to comment.