Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -507,40 +507,7 @@ def post(judul, kontent, endpoint,endpoint_media,username,password,tags,categori
|
|
| 507 |
|
| 508 |
response_post = requests.post(endpoint, headers=headers, data=data)
|
| 509 |
return response_post.json()
|
| 510 |
-
|
| 511 |
-
# with gr.Blocks(theme = "soft", title="Wordpress Article Generator") as article_generator:
|
| 512 |
-
# gr.Markdown(
|
| 513 |
-
# """
|
| 514 |
-
# # Wordpress Article Generator
|
| 515 |
-
# Buat artikel yang anda inginkan dengan mudah, cukup dengan menuliskan link artikel sebagai referensi dan dalam sekejap artikel yang anda inginkan dapat menghiasi halaman wordpress anda.
|
| 516 |
-
# """)
|
| 517 |
-
# with gr.Row():
|
| 518 |
-
# with gr.Column():
|
| 519 |
-
# link = gr.Textbox(placeholder="Masukkan Link Artikel Yang Akan di Scrap", label="Link")
|
| 520 |
-
# backlink = gr.Textbox(placeholder="Masukkan Backlink Yang Akan Diterapkan", label="Backlink")
|
| 521 |
-
# keyword = gr.Textbox(placeholder="Masukkan Keyword Artikel", label="Keyword")
|
| 522 |
-
# versi = gr.Radio(["openai", "azure"], label="Skema Request", info="Pilih Skema Untuk Request ke ChatGPT ")
|
| 523 |
-
# api_key = gr.Textbox(placeholder="Masukkan Api Key", label="API Key")
|
| 524 |
-
# link_azure = gr.Textbox(placeholder="Khusus Untuk Skema Request Menggunakan Azure", label="Azure Endpoint (Opsional)")
|
| 525 |
-
# replicate_token = gr.Textbox(placeholder="Masukkan Token Replicate", label="Replicate Key")
|
| 526 |
-
# button_scrap = gr.Button("Scrap Article")
|
| 527 |
-
# img = gr.Image()
|
| 528 |
-
# outputs = gr.Textbox("", label="Judul")
|
| 529 |
-
# content = gr.Textbox("", label="Content")
|
| 530 |
-
# button_scrap.click(fn=scrap, inputs=[link,backlink,keyword,versi,api_key,link_azure,replicate_token], outputs=[img,outputs,content])
|
| 531 |
-
# with gr.Column():
|
| 532 |
-
# endpoint= gr.Textbox(placeholder="Masukkan Endpoint Wordpress", label="Endpoint Wordpress")
|
| 533 |
-
# endpoint_media= gr.Textbox(placeholder="Masukkan Endpoint Media Wordpress", label="Endpoint Media")
|
| 534 |
-
# username= gr.Textbox(placeholder="Masukkan Username Wordpress", label="Username")
|
| 535 |
-
# password= gr.Textbox(placeholder="Masukkan Password Wordpress", label="Password")
|
| 536 |
-
# tags= gr.Textbox(placeholder="Masukkan ID Tags Yang Akan Diterapkan", label="Tags")
|
| 537 |
-
# categories= gr.Textbox(placeholder="Masukkan ID Kategori Artikel", label="Kategori")
|
| 538 |
-
# metode= gr.Radio(["publish", "draft"], label="Status Post", info="Pilih Metode Publish atau Draft Untuk Memposting")
|
| 539 |
-
# button_post = gr.Button("Post Article")
|
| 540 |
-
# status = gr.Textbox("", label="Response")
|
| 541 |
-
# button_post.click(fn=post, inputs=[outputs, content, endpoint,endpoint_media,username,password,tags,categories,metode], outputs=status)
|
| 542 |
-
# if __name__ == "__main__":
|
| 543 |
-
# article_generator.launch(share=False)
|
| 544 |
|
| 545 |
with gr.Blocks(theme="soft", title="Wordpress Article Generator") as article_generator:
|
| 546 |
gr.HTML(
|
|
@@ -562,10 +529,8 @@ with gr.Blocks(theme="soft", title="Wordpress Article Generator") as article_gen
|
|
| 562 |
link_azure = gr.Textbox(placeholder="Masukkan Endpoint Azure", label="Azure Endpoint", info = "Abaikan Kolom Ini Jika Anda Menggunakan Skema Openai")
|
| 563 |
replicate_token = gr.Textbox(placeholder="Masukkan Token Replicate", label="Replicate Key")
|
| 564 |
button_scrap = gr.Button("Scrap Article")
|
| 565 |
-
img = gr.Image()
|
| 566 |
-
# outputs = gr.Textbox("", label="Judul")
|
| 567 |
-
# Ganti gr.Textbox dengan elemen HTML textarea untuk WYSIWYG
|
| 568 |
wysiwyg_editor_judul = gr.HTML("")
|
|
|
|
| 569 |
wysiwyg_editor = gr.HTML("")
|
| 570 |
button_scrap.click(fn=scrap, inputs=[link, backlink, keyword, versi, api_key, link_azure, replicate_token], outputs=[wysiwyg_editor_judul,img,wysiwyg_editor])
|
| 571 |
with gr.Column():
|
|
|
|
| 507 |
|
| 508 |
response_post = requests.post(endpoint, headers=headers, data=data)
|
| 509 |
return response_post.json()
|
| 510 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 511 |
|
| 512 |
with gr.Blocks(theme="soft", title="Wordpress Article Generator") as article_generator:
|
| 513 |
gr.HTML(
|
|
|
|
| 529 |
link_azure = gr.Textbox(placeholder="Masukkan Endpoint Azure", label="Azure Endpoint", info = "Abaikan Kolom Ini Jika Anda Menggunakan Skema Openai")
|
| 530 |
replicate_token = gr.Textbox(placeholder="Masukkan Token Replicate", label="Replicate Key")
|
| 531 |
button_scrap = gr.Button("Scrap Article")
|
|
|
|
|
|
|
|
|
|
| 532 |
wysiwyg_editor_judul = gr.HTML("")
|
| 533 |
+
img = gr.Image()
|
| 534 |
wysiwyg_editor = gr.HTML("")
|
| 535 |
button_scrap.click(fn=scrap, inputs=[link, backlink, keyword, versi, api_key, link_azure, replicate_token], outputs=[wysiwyg_editor_judul,img,wysiwyg_editor])
|
| 536 |
with gr.Column():
|