Skip to content

Instantly share code, notes, and snippets.

@HarshCasper
Created July 9, 2020 06:16
Show Gist options
  • Save HarshCasper/6c5d16cd5b7b7e793c7639c8ac691041 to your computer and use it in GitHub Desktop.
Save HarshCasper/6c5d16cd5b7b7e793c7639c8ac691041 to your computer and use it in GitHub Desktop.
@app.route('/givetext/<sub>')
def text_meme(sub): #showerthoughts or quotes
r = get_text(sub,100)
requsted = random.choice(r)
return jsonify({
'Title': requsted["Title"],
'Selftext': requsted["text"],
'Upvotes': requsted["Upvotes"],
'Downvotes': requsted["Downvotes"],
'Redditurl': requsted["Redditurl"],
'Subreddit': requsted["Subreddit"]
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment