summaryrefslogtreecommitdiff
path: root/Data Scraping for Binance Announcements.ipynb
diff options
context:
space:
mode:
authordarroyolpz <darroyolpz@users.noreply.github.com>2019-09-07 18:32:34 +0200
committerGitHub <noreply@github.com>2019-09-07 18:32:34 +0200
commit13c44c71b37877944521d5824a507c0c42e6a4f9 (patch)
tree30b23e4c50ada023d97f13a28733e4f80ec52cc6 /Data Scraping for Binance Announcements.ipynb
parent37ce1116c68a136171f8eb0599f2baecf38227ed (diff)
Twitter functionality available
Diffstat (limited to 'Data Scraping for Binance Announcements.ipynb')
-rw-r--r--Data Scraping for Binance Announcements.ipynb63
1 files changed, 22 insertions, 41 deletions
diff --git a/Data Scraping for Binance Announcements.ipynb b/Data Scraping for Binance Announcements.ipynb
index d45aaa1..d7093b0 100644
--- a/Data Scraping for Binance Announcements.ipynb
+++ b/Data Scraping for Binance Announcements.ipynb
@@ -17,13 +17,13 @@
},
{
"cell_type": "code",
- "execution_count": 24,
+ "execution_count": 1,
"metadata": {},
"outputs": [],
"source": [
"import bs4 as bs\n",
"import urllib.request\n",
- "import tweepy, os"
+ "import tweepy, os, time"
]
},
{
@@ -35,7 +35,7 @@
},
{
"cell_type": "code",
- "execution_count": 37,
+ "execution_count": 2,
"metadata": {},
"outputs": [],
"source": [
@@ -59,7 +59,7 @@
},
{
"cell_type": "code",
- "execution_count": 2,
+ "execution_count": 3,
"metadata": {},
"outputs": [],
"source": [
@@ -75,7 +75,7 @@
},
{
"cell_type": "code",
- "execution_count": 13,
+ "execution_count": 4,
"metadata": {},
"outputs": [],
"source": [
@@ -91,7 +91,7 @@
},
{
"cell_type": "code",
- "execution_count": 14,
+ "execution_count": 5,
"metadata": {},
"outputs": [],
"source": [
@@ -120,15 +120,15 @@
},
{
"cell_type": "code",
- "execution_count": 17,
+ "execution_count": 6,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
- "CPU times: user 38.2 ms, sys: 3.74 ms, total: 41.9 ms\n",
- "Wall time: 147 ms\n"
+ "CPU times: user 30.9 ms, sys: 349 µs, total: 31.2 ms\n",
+ "Wall time: 77.1 ms\n"
]
}
],
@@ -139,54 +139,35 @@
]
},
{
- "cell_type": "code",
- "execution_count": 6,
+ "cell_type": "markdown",
"metadata": {},
- "outputs": [
- {
- "data": {
- "text/plain": [
- "[['Binance Lists Chiliz (CHZ)',\n",
- " 'https://www.binance.com/en/support/articles/360033377831'],\n",
- " ['Binance Completes Perlin Lottery Draw and Will Open Trading For PERL',\n",
- " 'https://www.binance.com/en/support/articles/360032900851'],\n",
- " ['Binance Lists Second BEP2 Community Listing Project - TomoChain (TOMO)',\n",
- " 'https://www.binance.com/en/support/articles/360032514812'],\n",
- " ['Introducing the Band Protocol (BAND) Token Sale on Binance Launchpad',\n",
- " 'https://www.binance.com/en/support/articles/360033102832'],\n",
- " ['Pepito', 'Fulanito']]"
- ]
- },
- "execution_count": 6,
- "metadata": {},
- "output_type": "execute_result"
- }
- ],
"source": [
- "new_urls = extract_binance(main_webpage, key_words)\n",
- "a = ['Pepito', 'Fulanito']\n",
- "new_urls.append(a)"
+ "Loop pass and get the new announcements"
]
},
{
"cell_type": "code",
- "execution_count": 31,
+ "execution_count": null,
"metadata": {},
"outputs": [
{
"name": "stdout",
"output_type": "stream",
"text": [
- "Pepito\n"
+ "Done for now. Time to go to sleep mate!\n"
]
}
],
"source": [
- "for item in new_urls:\n",
- " if item not in old_urls:\n",
- " msg = item[0]\n",
- " print(msg)\n",
- " #api.update_status('Testing')"
+ "# Loop pass - Watchdog mode\n",
+ "while True:\n",
+ " new_urls = extract_binance(main_webpage, key_words)\n",
+ " for item in new_urls:\n",
+ " if item not in old_urls:\n",
+ " msg = item[0] + '\\n' + item[1]\n",
+ " api.update_status(msg)\n",
+ " print('Done for now. Time to go to sleep mate!')\n",
+ " time.sleep(900) # Check every 15 min"
]
}
],