Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -508,7 +508,9 @@ def post(judul, kontent, endpoint,endpoint_media,username,password,tags,categori
|
|
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(
|
514 |
"""<img src="https://botika.online/assets/uploads/2019/04/logo-primary-1.png" alt="Logo" style="width:126px;height:38px;"> """
|
@@ -529,35 +531,9 @@ with gr.Blocks(theme="soft", title="Wordpress Article Generator") as article_gen
|
|
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 |
-
<label for="wysiwyg-editor">Article</label>
|
534 |
-
<textarea id="wysiwyg-editor" style="height: 100px; width: 50%;"></textarea>
|
535 |
-
<script src="https://cdn.tiny.cloud/1/no-api-key/tinymce/5/tinymce.min.js"></script>
|
536 |
-
<script>
|
537 |
-
tinymce.init({
|
538 |
-
selector: '#wysiwyg-editor',
|
539 |
-
plugins: 'lists advlist autolink link image charmap print preview hr anchor pagebreak',
|
540 |
-
toolbar: 'undo redo | bold italic underline | fontselect fontsizeselect | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
|
541 |
-
menubar: false,
|
542 |
-
content_style: 'body { background-color: #143; color: #fff; }'
|
543 |
-
});
|
544 |
-
</script>
|
545 |
-
""")
|
546 |
img = gr.Image()
|
547 |
-
wysiwyg_editor = gr.HTML(
|
548 |
-
<label for="wysiwyg-editor">Article</label>
|
549 |
-
<textarea id="wysiwyg-editor" style="height: 300px; width: 50%;"></textarea>
|
550 |
-
<script src="https://cdn.tiny.cloud/1/no-api-key/tinymce/5/tinymce.min.js"></script>
|
551 |
-
<script>
|
552 |
-
tinymce.init({
|
553 |
-
selector: '#wysiwyg-editor',
|
554 |
-
plugins: 'lists advlist autolink link image charmap print preview hr anchor pagebreak',
|
555 |
-
toolbar: 'undo redo | bold italic underline | fontselect fontsizeselect | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | link image',
|
556 |
-
menubar: false,
|
557 |
-
content_style: 'body { background-color: #143; color: #fff; }'
|
558 |
-
});
|
559 |
-
</script>
|
560 |
-
""")
|
561 |
button_scrap.click(fn=scrap, inputs=[link, backlink, keyword, versi, api_key, link_azure, replicate_token], outputs=[wysiwyg_editor_judul,img,wysiwyg_editor])
|
562 |
with gr.Column():
|
563 |
endpoint= gr.Textbox(placeholder="Masukkan Endpoint Wordpress", label="Endpoint Wordpress")
|
|
|
508 |
response_post = requests.post(endpoint, headers=headers, data=data)
|
509 |
return response_post.json()
|
510 |
|
511 |
+
with open("index.html", "r") as file:
|
512 |
+
html_wysiwyg = file.read()
|
513 |
+
|
514 |
with gr.Blocks(theme="soft", title="Wordpress Article Generator") as article_generator:
|
515 |
gr.HTML(
|
516 |
"""<img src="https://botika.online/assets/uploads/2019/04/logo-primary-1.png" alt="Logo" style="width:126px;height:38px;"> """
|
|
|
531 |
link_azure = gr.Textbox(placeholder="Masukkan Endpoint Azure", label="Azure Endpoint", info = "Abaikan Kolom Ini Jika Anda Menggunakan Skema Openai")
|
532 |
replicate_token = gr.Textbox(placeholder="Masukkan Token Replicate", label="Replicate Key")
|
533 |
button_scrap = gr.Button("Scrap Article")
|
534 |
+
wysiwyg_editor_judul = gr.HTML(html_wysiwyg)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
535 |
img = gr.Image()
|
536 |
+
wysiwyg_editor = gr.HTML(html_wysiwyg)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
537 |
button_scrap.click(fn=scrap, inputs=[link, backlink, keyword, versi, api_key, link_azure, replicate_token], outputs=[wysiwyg_editor_judul,img,wysiwyg_editor])
|
538 |
with gr.Column():
|
539 |
endpoint= gr.Textbox(placeholder="Masukkan Endpoint Wordpress", label="Endpoint Wordpress")
|