Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -428,7 +428,7 @@ def scrap(link_scrap,backlink,keyword):
|
|
| 428 |
# tags, content, url, img, image_data = artikel_processing(contents, url, title)
|
| 429 |
# return result
|
| 430 |
|
| 431 |
-
def post(data,endpoint,endpoint_media,username,password,tags,categories):
|
| 432 |
# endpoint_media = 'http://localhost/wordpress/index.php/wp-json/wp/v2/media'
|
| 433 |
# endpoint = 'http://localhost/wordpress/index.php/wp-json/wp/v2/posts'
|
| 434 |
# endpoint_media = 'https://blog.botika.online/wp-json/wp/v2/media/'
|
|
@@ -460,7 +460,7 @@ def post(data,endpoint,endpoint_media,username,password,tags,categories):
|
|
| 460 |
"title": data_scrap[0]['Judul Artikel'],
|
| 461 |
"content":data_scrap[0]['Konten Artikel'],
|
| 462 |
"featured_media" : media,
|
| 463 |
-
"status":
|
| 464 |
"categories": categories,
|
| 465 |
"tags":tags
|
| 466 |
}
|
|
@@ -492,8 +492,9 @@ with gr.Blocks(theme = "soft", title="Article Writer") as article_generator:
|
|
| 492 |
password= gr.Textbox(placeholder="Masukkan Password Wordpress", label="Password")
|
| 493 |
tags= gr.Textbox(placeholder="Masukkan ID Tags Yang Akan Diterapkan", label="Tags")
|
| 494 |
categories= gr.Textbox(placeholder="Masukkan ID Kategori Artikel", label="Kategori")
|
|
|
|
| 495 |
button_post = gr.Button("Post Article")
|
| 496 |
-
status = gr.Textbox("", label="
|
| 497 |
-
button_post.click(fn=post, inputs=[outputs,endpoint,endpoint_media,username,password,tags,categories], outputs=status)
|
| 498 |
if __name__ == "__main__":
|
| 499 |
article_generator.launch(share=False)
|
|
|
|
| 428 |
# tags, content, url, img, image_data = artikel_processing(contents, url, title)
|
| 429 |
# return result
|
| 430 |
|
| 431 |
+
def post(data,endpoint,endpoint_media,username,password,tags,categories,metode):
|
| 432 |
# endpoint_media = 'http://localhost/wordpress/index.php/wp-json/wp/v2/media'
|
| 433 |
# endpoint = 'http://localhost/wordpress/index.php/wp-json/wp/v2/posts'
|
| 434 |
# endpoint_media = 'https://blog.botika.online/wp-json/wp/v2/media/'
|
|
|
|
| 460 |
"title": data_scrap[0]['Judul Artikel'],
|
| 461 |
"content":data_scrap[0]['Konten Artikel'],
|
| 462 |
"featured_media" : media,
|
| 463 |
+
"status": metode,
|
| 464 |
"categories": categories,
|
| 465 |
"tags":tags
|
| 466 |
}
|
|
|
|
| 492 |
password= gr.Textbox(placeholder="Masukkan Password Wordpress", label="Password")
|
| 493 |
tags= gr.Textbox(placeholder="Masukkan ID Tags Yang Akan Diterapkan", label="Tags")
|
| 494 |
categories= gr.Textbox(placeholder="Masukkan ID Kategori Artikel", label="Kategori")
|
| 495 |
+
metode= gr.Radio(["publish", "draft"], label="Status Post", info="Pilih Metode Publish atau Draft Untuk Memposting")
|
| 496 |
button_post = gr.Button("Post Article")
|
| 497 |
+
status = gr.Textbox("", label="Response")
|
| 498 |
+
button_post.click(fn=post, inputs=[outputs,endpoint,endpoint_media,username,password,tags,categories,metode], outputs=status)
|
| 499 |
if __name__ == "__main__":
|
| 500 |
article_generator.launch(share=False)
|