Why Nostr? What is Njump?
2024-04-06 07:45:19
in reply to

OrangeCrush on Nostr: Another option is the pytrends package from Google. Here is a quick function to grab ...

Another option is the pytrends package from Google. Here is a quick function to grab a random trending search term from the US so that you can feed it into your AI prompts. There is much cooler stuff you can do with google but they are pretty rate limited for free requests.

from pytrends.request import TrendReq
pytrend= TrendReq()

def GetTrendingTopic():
df = pytrend.trending_searches(pn='united_states')
try:
# Grab a random trending event from today and grab as plaintext string from dataframe:
return str(df.sample(n=1).values[0]).split("\'")[1]
except:
return None
Author Public Key
npub1ds8fq94ec8h70m00sljstc4puq7mr7aulhp76660324yk4q2mx8sdyf93l