pseudocode for catch runtime
This commit is contained in:
+20
-22
@@ -14,8 +14,6 @@ from talent_lists import *
|
|||||||
from api import TwAPI
|
from api import TwAPI
|
||||||
import talenttweet as tt
|
import talenttweet as tt
|
||||||
|
|
||||||
cross_tweets_queue = dict()
|
|
||||||
|
|
||||||
## Returns list of tweets present in queue.txt
|
## Returns list of tweets present in queue.txt
|
||||||
def get_local_queue():
|
def get_local_queue():
|
||||||
# f = open(os.path.join(get_project_dir(), 'queue.txt'))
|
# f = open(os.path.join(get_project_dir(), 'queue.txt'))
|
||||||
@@ -34,24 +32,24 @@ def get_user_tweet_ids(id, limit=None):
|
|||||||
twint.run.Search(c)
|
twint.run.Search(c)
|
||||||
return [x.id for x in tweets]
|
return [x.id for x in tweets]
|
||||||
|
|
||||||
|
def work_on_queue():
|
||||||
|
# while Queue.txt has lines present
|
||||||
|
# attempt to deserialize first line of Queue.txt
|
||||||
|
# exit program if failed, stating error
|
||||||
|
# while post isn't successful
|
||||||
|
# attempt to post tweet
|
||||||
|
# delete serialized line from Queue.txt, save it
|
||||||
|
#
|
||||||
|
# we're done! post tweet announcing done with archives
|
||||||
|
pass
|
||||||
|
|
||||||
async def run():
|
async def run():
|
||||||
queue = get_local_queue()
|
pass
|
||||||
|
# if Queue.txt exists
|
||||||
# for user_id in talents.keys():
|
# work through the tweets in Queue.txt
|
||||||
# tweets_ids = get_user_tweet_ids(user_id, limit=20)
|
# else
|
||||||
# for id in tweets_ids:
|
# look through every talent's tweets, saving only cross-company tweets into a list
|
||||||
# ttweet = tt.TalentAPITweet(id)
|
# sort the list by tweet_id
|
||||||
# print(ttweet)
|
# create Queue.txt and save all tweets through there
|
||||||
|
# post a tweet announcing archival intent
|
||||||
# ids = get_user_tweet_ids(1413339084076978179, limit=20)
|
# work through the tweets in Queue.txt
|
||||||
# for id in ids:
|
|
||||||
# ttweet = tt.TalentAPITweet(tweet_id=id)
|
|
||||||
# print(ttweet)
|
|
||||||
|
|
||||||
# serialized_ttweet = '1573778069441200129 1390620618001838086 1664052905.0 m 70876713 1413326894435602434 r 1413326894435602434'
|
|
||||||
# ttweet = tt.TalentTweet.deserialize(serialized_ttweet)
|
|
||||||
# print(ttweet)
|
|
||||||
|
|
||||||
ttweet = tt.TalentAPITweet(1557021645331542016)
|
|
||||||
print(ttweet)
|
|
||||||
await TwAPI.instance.create_post(ttweet)
|
|
||||||
Reference in New Issue
Block a user