Temporary switch to syndication
This commit is contained in:
@@ -495,7 +495,7 @@ def fixTweetData(tweet):
|
|||||||
|
|
||||||
def extractStatus(url,workaroundTokens=None):
|
def extractStatus(url,workaroundTokens=None):
|
||||||
# TODO: commented out methods are too slow/unreliable at the moment
|
# TODO: commented out methods are too slow/unreliable at the moment
|
||||||
methods=[extractStatusV2Anon,extractStatusV2]#,extractStatusV2Android,extractStatusV2TweetDetail] #
|
methods=[extractStatus_syndication,extractStatusV2]#,extractStatusV2Android,extractStatusV2TweetDetail] #
|
||||||
for method in methods:
|
for method in methods:
|
||||||
try:
|
try:
|
||||||
result = method(url,workaroundTokens)
|
result = method(url,workaroundTokens)
|
||||||
|
|||||||
10
twitfix.py
10
twitfix.py
@@ -287,17 +287,17 @@ def getTweetData(twitter_url,include_txt="false",include_rtf="false"):
|
|||||||
|
|
||||||
def getUserData(twitter_url,includeFeed=False):
|
def getUserData(twitter_url,includeFeed=False):
|
||||||
if config['config']['workaroundTokens'] is not None:
|
if config['config']['workaroundTokens'] is not None:
|
||||||
workaroundTokens = config['config']['workaroundTokens'].split(",")
|
workaroundTokens = config['config']['workaroundTokens'].split(",")
|
||||||
else:
|
else:
|
||||||
workaroundTokens = None
|
workaroundTokens = None
|
||||||
rawUserData = twExtract.extractUser(twitter_url,workaroundTokens=workaroundTokens))
|
rawUserData = twExtract.extractUser(twitter_url,workaroundTokens=workaroundTokens)
|
||||||
userData = getApiUserResponse(rawUserData)
|
userData = getApiUserResponse(rawUserData)
|
||||||
|
|
||||||
if includeFeed:
|
if includeFeed:
|
||||||
if userData['protected']:
|
if userData['protected']:
|
||||||
userData['latest_tweets']=[]
|
userData['latest_tweets']=[]
|
||||||
else:
|
else:
|
||||||
feed = twExtract.extractUserFeedFromId(userData['id'],workaroundTokens=workaroundTokens))
|
feed = twExtract.extractUserFeedFromId(userData['id'],workaroundTokens=workaroundTokens)
|
||||||
apiFeed = []
|
apiFeed = []
|
||||||
for tweet in feed:
|
for tweet in feed:
|
||||||
apiFeed.append(getApiResponse(tweet))
|
apiFeed.append(getApiResponse(tweet))
|
||||||
|
|||||||
Reference in New Issue
Block a user