import json, re, subprocess
slug = "10-channel-digital-marketing-rumah-sakit-yang-wajib-dikelola-di-era-online"
url = ("https://studiosoft.id/wp-json/wp/v2/posts?slug=%s&_fields=content" % slug)
r = subprocess.run(["curl", "-4", "-s", "--http1.1", "--max-time", "150",
                    "-A", "Mozilla/5.0 (Windows NT 10.0; Win64; x64)", url],
                   capture_output=True, text=True)
h = json.loads(r.stdout)[0]["content"]["rendered"]
h = re.sub(r"<[^>]+>", "\n", h).replace("&nbsp;", " ").replace("&#8217;", "'").replace("&#8220;", '"').replace("&#8221;", '"').replace("&amp;", "&")
h = re.sub(r"\n{2,}", "\n", h).strip()
print(h[-4000:])
