-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
19 changed files
with
77 additions
and
17 deletions.
There are no files selected for viewing
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
Binary file not shown.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#for twitter scrapping | ||
CONSUMER_KEY = 'dF8LarLqWcQAlZ3FqomAFGWNZ' | ||
CONSUMER_SECRET = 'eaKxAM5scchwogxYo8oEzC4XkangtrDMsuNqx8ZlqBDuVMpBpZ' | ||
ACCESS_TOKEN = '1046391379360919552-IOEg7xCFH03syq18cGhU3DJxDRVj4D' | ||
ACCESS_TOKEN_SECRET = 'UUjxB6r8yyEQAe0ffcGI7oqPvKI50pxwwmZGSmXkbQbt3' | ||
|
||
#email de notifications |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,5 +8,5 @@ djangorestframework | |
gunicorn | ||
psycopg2-binary | ||
dj-database-url | ||
Scrapy | ||
tweepy | ||
feedparser |
Binary file not shown.
Binary file not shown.
Binary file not shown.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Generated by Django 3.0.4 on 2020-06-25 21:49 | ||
|
||
from django.db import migrations | ||
|
||
|
||
class Migration(migrations.Migration): | ||
|
||
dependencies = [ | ||
('robot', '0001_initial'), | ||
] | ||
|
||
operations = [ | ||
migrations.RemoveField( | ||
model_name='tweets', | ||
name='url', | ||
), | ||
] |
6 changes: 3 additions & 3 deletions
6
robot/migrations/0002_auto_20200622_1632.py → robot/migrations/0003_auto_20200625_2356.py
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
Binary file not shown.
Binary file removed
BIN
-589 Bytes
robot/migrations/__pycache__/0002_auto_20200622_1632.cpython-38.pyc
Binary file not shown.
Binary file not shown.
Binary file added
BIN
+587 Bytes
robot/migrations/__pycache__/0003_auto_20200625_2356.cpython-38.pyc
Binary file not shown.
Binary file not shown.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import tweepy | ||
import sys | ||
from .models import Tweets | ||
from config import ACCESS_TOKEN, ACCESS_TOKEN_SECRET,CONSUMER_KEY,CONSUMER_SECRET | ||
|
||
def getTweets(counts): | ||
|
||
auth = tweepy.OAuthHandler(CONSUMER_KEY, CONSUMER_SECRET) | ||
auth.set_access_token(ACCESS_TOKEN, ACCESS_TOKEN_SECRET) | ||
|
||
api = tweepy.API(auth) | ||
try: | ||
api.verify_credentials() | ||
print('Authentication Successful') | ||
except: | ||
print('Error while authenticating API') | ||
sys.exit(1) | ||
|
||
covid_tweets = tweepy.Cursor(api.search, q='فيروس كورونا').items(counts) | ||
for tweet in covid_tweets: | ||
tweetObj= Tweets.objects.create(content=tweet.text, date=tweet.created_at, proprio=tweet.user.name) | ||
tweetObj.save() |
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
Empty file.