import gradio as gr demo = gr.Blocks() def fun1(): tweet_link = "https://t.co/yZlSG6mDW6" #json_response['data'][0]['text'].split()[-1] tweet_text = "Exploring through Random Curiosity with General Value Functions abs: https://t.co/rnbmQcHDUu" #' '.join(json_response['data'][0]['text'].split()[:-1]) tweet_createdat = "2022-11-21T03:33:22.000Z" #json_response['data'][0]['created_at'] print("tweetssss ====>", tweet_text, tweet_link, tweet_createdat) sample_text = """
""" embed_url1 = 'Tweets by _akhaliq ' embed_url2 = """Tweets by _akhaliq """ embed_url3 = """ """ embed_url4 = """ Tweets by @_akhaliq """ embed_url5 = """Tweets by @marycamacho """ embed_url6a = """Tweets by yvrjsharma """ embed_url6b = 'Tweets by yvrjsharma ' embed_url6c = """Tweets by yvrjsharma """ embed_url7 = """""" + tweet_text + '
— Yuvi (@yvrjsharma) '+ tweet_createdat + """
""" embed_url8 = """It's never too early to start on @Gradio and @huggingface Spaces😃- Helped my 12 yo nephew to build an ML App for his inter-school science project. This project helps in social wellbeing by giving people a choice to filter negative and positive News. https://t.co/0L1WAMQpWV
— Yuvi (@yvrjsharma) November 11, 2022
""" return embed_url7 , sample_text, embed_url8 with demo: with gr.Row(): b1 = gr.Button("Twitter Feed") with gr.Row(): twitter_pane1 = gr.HTML() #gr.Markdown() #gr.HTML() twitter_pane2 = gr.Markdown() #gr.HTML() twitter_pane3 = gr.Markdown() #gr.HTML() #twitter_pane4 = gr.Markdown() #gr.HTML() b1.click(fn=fun1, outputs=[twitter_pane1, twitter_pane2 , twitter_pane3]) demo.launch(debug=True, show_error=True)It's never too early to start on @Gradio and @huggingface Spaces😃- Helped my 12 yo nephew to build an ML App for his inter-school science project. This project helps in social wellbeing by giving people a choice to filter negative and positive News. https://t.co/0L1WAMQpWV
— Yuvi (@yvrjsharma) November 11, 2022