{"id":1671,"date":"2023-01-16T03:08:04","date_gmt":"2023-01-15T18:08:04","guid":{"rendered":"https:\/\/ubun2m.com\/?p=1671"},"modified":"2023-01-16T03:17:52","modified_gmt":"2023-01-15T18:17:52","slug":"web%e3%82%b5%e3%82%a4%e3%83%88%e3%81%ae%e6%83%85%e5%a0%b1%e3%82%92%e5%8f%8e%e9%9b%86%e3%81%97%e3%80%81openai%e3%81%a7%e8%a6%81%e7%b4%84%e3%81%97%e3%81%a6wp%e3%81%ab%e8%87%aa%e5%8b%95%e6%8a%95%e7%a8%bf","status":"publish","type":"post","link":"https:\/\/ubun2m.com\/?p=1671","title":{"rendered":"WEB\u30b5\u30a4\u30c8\u306e\u60c5\u5831\u3092\u53ce\u96c6\u3057\u3001OpenAI\u3067\u8981\u7d04\u3057\u3066WP\u306b\u81ea\u52d5\u6295\u7a3f\u3059\u308b\u30d7\u30ed\u30b0\u30e9\u30e0\u3010Python\u3011"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\">\u306f\u3058\u3081\u306b\u3000<\/h2>\n\n\n\n<p>\u3000\u6700\u8fd1ChatGPT\u304c\u8a71\u984c\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u3044\u304f\u3064\u304b\u306e\u30c6\u30b9\u30c8\u30d7\u30ed\u30b0\u30e9\u30e0\u3092ChatGPT\u3092\u5229\u7528\u3057\u3066\u4f5c\u6210\u3057\u3066\u304d\u305f\u304c\u3001\u4eca\u56de\u306f\u30bf\u30a4\u30c8\u30eb\u306b\u3042\u308b\u3088\u3046\u306b\u5c11\u3057\u8907\u96d1\u306a\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u306b\u53d6\u308a\u7d44\u3093\u3060\u3002\u30a6\u30a7\u30d6\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3059\u308b\u5834\u5408\u306b\u7279\u306b\u91cd\u8981\u3068\u306a\u308b\u6b63\u898f\u8868\u73fe\u3092\u4f7f\u3063\u3066\u5fc5\u8981\u306a\u90e8\u5206\u3092\u5207\u308a\u629c\u304f\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u66f8\u304f\u306e\u306f\u666e\u901a\u306f\u624b\u9593\u304c\u304b\u304b\u308b\u306e\u3060\u304c\u3001ChatGPT\u3092\u4f7f\u3046\u3053\u3068\u3067\u30b9\u30e0\u30fc\u30ba\u306b\u4f5c\u6210\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u305f\u3002<br>\u3000\u4eca\u56de\u4f5c\u6210\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u306f\u3001WEB\u30b5\u30a4\u30c8\u304b\u3089\u8a18\u4e8b\u3092\u53ce\u96c6\u3057\u3001OpenAI\u306eAPI\u3092\u4f7f\u3063\u3066\u8981\u7d04\u6587\u7ae0\u3092\u4f5c\u6210\u3057\u3001WordPress\u306b\u81ea\u52d5\u6295\u7a3f\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<br><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">WEB\u30b5\u30a4\u30c8\u304b\u3089\u306e\u8a18\u4e8b\u306e\u53ce\u96c6\u65b9\u6cd5\u306b\u3064\u3044\u3066<\/h2>\n\n\n\n<p>\u3000\u307e\u305a\u8a18\u4e8b\u306e\u4e00\u89a7\u3092\u53d6\u5f97\u3057\u3001\u305d\u308c\u304b\u3089\u500b\u5225\u306e\u8a18\u4e8b\u306e\u5185\u5bb9\u3092\u53d6\u5f97\u3057\u3066\u3044\u308b\u3002RSS\u306b\u3088\u3063\u3066\u8a18\u4e8b\u4e00\u89a7\u3092\u53d6\u5f97\u3059\u308b\u5834\u5408\u306f\u554f\u984c\u306a\u3044\u304c\u3001\u305d\u308c\u4ee5\u5916\u306e\u5834\u5408\u306b\u306f\u3001Web\u30b5\u30a4\u30c8\u3054\u3068\u306b\u7570\u306a\u308b\u65b9\u6cd5\u3067\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\u305d\u306e\u305f\u3081\u3001\u500b\u5225\u306b\u5206\u5c90\u3057\u3066\u51e6\u7406\u3092\u884c\u3063\u3066\u3044\u308b\u3002\u8a18\u4e8b\u306e\u5185\u5bb9\u306f\u3001HTML\u306e\u4e2d\u306e\u7279\u5b9a\u306eClass\u304bID\u306e\u540d\u524d\u306e\u90e8\u5206\u3092\u53d6\u5f97\u3059\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code># main\u95a2\u6570\u306e\u4e00\u90e8\u629c\u7c8b\n    for city_name, rss_url, element_id, is_rss in website_urls:\n        if is_rss:\n            feed = feedparser.parse(rss_url)\n            for entry in feed.entries:\n                date = entry.published if &#39;published&#39; in entry else entry.updated if &#39;updated&#39; in entry else entry.created\n                if isinstance(date, str):\n                    #date = datetime.strptime(date, date_format)\n                    date = parser.parse(date, tzinfos={&#39;JST&#39;: gettz(&#39;Asia\/Tokyo&#39;)})\n                    entry_title = entry.title\n                    url = entry.link\n                    data = extract_article(url, element_id, city_name, entry_title, date)\n                    if not data is None:\n                        json_data.append(data)\n        else:\n            data = extract_data_from_website(rss_url, element_id,city_name)\n            if data is None:\n                continue\n            json_data.append(data)<\/code><\/pre><\/div>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code># RSS\u975e\u5bfe\u5fdc\u306eWeb\u30b5\u30a4\u30c8\u306e\u30d1\u30fc\u30b9\ndef extract_data_from_website(rss_url, element_id, city_name):\n    &quot;&quot;&quot;\n    RSS\u975e\u5bfe\u5fdc\u306eWeb\u30b5\u30a4\u30c8\u306e\u30d1\u30fc\u30b9\u95a2\u6570\n    :param rss_url: \u53d6\u5f97\u3057\u305f\u3044\u8a18\u4e8b\u306eURL\n    :param element_id: \u53d6\u5f97\u3057\u305f\u3044\u8981\u7d20\u306eid\n    :param city_name: \u8a18\u4e8b\u304c\u5c5e\u3059\u308b\u5730\u57df\n    :return: \u53d6\u5f97\u3057\u305f\u8a18\u4e8b\u60c5\u5831\u306e\u8f9e\u66f8\n    &quot;&quot;&quot;\n    response = requests.get(rss_url)\n    detected_encoding = chardet.detect(response.content)[&#39;encoding&#39;]\n    response.encoding = detected_encoding\n    soup = BeautifulSoup(response.text, &#39;html.parser&#39;)\n    data ={}\n\n    if city_name == &quot;XX\u5730\u57df&quot;:\n        # \u500b\u5225\u306e\u51e6\u7406\n        data = extract_article(url, element_id, city_name, entry_title, date)\n        return data<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">OpenAI\u3092\u4f7f\u3063\u3066\u8981\u7d04\u6587\u7ae0\u3092\u4f5c\u6210\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066<\/h2>\n\n\n\n<p>\u3000OpenAI\u306eAPI\u3092\u4f7f\u7528\u3059\u308b\u306b\u306f\u3001python\u30e9\u30a4\u30d6\u30e9\u30ea\u306e\"openai\"\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u3002<br>\u3000API\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u306f\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u8a2d\u5b9a\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u304c\u3001\u30c8\u30fc\u30af\u30f3\u6570\u306e\u5236\u9650\u306b\u5f15\u3063\u304b\u304b\u3089\u306a\u3044\u3088\u3046\u306b\u8abf\u6574\u3059\u308b\u305f\u3081\u306b\u3001MeCab\u306e\u5f62\u614b\u7d20\u89e3\u6790\u3092\u4f7f\u7528\u3057\u3066\u6587\u7ae0\u3092\u5f62\u614b\u7d20\u306b\u5206\u89e3\u3057\u3001\u8a08\u7b97\u3057\u3066\u3044\u308b\u3002\u5236\u9650\u3092\u8d85\u3048\u308b\u6587\u7ae0\u306e\u90e8\u5206\u306f\u3001\u6587\u672b\u304b\u3089\u524a\u9664\u3057\u3066\u3044\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code># OpenAPI\u3092\u4f7f\u3063\u3066\u8981\u7d04\u3092\u4f5c\u6210\u3059\u308b\u95a2\u6570\ndef create_summary(prompt):\n    &quot;&quot;&quot;\n    \u6587\u7ae0\u306e\u8981\u7d04\u3092\u53d6\u5f97\u3059\u308b\u95a2\u6570\n    :param prompt: \u8981\u7d04\u3057\u305f\u3044\u6587\u7ae0\n    :return: \u8981\u7d04\u6587\u7ae0\n    &quot;&quot;&quot;\n    # \u6587\u7ae0\u306e\u9577\u3055\u3092\u53d6\u5f97\n    debug_print(prompt)\n    if prompt is None:return\n    threshold = 50\n    prompt_tokens = [token.split(&quot;\\t&quot;)[0] for token in m.parse(prompt).split(&quot;\\n&quot;)]\n    prompt_length = int(len(prompt_tokens) * 1.035)\n    debug_print(prompt_length)\n    if prompt_length &lt;= threshold: return\n    if(max_tokens - prompt_length &lt; 0):\n        new_prompt_tokens = prompt_tokens[:-(prompt_length - max_tokens)]\n        prompt = &quot;&quot;.join(new_prompt_tokens)\n\n    # OpenAI\u306eAPI\u3092\u5b9f\u884c\n    completions = openai.Completion.create(\n        engine=model_engine,\n        prompt=prompt,\n        temperature=0.7,\n        max_tokens=max_tokens,\n        stop=None,\n        top_p=1,\n        frequency_penalty=0,\n        presence_penalty=0\n    )\n\n    # API\u306e\u7d50\u679c\u3092\u8fd4\u3059\n    message = completions.choices[0].text\n    if not completions.choices[0].text:return\n\n    # \u6d88\u8cbb\u3057\u305f\u30c8\u30fc\u30af\u30f3\u6570\u3092\u53d6\u5f97\n    debug_print(&quot;tokens_consumed:&quot; + str(completions.usage.get(&quot;total_tokens&quot;)))\n\n    return message<\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">WP\u306b\u81ea\u52d5\u6295\u7a3f\u3059\u308b\u65b9\u6cd5\u306b\u3064\u3044\u3066<\/h2>\n\n\n\n<p>\u3000python\u30e9\u30a4\u30d6\u30e9\u30ea\u306ewordpress_xmlrpc\u3092\u30a4\u30f3\u30dd\u30fc\u30c8\u3059\u308b\u3002\u3053\u308c\u306b\u3088\u308a\u3001WordPress\u306b\u6295\u7a3f\u3059\u308b\u305f\u3081\u306e\u6a5f\u80fd\u3092\u4f7f\u7528\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002<br>\u3000xmlrpc\u3068\u306f\u3001WordPress\u304c\u63d0\u4f9b\u3059\u308b\u3001\u5916\u90e8\u304b\u3089\u306e\u6295\u7a3f\u3084\u7de8\u96c6\u3092\u884c\u3046\u305f\u3081\u306eAPI\u3067\u3042\u308b\u3002<br>\u3000\u8a18\u4e8b\u306e\u30bf\u30a4\u30c8\u30eb\u3084\u8981\u7d04\u306fjson_data\u306b\u683c\u7d0d\u3057\u3066\u3044\u308b\u306e\u3067\u3001HTML\u7528\u306b\u6574\u5f62\u3059\u308b\u3002<br>\u3000\u4eca\u56de\u306f\u3001\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u30c9\u30e9\u30d5\u30c8\u72b6\u614b\u306b\u3057\u3066\u3044\u308b\u304c\u3001\u76f4\u63a5\u6295\u7a3f\u3059\u308b\u3053\u3068\u3082\u53ef\u80fd\u3067\u3042\u308b\u3002<br><\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-lang=\"Python\"><code># \u4f5c\u6210\u3057\u305f\u8a18\u4e8b\u306e\u30c7\u30fc\u30bf\u3092WordPress\u306b\u6295\u7a3f\u3059\u308b\u95a2\u6570\ndef create_wp_post(json_data, wp_url, wp_id, wp_password):\n    &quot;&quot;&quot;\n    \u4f5c\u6210\u3057\u305f\u8a18\u4e8b\u306e\u30c7\u30fc\u30bf\u3092WordPress\u306b\u6295\u7a3f\u3059\u308b\u95a2\u6570\n    \n    Parameters:\n    - json_data (list) : \u8a18\u4e8b\u30c7\u30fc\u30bf\u306ejson\n    - wp_url (str) : WordPress\u306eURL\n    - wp_id (str) : WordPress\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u306eID\n    - wp_password (str) : WordPress\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\n    &quot;&quot;&quot;\n\n    #\u30c7\u30fc\u30bf\u304cNone\u3060\u3063\u305f\u5834\u5408\u306f\u51e6\u7406\u3092\u3084\u3081\u308b\n    if json_data is None:\n        debug_print(&quot;json_data is None. Exiting...&quot;)\n        return\n    else:\n        #wp\u7528\u30b3\u30f3\u30c6\u30f3\u30c4\u6574\u5f62\u51e6\u7406\n        content =&quot;&quot;\n        previous_city_name = &quot;&quot;\n        post_tags = set()\n\n        table_of_contents = &quot;&lt;h2&gt;\u76ee\u6b21&lt;\/h2&gt;&quot;\n        title_count = 0\n\n        for data in json_data:\n            if data is None:\n                continue\n            city_name = data[&quot;city_name&quot;]\n            title = data.get(&quot;entry_title&quot;)\n            summary = data.get(&quot;text_abs&quot;)\n            url = data[&quot;url&quot;]\n            if title is None or summary is None:\n                continue\n            title_count += 1\n\n            post_tags.add(city_name)\n            if city_name != previous_city_name:\n                if previous_city_name:\n                    table_of_contents += &quot;&lt;\/ul&gt;&quot;\n                content = content + &quot;&lt;h3 id=&#39;&quot; + city_name + &quot;&#39;&gt;&quot; + city_name + &quot;&lt;\/h3&gt;&quot;\n                table_of_contents += &quot;&lt;p&gt;&lt;a href=&#39;#&quot; + city_name + &quot;&#39;&gt;&quot; + city_name + &quot;&lt;\/a&gt;&quot;\n                table_of_contents += &quot;&lt;ul&gt;&quot;\n\n                previous_city_name = city_name\n\n            # \u8a18\u4e8b\u90e8\u5206\n            content = content + &quot;&lt;h4&gt;&lt;a href=&#39;&quot; + url + &quot;&#39;&gt;&quot; + title + &quot;&lt;\/a&gt;&lt;\/h4&gt;&quot;\n            content = content + &quot;&lt;p&gt;&lt;pre&gt;\u3000&lt;\/pre&gt;&quot; + summary + &quot;&lt;\/p&gt;&quot;\n\n            # \u76ee\u6b21\u90e8\u5206\n            table_of_contents += &quot;&lt;li&gt;&quot; + title + &quot;&lt;\/li&gt;&quot;\n\n        title_count_text = str(title_count) + &quot;\u4ef6&quot; if title_count &gt; 1 else &quot;1\u4ef6&quot;\n        title_summary = &quot; ( &quot; + title_count_text + &quot; ) &quot;\n\n        table_of_contents = &quot;&lt;div class=&#39;wp-block-quote&#39;&gt;&quot; + table_of_contents + &quot;&lt;\/div&gt;&quot;\n        content = table_of_contents + content\n\n        if title_count ==0:return\n        debug_print(content)\n\n        now = datetime.now()\n        #which=&quot;publish&quot;\n        which=&quot;draft&quot;\n\n        #\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u547c\u3073\u51fa\u3057\n        wp_client = Client(wp_url, wp_id,wp_password)\n\n        #\u6295\u7a3f\u51e6\u7406\n        wp_post = WordPressPost()\n        wp_post.post_status = which\n        wp_post.title = &quot;{}\u5e74{}\u6708{}\u65e5({})\u306eXX\u5730\u57df\u30cb\u30e5\u30fc\u30b9{}&quot;.format(now.year, now.month, now.day, now.strftime(&quot;%A&quot;), title_summary )\n        wp_post.content = content\n        wp_post.terms_names = {\n        &quot;post_tag&quot;: list(post_tags),\n        &quot;category&quot;: [&#39;XXXXXX&#39;],\n        }\n        wp_client.call(NewPost(wp_post)) \n        return <\/code><\/pre><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u3068\u30c7\u30e2\u52d5\u753b<\/h2>\n\n\n\n<p>\u3000\u4f5c\u6210\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u5168\u4f53\u306e\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306f\u4ee5\u4e0b\u306e\u3068\u304a\u308a\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-python\" data-file=\"scrape_news.py\" data-lang=\"Python\"><code># coding: utf-8\ndebug_mode = True\n \nimport feedparser # RSS\u30d5\u30a3\u30fc\u30c9\u306e\u30d1\u30fc\u30b5\u30fc\nimport json # JSON\u30d5\u30a9\u30fc\u30de\u30c3\u30c8\u306e\u30c7\u30fc\u30bf\u64cd\u4f5c\nimport pytz # \u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\nimport requests # HTTP\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u4fe1\u3059\u308b\u305f\u3081\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\nimport openai # OpenAI\u306eAPI\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\nimport deepl # Deepl\u7ffb\u8a33API\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\nimport MeCab # \u5f62\u614b\u7d20\u89e3\u6790\u3092\u884c\u3046\u305f\u3081\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\nimport re # \u6b63\u898f\u8868\u73fe\u3092\u4f7f\u7528\u3059\u308b\u305f\u3081\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\nimport ssl # SSL\u63a5\u7d9a\u306b\u95a2\u3059\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\nimport locale # \u5730\u57df\u3084\u8a00\u8a9e\u306b\u3088\u3063\u3066\u7570\u306a\u308b\u8868\u8a18\u306a\u3069\u306e\u30eb\u30fc\u30eb\u3092\u6271\u3046\u305f\u3081\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\nimport time # \u6642\u9593\u306b\u95a2\u3059\u308b\u30e9\u30a4\u30d6\u30e9\u30ea\nimport chardet # \u6587\u5b57\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u3092\u691c\u51fa\u3059\u308b\u305f\u3081\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\n\nfrom bs4 import BeautifulSoup # HTML\u3084XML\u306e\u30d1\u30fc\u30b5\u30fc\nfrom dateutil import parser # \u65e5\u6642\u306e\u30d1\u30fc\u30b5\u30fc\nfrom dateutil.tz import gettz # \u8981\u6c42\u3055\u308c\u305f\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u306etzinfo\u30aa\u30d6\u30b8\u30a7\u30af\u30c8\u3092\u8fd4\u3059\u30e9\u30a4\u30d6\u30e9\u30ea\nfrom datetime import datetime, timedelta # \u65e5\u6642\u306b\u95a2\u3059\u308b\u30af\u30e9\u30b9\nfrom wordpress_xmlrpc import Client, WordPressPost # WordPress\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u305f\u3081\u306e\u30e9\u30a4\u30d6\u30e9\u30ea\nfrom wordpress_xmlrpc.methods.users import GetUserInfo # WordPress\u306e\u30e6\u30fc\u30b6\u30fc\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306e\u30e1\u30bd\u30c3\u30c9\nfrom wordpress_xmlrpc.methods.posts import GetPosts, NewPost # WordPress\u306e\u6295\u7a3f\u60c5\u5831\u3092\u53d6\u5f97\u3059\u308b\u305f\u3081\u306e\u30e1\u30bd\u30c3\u30c9\n\n# \u65e5\u672c\u8a9e\u306e\u30ed\u30b1\u30fc\u30eb\u3092\u8a2d\u5b9a\nlocale.setlocale(locale.LC_TIME, &#39;ja_JP.UTF-8&#39;)\n\n# SSL\u30a8\u30e9\u30fc\u3092\u56de\u907f\u3059\u308b\u305f\u3081\u306e\u8a2d\u5b9a\nssl._create_default_https_context = ssl._create_unverified_context\n\n# Tokyo\u306b\u5bfe\u5fdc\u3059\u308b\u30bf\u30a4\u30e0\u30be\u30fc\u30f3\u3092\u751f\u6210\njst = pytz.timezone(&#39;Asia\/Tokyo&#39;)\n\n# MeCab\u306eTagger\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u751f\u6210\nm = MeCab.Tagger()\n\n# OpenAPI\u8a2d\u5b9a\n# API\u30ad\u30fc\u3092\u53d6\u5f97\nopenai.api_key = &quot;XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX&quot;\n#\u30e2\u30c7\u30eb\u3092\u6307\u5b9a\nmodel_engine = &quot;text-davinci-003&quot;\n#\u6700\u5927\u30c8\u30fc\u30af\u30f3\u6570\u3092\u6307\u5b9a\nmax_tokens = 1024\n\n# WordPress XMLRPC\u3067\u306e\u6295\u7a3f\u8a2d\u5b9a\nwp_id=&quot;XXXXXXXXXXXX&quot;\nwp_password=&quot;XXXXXXXXXXXX&quot;\nwp_url=&quot;https:\/\/XXXXXXXX\/xmlrpc.php&quot;\n\n# \u60c5\u5831\u30bd\u30fc\u30b9\n# \u53d6\u5f97\u5bfe\u8c61\u306e\u65e5\u6570\ndays = 3\n\n# \u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u306eURL\u30ea\u30b9\u30c8\n&quot;&quot;&quot;\nwebsite_urls:\n\u914d\u5217(\u30ea\u30b9\u30c8)\u5909\u6570\u3067\u3001Web\u30b5\u30a4\u30c8\u306eURL\u3092\u683c\u7d0d\u3057\u3066\u3044\u308b\u3002\n\u5404\u8981\u7d20\u306f\u30bf\u30d7\u30eb\u3068\u3057\u3066\u3001 (&#39;\u5730\u57df\u540d&#39;, &#39;Web\u30b5\u30a4\u30c8\u306eURL&#39;, &#39;\u8a18\u4e8b\u306e\u8981\u7d20\u306eID&#39;, &#39;RSS\u304b\u3069\u3046\u304b\u306e\u30d5\u30e9\u30b0&#39;) \u306e4\u3064\u306e\u8981\u7d20\u3092\u6301\u3064\u3002\n\u3053\u306e\u914d\u5217\u306f\u3001 for\u30eb\u30fc\u30d7\u306b\u3088\u3063\u3066\u53d6\u308a\u51fa\u3055\u308c\u3001RSS\u30d5\u30a3\u30fc\u30c9\u306e\u89e3\u6790\u3001\u8a18\u4e8b\u306e\u62bd\u51fa\u306e\u51e6\u7406\u306b\u5229\u7528\u3059\u308b\u3002\n&quot;&quot;&quot;\nwebsite_urls = [\n    (&#39;XX\u5730\u57df&#39;,&#39;https:\/\/xxxxxx\/xxx.xml&#39;,&#39;main_body&#39;, True),\n]\n\n# OpenAPI\u3092\u4f7f\u3063\u3066\u8981\u7d04\u3092\u4f5c\u6210\u3059\u308b\u95a2\u6570\ndef create_summary(prompt):\n    &quot;&quot;&quot;\n    \u6587\u7ae0\u306e\u8981\u7d04\u3092\u53d6\u5f97\u3059\u308b\u95a2\u6570\n    :param prompt: \u8981\u7d04\u3057\u305f\u3044\u6587\u7ae0\n    :return: \u8981\u7d04\u6587\u7ae0\n    &quot;&quot;&quot;\n    # \u6587\u7ae0\u306e\u9577\u3055\u3092\u53d6\u5f97\n    debug_print(prompt)\n    if prompt is None:return\n    threshold = 50\n    prompt_tokens = [token.split(&quot;\\t&quot;)[0] for token in m.parse(prompt).split(&quot;\\n&quot;)]\n    prompt_length = int(len(prompt_tokens) * 1.035)\n    debug_print(prompt_length)\n    if prompt_length &lt;= threshold: return\n    if(max_tokens - prompt_length &lt; 0):\n        new_prompt_tokens = prompt_tokens[:-(prompt_length - max_tokens)]\n        prompt = &quot;&quot;.join(new_prompt_tokens)\n\n    # OpenAI\u306eAPI\u3092\u5b9f\u884c\n    completions = openai.Completion.create(\n        engine=model_engine,\n        prompt=prompt,\n        temperature=0.7,\n        max_tokens=max_tokens,\n        stop=None,\n        top_p=1,\n        frequency_penalty=0,\n        presence_penalty=0\n    )\n\n    # API\u306e\u7d50\u679c\u3092\u8fd4\u3059\n    message = completions.choices[0].text\n    if not completions.choices[0].text:return\n\n    # \u6d88\u8cbb\u3057\u305f\u30c8\u30fc\u30af\u30f3\u6570\u3092\u53d6\u5f97\n    debug_print(&quot;tokens_consumed:&quot; + str(completions.usage.get(&quot;total_tokens&quot;)))\n\n    return message\n\n# \u7279\u5b9a\u306e\u8981\u7d20\u3092\u53d6\u5f97\u3059\u308b\u95a2\u6570\ndef get_text_from_city_hp(url, element_id):\n    &quot;&quot;&quot;\n    \u7279\u5b9a\u306e\u8981\u7d20\u306e\u30c6\u30ad\u30b9\u30c8\u3092\u53d6\u5f97\u3059\u308b\u95a2\u6570\n    :param url: \u53d6\u5f97\u3057\u305f\u3044\u8981\u7d20\u304c\u5b58\u5728\u3059\u308bURL\n    :param element_id: \u53d6\u5f97\u3057\u305f\u3044\u8981\u7d20\u306eid\n    :return: \u53d6\u5f97\u3057\u305f\u8981\u7d20\u306e\u30c6\u30ad\u30b9\u30c8\n    &quot;&quot;&quot;\n    # HTTP\u30ea\u30af\u30a8\u30b9\u30c8\u3092\u9001\u4fe1\u3057HTML\u30c7\u30fc\u30bf\u3092\u53d6\u5f97\n    response = requests.get(url)\n    detected_encoding = chardet.detect(response.content)[&#39;encoding&#39;]\n    response.encoding = detected_encoding\n    \n    # HTML\u30c7\u30fc\u30bf\u3092\u30d1\u30fc\u30b9\n    soup = BeautifulSoup(response.text, &#39;html.parser&#39;)\n    # id\u3092\u6301\u3064\u8981\u7d20\u3092\u53d6\u5f97\n    element = soup.find(id=element_id) or soup.find(class_=element_id)\n    if element:\n        return element\n    else:\n        return\n\n# \u500b\u5225\u306e\u8a18\u4e8b\u3092\u53d6\u5f97\u3059\u308b\u95a2\u6570\ndef extract_article(url, element_id, city_name, entry_title, date):\n    &quot;&quot;&quot;\n    \u500b\u5225\u306e\u8a18\u4e8b\u3092\u53d6\u5f97\u3059\u308b\u95a2\u6570\n    :param url: \u53d6\u5f97\u3057\u305f\u3044\u8a18\u4e8b\u306eURL\n    :param element_id: \u53d6\u5f97\u3057\u305f\u3044\u8981\u7d20\u306eid\n    :param city_name: \u8a18\u4e8b\u304c\u5c5e\u3059\u308b\u5730\u57df\n    :param entry_title: \u8a18\u4e8b\u306e\u898b\u51fa\u3057\n    :param date: \u8a18\u4e8b\u306e\u65e5\u6642\n    :return: \u53d6\u5f97\u3057\u305f\u8a18\u4e8b\u60c5\u5831\u306e\u8f9e\u66f8\n    &quot;&quot;&quot;\n    # \u6307\u5b9a\u65e5\u6570\u4ee5\u5185\u306e\u8a18\u4e8b\u306e\u307f\u53d6\u5f97\n    if not date.replace(tzinfo=pytz.timezone(&#39;Asia\/Tokyo&#39;)) &gt; datetime.now(jst) - timedelta(days=days):return\n    data = {}\n    # \u8a18\u4e8b\u306e\u30c6\u30ad\u30b9\u30c8\u3092\u53d6\u5f97\n    text = get_text_from_city_hp(url, element_id)\n    # \u8a18\u4e8b\u306e\u8981\u7d04\u3092\u53d6\u5f97\n    text_abs = create_summary(text)\n    debug_print(text_abs)\n\n    # \u53d6\u5f97\u3057\u305f\u8a18\u4e8b\u60c5\u5831\u3092\u683c\u7d0d\n    date_str = date.strftime(&#39;%Y-%m-%d %H:%M:%S&#39;)\n    data = {&#39;city_name&#39;: city_name, &#39;date&#39;: date_str, &#39;entry_title&#39;: entry_title, &#39;url&#39;: url, &#39;text&#39;:text, &#39;text_abs&#39;:text_abs}\n    return data\n\n\n# RSS\u975e\u5bfe\u5fdc\u306eWeb\u30b5\u30a4\u30c8\u306e\u30d1\u30fc\u30b9\ndef extract_data_from_website(rss_url, element_id, city_name):\n    &quot;&quot;&quot;\n    RSS\u975e\u5bfe\u5fdc\u306eWeb\u30b5\u30a4\u30c8\u306e\u30d1\u30fc\u30b9\u95a2\u6570\n    :param rss_url: \u53d6\u5f97\u3057\u305f\u3044\u8a18\u4e8b\u306eURL\n    :param element_id: \u53d6\u5f97\u3057\u305f\u3044\u8981\u7d20\u306eid\n    :param city_name: \u8a18\u4e8b\u304c\u5c5e\u3059\u308b\u5730\u57df\n    :return: \u53d6\u5f97\u3057\u305f\u8a18\u4e8b\u60c5\u5831\u306e\u8f9e\u66f8\n    &quot;&quot;&quot;\n    response = requests.get(rss_url)\n    detected_encoding = chardet.detect(response.content)[&#39;encoding&#39;]\n    response.encoding = detected_encoding\n    soup = BeautifulSoup(response.text, &#39;html.parser&#39;)\n    data ={}\n\n    if city_name == &quot;XX\u5730\u57df&quot;:\n        # \u500b\u5225\u306e\u51e6\u7406\n        data = extract_article(url, element_id, city_name, entry_title, date)\n        return data\n\n# \u4f5c\u6210\u3057\u305f\u8a18\u4e8b\u306e\u30c7\u30fc\u30bf\u3092WordPress\u306b\u6295\u7a3f\u3059\u308b\u95a2\u6570\ndef create_wp_post(json_data, wp_url, wp_id, wp_password):\n    &quot;&quot;&quot;\n    \u4f5c\u6210\u3057\u305f\u8a18\u4e8b\u306e\u30c7\u30fc\u30bf\u3092WordPress\u306b\u6295\u7a3f\u3059\u308b\u95a2\u6570\n    \n    Parameters:\n    - json_data (list) : \u8a18\u4e8b\u30c7\u30fc\u30bf\u306ejson\n    - wp_url (str) : WordPress\u306eURL\n    - wp_id (str) : WordPress\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u306eID\n    - wp_password (str) : WordPress\u306e\u30a2\u30ab\u30a6\u30f3\u30c8\u306e\u30d1\u30b9\u30ef\u30fc\u30c9\n    &quot;&quot;&quot;\n\n    #\u30c7\u30fc\u30bf\u304cNone\u3060\u3063\u305f\u5834\u5408\u306f\u51e6\u7406\u3092\u3084\u3081\u308b\n    if json_data is None:\n        debug_print(&quot;json_data is None. Exiting...&quot;)\n        return\n    else:\n        #wp\u7528\u30b3\u30f3\u30c6\u30f3\u30c4\u6574\u5f62\u51e6\u7406\n        content =&quot;&quot;\n        previous_city_name = &quot;&quot;\n        post_tags = set()\n\n        table_of_contents = &quot;&lt;h2&gt;\u76ee\u6b21&lt;\/h2&gt;&quot;\n        title_count = 0\n\n        for data in json_data:\n            if data is None:\n                continue\n            city_name = data[&quot;city_name&quot;]\n            title = data.get(&quot;entry_title&quot;)\n            summary = data.get(&quot;text_abs&quot;)\n            url = data[&quot;url&quot;]\n            if title is None or summary is None:\n                continue\n            title_count += 1\n\n            post_tags.add(city_name)\n            if city_name != previous_city_name:\n                if previous_city_name:\n                    table_of_contents += &quot;&lt;\/ul&gt;&quot;\n                content = content + &quot;&lt;h3 id=&#39;&quot; + city_name + &quot;&#39;&gt;&quot; + city_name + &quot;&lt;\/h3&gt;&quot;\n                table_of_contents += &quot;&lt;p&gt;&lt;a href=&#39;#&quot; + city_name + &quot;&#39;&gt;&quot; + city_name + &quot;&lt;\/a&gt;&quot;\n                table_of_contents += &quot;&lt;ul&gt;&quot;\n\n                previous_city_name = city_name\n\n            # \u8a18\u4e8b\u90e8\u5206\n            content = content + &quot;&lt;h4&gt;&lt;a href=&#39;&quot; + url + &quot;&#39;&gt;&quot; + title + &quot;&lt;\/a&gt;&lt;\/h4&gt;&quot;\n            content = content + &quot;&lt;p&gt;&lt;pre&gt;\u3000&lt;\/pre&gt;&quot; + summary + &quot;&lt;\/p&gt;&quot;\n\n            # \u76ee\u6b21\u90e8\u5206\n            table_of_contents += &quot;&lt;li&gt;&quot; + title + &quot;&lt;\/li&gt;&quot;\n\n        title_count_text = str(title_count) + &quot;\u4ef6&quot; if title_count &gt; 1 else &quot;1\u4ef6&quot;\n        title_summary = &quot; ( &quot; + title_count_text + &quot; ) &quot;\n\n        table_of_contents = &quot;&lt;div class=&#39;wp-block-quote&#39;&gt;&quot; + table_of_contents + &quot;&lt;\/div&gt;&quot;\n        content = table_of_contents + content\n\n        if title_count ==0:return\n        debug_print(content)\n\n        now = datetime.now()\n        #which=&quot;publish&quot;\n        which=&quot;draft&quot;\n\n        #\u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u547c\u3073\u51fa\u3057\n        wp_client = Client(wp_url, wp_id,wp_password)\n\n        #\u6295\u7a3f\u51e6\u7406\n        wp_post = WordPressPost()\n        wp_post.post_status = which\n        wp_post.title = &quot;{}\u5e74{}\u6708{}\u65e5({})\u306eXX\u5730\u57df\u30cb\u30e5\u30fc\u30b9{}&quot;.format(now.year, now.month, now.day, now.strftime(&quot;%A&quot;), title_summary )\n        wp_post.content = content\n        wp_post.terms_names = {\n        &quot;post_tag&quot;: list(post_tags),\n        &quot;category&quot;: [&#39;XXXXXX&#39;],\n        }\n        wp_client.call(NewPost(wp_post)) \n        return \n\n# debug\u7528\u306eprint\u95a2\u6570\ndef debug_print(message):\n    if debug_mode:\n        print(message)\n\n# main\u95a2\u6570\ndef main():\n    &quot;&quot;&quot;\n    \u30e1\u30a4\u30f3\u95a2\u6570\u3002\u5404\u5730\u57df\u306eRSS\u30d5\u30a3\u30fc\u30c9\u7b49\u304b\u3089\u8a18\u4e8b\u3092\u62bd\u51fa\u3057\u3001WordPress\u306b\u6295\u7a3f\u3059\u308b\u3002\n    &quot;&quot;&quot;\n    json_data = list()\n    for city_name, rss_url, element_id, is_rss in website_urls:\n        if is_rss:\n            feed = feedparser.parse(rss_url)\n            for entry in feed.entries:\n                date = entry.published if &#39;published&#39; in entry else entry.updated if &#39;updated&#39; in entry else entry.created\n                if isinstance(date, str):\n                    #date = datetime.strptime(date, date_format)\n                    date = parser.parse(date, tzinfos={&#39;JST&#39;: gettz(&#39;Asia\/Tokyo&#39;)})\n                    entry_title = entry.title\n                    url = entry.link\n                    data = extract_article(url, element_id, city_name, entry_title, date)\n                    if not data is None:\n                        json_data.append(data)\n        else:\n            data = extract_data_from_website(rss_url, element_id,city_name)\n            if data is None:\n                continue\n            json_data.append(data)\n\n    create_wp_post(json_data, wp_url, wp_id, wp_password)\n\n# main\u95a2\u6570\u306e\u547c\u3073\u51fa\u3057\nif __name__==&quot;__main__&quot;:\n    # \u30d7\u30ed\u30b0\u30e9\u30e0\u306e\u30a8\u30f3\u30c8\u30ea\u30fc\u30dd\u30a4\u30f3\u30c8\n    main()<\/code><\/pre><\/div>\n\n\n\n<p><\/p>\n\n\n\n<p>\u3000\u52d5\u4f5c\u306b\u5fc5\u8981\u306a\u30d7\u30e9\u30b0\u30a4\u30f3\u306f\u4ee5\u4e0b\u3092\u5b9f\u884c\u3059\u308b\u3053\u3068\u3067\u4e00\u5ea6\u306b\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u3059\u308b\u3053\u3068\u304c\u3067\u304d\u308b\u3002\u3053\u308c\u3067\u3001feedparser\u3001pytz\u3001requests\u3001openai\u3001deepl\u3001unidic-lite\u3001dateutil\u3001wordpress_xmlrpc\u306e\u30a4\u30f3\u30b9\u30c8\u30fc\u30eb\u304c\u4e00\u5ea6\u306b\u884c\u3048\u308b\u3002<\/p>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-bash\" data-lang=\"Bash\"><code>pip install feedparser pytz requests openai deepl unidic-lite python-dateutil python-wordpress-xmlrpc<\/code><\/pre><\/div>\n\n\n\n<p>\u3000\u4ee5\u4e0b\u306f\u3001\u5b9f\u969b\u306b\u4f5c\u6210\u3057\u305f\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f7f\u3063\u3066\u53ce\u96c6\u3057\u305f\u8a18\u4e8b\u3092\u8981\u7d04\u3057\u3001\u30c6\u30b9\u30c8\u4e2d\u306e\u30d6\u30ed\u30b0\u306b\u6295\u7a3f\u3057\u305f\u969b\u306e\u30c7\u30e2\u52d5\u753b\u3002<\/p>\n\n\n\n<figure class=\"wp-block-embed is-type-rich is-provider-twitter wp-block-embed-twitter\"><div class=\"wp-block-embed__wrapper\">\n<blockquote class=\"twitter-tweet\" data-width=\"500\" data-dnt=\"true\"><p lang=\"ja\" dir=\"ltr\">OpenAI\u306e\u6d3b\u7528\u30c6\u30b9\u30c8\u3002\u5730\u5143\u306e\u5ca1\u5c71\u770c\u5185\u306e\u30cb\u30e5\u30fc\u30b9\u3092\u53ce\u96c6\u3057\u3066\u3001\u8981\u7d04\u3057\u3066\u81ea\u52d5\u7684\u306b\u8a18\u4e8b\u306b\u3057\u3066\u307f\u308b\u3002\u3068\u308a\u3042\u3048\u305a\u81ea\u6cbb\u4f53\u60c5\u5831\u304b\u3089\u3002<br>\u305d\u308c\u305e\u308c\u306e\u539f\u7a3f\u306e\u30af\u30bb\u304c\u6b8b\u308b\u304b\u3089\u7d71\u4e00\u611f\u304c\u306a\u3044\u3051\u3069\u3001\u5168\u81ea\u52d5\u3067\u3053\u306e\u30af\u30aa\u30ea\u30c6\u30a3\u306f\u51c4\u3044\u3002 <a href=\"https:\/\/t.co\/IL2Gdt1TRS\">pic.twitter.com\/IL2Gdt1TRS<\/a><\/p>&mdash; \u308c\u304c\u30fc\u3068 \/ legato (@legato_ip4) <a href=\"https:\/\/twitter.com\/legato_ip4\/status\/1614380285495222272?ref_src=twsrc%5Etfw\">January 14, 2023<\/a><\/blockquote><script async src=\"https:\/\/platform.twitter.com\/widgets.js\" charset=\"utf-8\"><\/script>\n<\/div><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u304a\u308f\u308a\u306b<\/h2>\n\n\n\n<p>\u3000\u81ea\u52d5\u7684\u306b\u8981\u7d04\u8a18\u4e8b\u3092\u66f8\u304f\u3053\u3068\u304c\u3067\u304d\u308b\u306a\u3093\u3066\u3001\u975e\u5e38\u306b\u4fbf\u5229\u306a\u6642\u4ee3\u306b\u306a\u3063\u305f\u3082\u306e\u3060\u3068\u601d\u3046\u3002<br>\u3000\u305f\u3060\u3057\u3001\u4eca\u56de\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3067\u306f\u500b\u5225\u306e\u8a18\u4e8b\u3054\u3068\u306bOpenAI\u306eAPI\u3092\u5229\u7528\u3059\u308b\u3053\u3068\u304b\u3089\u3001\u5168\u4f53\u306e\u66f8\u304d\u632f\u308a\u306e\u7d71\u4e00\u611f\u3092\u51fa\u3059\u3053\u3068\u306f\u96e3\u3057\u3044\u3068\u3044\u3046\u554f\u984c\u304c\u6b8b\u3063\u3066\u3044\u308b\u3002\u307e\u305f\u3001ChatGPT\u306b\u6bd4\u3079\u308b\u3068\u8981\u7d04\u7cbe\u5ea6\u304c\u660e\u3089\u304b\u306b\u4f4e\u3044\u306e\u3067\u3001\u53ce\u96c6\u3059\u308b\u5206\u91ce\u306b\u7279\u5316\u3057\u305f\u5b66\u7fd2\u3092\u884c\u3063\u3066\u3001\u8981\u7d04\u306e\u7cbe\u5ea6\u304c\u5411\u4e0a\u3055\u305b\u308b\u5fc5\u8981\u304c\u3042\u308b\u3002\u307e\u305f\u3001\u53d6\u5f97\u3059\u308b\u8a18\u4e8b\u3054\u3068\u306e\u30b3\u30b9\u30c8\u3092\u524a\u6e1b\u3059\u308b\u305f\u3081\u306b\u306f\u3001\u4e0d\u8981\u306a\u90e8\u5206\u3092\u4e8b\u524d\u306b\u524a\u9664\u3059\u308b\u6a5f\u80fd\u3082\u5fc5\u8981\u3060\u308d\u3046\u3002<br>\u3000\u306a\u304a\u3001\u53d6\u5f97\u3059\u308b\u8a18\u4e8b\u306f\u8457\u4f5c\u6a29\u306e\u554f\u984c\u304c\u306a\u3044\u3082\u306e\u306b\u9650\u308b\u306e\u3067\u3001\u5229\u7528\u306e\u969b\u306f\u6ce8\u610f\u3057\u3066\u6b32\u3057\u3044\u3002<\/p>\n\n\n\n<div class=\"affiliate-box\"><div class=\"affiliate-containar\"><a href=\"https:\/\/amzn.to\/3H71IeN\" rel=\"nofollow\"><img decoding=\"async\" style=\"border: none;\" src=\"https:\/\/m.media-amazon.com\/images\/I\/51ot2IdQUHL.jpg\" target=\"_blank\"><\/a><div class=\"affiliate-content\"><a href=\"https:\/\/amzn.to\/3H71IeN\" rel=\"nofollow\">\u30b9\u30c3\u30ad\u30ea\u308f\u304b\u308bPython\u5165\u9580 \u30b9\u30c3\u30ad\u30ea\u308f\u304b\u308b\u30b7\u30ea\u30fc\u30ba Kindle\u7248<\/a><ul class=\"affiliate-button\"><li><a href=\"https:\/\/amzn.to\/3H71IeN\" rel=\"nofollow\">Amazon<\/a><\/li><\/ul><\/div><\/div><\/div>\n\n\n\n<p><br><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u306f\u3058\u3081\u306b\u3000 \u3000\u6700\u8fd1ChatGPT\u304c\u8a71\u984c\u306b\u306a\u3063\u3066\u3044\u308b\u306e\u3067\u3001\u3044\u304f\u3064\u304b\u306e\u30c6\u30b9\u30c8\u30d7\u30ed\u30b0\u30e9\u30e0\u3092ChatGPT\u3092\u5229\u7528\u3057\u3066\u4f5c\u6210\u3057\u3066\u304d\u305f\u304c\u3001\u4eca\u56de\u306f\u30bf\u30a4\u30c8\u30eb\u306b\u3042\u308b\u3088\u3046\u306b\u5c11\u3057\u8907\u96d1\u306a\u30d7\u30ed\u30b0\u30e9\u30e0\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u306b\u53d6\u308a\u7d44\u3093\u3060\u3002\u30a6\u30a7\u30d6\u30b9\u30af\u30ec\u30a4\u30d4\u30f3\u30b0\u3059 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":1686,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1671","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-3"],"acf":[],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/ubun2m.com\/wp-content\/uploads\/2023\/01\/Screenshot-2023-01-15-at-19.07.31.png","_links":{"self":[{"href":"https:\/\/ubun2m.com\/index.php?rest_route=\/wp\/v2\/posts\/1671","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ubun2m.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ubun2m.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ubun2m.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ubun2m.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1671"}],"version-history":[{"count":0,"href":"https:\/\/ubun2m.com\/index.php?rest_route=\/wp\/v2\/posts\/1671\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ubun2m.com\/index.php?rest_route=\/wp\/v2\/media\/1686"}],"wp:attachment":[{"href":"https:\/\/ubun2m.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1671"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ubun2m.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1671"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ubun2m.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1671"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}