for stringout in stringsout:
bot.automsg(public, nick, stringout)
-def getTweet(urlstring,twitapi,inclusion=False):
+def getTweet(urlstring,twitapi,inclusion=False,recurlvl=0):
unobfuscate_urls=True
expand_included_tweets=True
stringsout=[]
if expand_included_tweets:
if rv.hostname == 'twitter.com' and re.search(r'status/\d+',rv.path):
- quotedtweet = getTweet(toReplace, twitapi, inclusion=True) # inclusion parameter limits recursion.
- if not quotedtweet:
- quotedtweet = [""]
- quotedtweet[0] = "Q{ " + quotedtweet[0]
- quotedtweet[-1] += " }"
- stringsout = quotedtweet + stringsout
+ if recurlvl > 2
+ stringsout = [ "{{ Recursion level too high }}" ] + stringsout
+ else:
+ quotedtweet = getTweet(toReplace, twitapi, inclusion=True, recurlvl=recurlvl+1) # inclusion parameter limits recursion.
+ if not quotedtweet:
+ quotedtweet = [""]
+ quotedtweet[0] = "Q{ " + quotedtweet[0]
+ quotedtweet[-1] += " }"
+ stringsout = quotedtweet + stringsout
tweetText = tweetText.replace(url.url, toReplace)