Spaces:
Paused
Paused
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,7 +21,7 @@ import pytz
|
|
| 21 |
import csv
|
| 22 |
import cv2
|
| 23 |
import tempfile
|
| 24 |
-
|
| 25 |
from io import StringIO
|
| 26 |
from huggingface_hub import (
|
| 27 |
create_repo,
|
|
@@ -509,10 +509,16 @@ def post(judul, kontent, endpoint,endpoint_media,username,password,tags,categori
|
|
| 509 |
response_post = requests.post(endpoint, headers=headers, data=data)
|
| 510 |
return response_post.json()
|
| 511 |
|
| 512 |
-
|
| 513 |
-
|
| 514 |
-
|
| 515 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 516 |
|
| 517 |
with gr.Blocks(theme="soft", title="Wordpress Article Generator") as article_generator:
|
| 518 |
gr.HTML(
|
|
@@ -536,7 +542,7 @@ with gr.Blocks(theme="soft", title="Wordpress Article Generator") as article_gen
|
|
| 536 |
button_scrap = gr.Button("Scrap Article")
|
| 537 |
wysiwyg_editor_judul = gr.HTML("""
|
| 538 |
<textarea id="wysiwyg-editor" style="height: 300px; width: 100%;"></textarea>
|
| 539 |
-
<script src=
|
| 540 |
<script>
|
| 541 |
tinymce.init({
|
| 542 |
selector: '#wysiwyg-editor',
|
|
@@ -550,7 +556,7 @@ with gr.Blocks(theme="soft", title="Wordpress Article Generator") as article_gen
|
|
| 550 |
img = gr.Image()
|
| 551 |
wysiwyg_editor = gr.HTML("""
|
| 552 |
<textarea id="wysiwyg-editor" style="height: 300px; width: 100%;"></textarea>
|
| 553 |
-
<script src=
|
| 554 |
<script>
|
| 555 |
tinymce.init({
|
| 556 |
selector: '#wysiwyg-editor',
|
|
|
|
| 21 |
import csv
|
| 22 |
import cv2
|
| 23 |
import tempfile
|
| 24 |
+
import zipfile
|
| 25 |
from io import StringIO
|
| 26 |
from huggingface_hub import (
|
| 27 |
create_repo,
|
|
|
|
| 509 |
response_post = requests.post(endpoint, headers=headers, data=data)
|
| 510 |
return response_post.json()
|
| 511 |
|
| 512 |
+
|
| 513 |
+
zip_file_path = 'tinymce_6.7.3.zip'
|
| 514 |
+
extracted_folder = 'extracted_folder'
|
| 515 |
+
|
| 516 |
+
# Ekstraksi file zip
|
| 517 |
+
with zipfile.ZipFile(zip_file_path, 'r') as zip_ref:
|
| 518 |
+
zip_ref.extractall(extracted_folder)
|
| 519 |
+
|
| 520 |
+
# Path ke file cek.js setelah diekstrak
|
| 521 |
+
tinymce_js_path = os.path.join(extracted_folder, 'tinymce.min.js')
|
| 522 |
|
| 523 |
with gr.Blocks(theme="soft", title="Wordpress Article Generator") as article_generator:
|
| 524 |
gr.HTML(
|
|
|
|
| 542 |
button_scrap = gr.Button("Scrap Article")
|
| 543 |
wysiwyg_editor_judul = gr.HTML("""
|
| 544 |
<textarea id="wysiwyg-editor" style="height: 300px; width: 100%;"></textarea>
|
| 545 |
+
<script src="tinymce_js_path"></script>
|
| 546 |
<script>
|
| 547 |
tinymce.init({
|
| 548 |
selector: '#wysiwyg-editor',
|
|
|
|
| 556 |
img = gr.Image()
|
| 557 |
wysiwyg_editor = gr.HTML("""
|
| 558 |
<textarea id="wysiwyg-editor" style="height: 300px; width: 100%;"></textarea>
|
| 559 |
+
<script src="tinymce_js_path"</script>
|
| 560 |
<script>
|
| 561 |
tinymce.init({
|
| 562 |
selector: '#wysiwyg-editor',
|