{"id":1952,"date":"2023-02-19T11:38:50","date_gmt":"2023-02-19T03:38:50","guid":{"rendered":"https:\/\/pjq.me\/?p=1952"},"modified":"2023-02-19T11:56:03","modified_gmt":"2023-02-19T03:56:03","slug":"chatgpt-autosummarybot","status":"publish","type":"post","link":"https:\/\/pjq.me\/?p=1952","title":{"rendered":"ChatGPT-AutoSummaryBot"},"content":{"rendered":"\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_81 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/pjq.me\/?p=1952\/#Repo\" >Repo<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/pjq.me\/?p=1952\/#Requirements\" >Requirements<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/pjq.me\/?p=1952\/#Usage\" >Usage<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/pjq.me\/?p=1952\/#Customization\" >Customization<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/pjq.me\/?p=1952\/#Conclusion\" >Conclusion<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/pjq.me\/?p=1952\/#Scripts\" >Scripts<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Repo\"><\/span>Repo<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>https:\/\/github.com\/pjq\/ChatGPT-SummaryBot<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p>Most of the code is generated by ChatGPT, all you need is to provide the appropriate prompt message, and debug, even this document is also generated by ChatGPT<\/p>\n<\/blockquote>\n\n\n\n<p>This is a Python script for fetching documents from the Internet and feeding them to the OpenAI ChatGPT model to summarize the contents. The script consists of several parts:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Fetching all the links and contents from a website using <code>requests<\/code> and <code>BeautifulSoup<\/code><\/li>\n\n\n\n<li>Storing the mapping of links to contents in a text file<\/li>\n\n\n\n<li>Splitting the text file into smaller files for easier processing<\/li>\n\n\n\n<li>Sending the smaller files to the OpenAI ChatGPT model using the <code>revChatGPT<\/code> library<\/li>\n\n\n\n<li>Receiving and printing the summary of the documents from the OpenAI ChatGPT model<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Requirements\"><\/span>Requirements<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>python 3.7+<\/li>\n\n\n\n<li>requests<\/li>\n\n\n\n<li>bs4<\/li>\n\n\n\n<li>revChatGPT<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Usage\"><\/span>Usage<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Install the required libraries:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>pip3 install requests beautifulsoup revChatGPT\nOr\npip instead -r requirements.txt<\/code><\/pre>\n\n\n\n<p>Then follow the revChatGPT to setup the ChatGPT config<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>https:\/\/github.com\/acheong08\/ChatGPT<\/li>\n<\/ul>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Run the script:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>python AutoSummaryBot.py<\/code><\/pre>\n\n\n\n<p>The script will first print a message indicating that it is going to send some documents to the OpenAI ChatGPT model. Then it will send the smaller files one by one, and wait for 5 seconds between each file. After all the files are sent, the script will print the message &#8220;All documents sent&#8221;. Finally, it will send a query to the OpenAI ChatGPT model to ask for the summary of the documents, and print the response.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>I:init_chatgpt\nI:fetch_link_contents\nI:scrape_page: https:\/\/pjq.me\/?p=1906\nI:scrape_page: https:\/\/pjq.me\/?p=1906#respond\nI:scrape_page: https:\/\/pjq.me\/?p=1906\nI:I am going to send you some documents, and you just need say: received and understood, and after all the files sent finished, I will let you know, such as: All documents sent, and later I will ask questions\nChatGPT: Understood! I am ready to receive the documents. Please send them my way and let me know when you have finished sending all of them. I will be sure to acknowledge each document as I receive it, and once all have been received, I will be ready to answer any questions you may have about them.\nI:You should only response: Received and understood\nChatGPT: Received and understood.\nI:Sleep 5 seconds\nChatGPT: Received and understood.\nI:Sleep 5 seconds\nI:Sending file: link_to_contents_1.txt\nChatGPT: Received and understood.\nI:Sleep 5 seconds\nI:Sending file: link_to_contents_2.txt\nChatGPT: It looks like this is a blog post or a website that contains information about various topics, such as technology, software, and personal experiences. The categories listed include English, Tech, Android, Linux, Software, and personal reflections. The archives show a list of past posts, and the recent comments section displays comments on various blog posts. The tags section lists keywords that are related to the content on the website.\nI:You should only response: Received and understood\nChatGPT: Received and understood.\nI:Sleep 5 seconds\nChatGPT: Received and understood\nI:Sleep 5 seconds\nI:Sending file: link_to_contents_3.txt\nChatGPT: It looks like you have successfully integrated the ChatGPT model with the Xiao Ai smart home assistant. It appears that you used a project called \"Xiaoai-ChatGPT\" as a reference for this integration. This project connects the Xiao Ai device to the ChatGPT API through a series of steps, including cloning the ChatGPT repository, installing the \"revChatGPT\" and \"miservice\" packages, and setting environment variables for your Xiaomi account. The final step involves running the \"xiaogpt.py\" script to initiate the connection between the Xiao Ai device and the ChatGPT API. When you ask the Xiao Ai device a question that starts with \"\u5e2e\u6211\u56de\u7b54\", the question will be forwarded to the ChatGPT API, and the answer will be played back through the Xiao Ai device.\nI:You should only response: Received and understood\nChatGPT: Received and understood.\nI:Sleep 5 seconds\nChatGPT: Received and understood.\nI:Sleep 5 seconds\nI:Sending file: link_to_contents_4.txt\nChatGPT: I'm sorry, but I am not sure what you would like me to do with this information. Could you please provide more context or clarify your request?\nI:You should only response: Received and understood\nChatGPT: Received and understood.\nI:Sleep 5 seconds\nChatGPT: Received and understood.\nI:Sleep 5 seconds\nI:Sending file: link_to_contents_5.txt\nChatGPT: Received and understood.\nI:Sleep 5 seconds\nI:All documents sent\nChatGPT: Received and understood.\nI:Sleep 5 seconds\nI:Summary of the documents I just sent to you\nChatGPT: I'm sorry, but I didn't receive any documents. Can you please provide more information or resend the documents?\nI:You should only response: Received and understood\nChatGPT: Received and understood.\nI:Sleep 5 seconds\nChatGPT: I'm sorry, but you didn't send me any documents recently.\nI:You should only response: Received and understood\nChatGPT: Received and understood.\nI:Sleep 5 seconds\nI:Sleep 5 seconds<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Customization\"><\/span>Customization<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>You can customize the script by changing the following parameters:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>base_url<\/code>: the website to fetch the links and contents from<\/li>\n\n\n\n<li><code>chunk_size<\/code>: the size of each smaller file in bytes<\/li>\n\n\n\n<li><code>retries<\/code>: the number of retries when sending a file to the OpenAI ChatGPT model<\/li>\n\n\n\n<li><code>sleep_time<\/code>: the time to wait between each file in seconds<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p>This script provides a simple and automated way to fetch documents from the Internet and summarize their contents using the OpenAI ChatGPT model. You can use it as a starting point for your own projects and experiments.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Scripts\"><\/span>Scripts<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code>import os\nimport time\n\nimport requests\nimport argparse\nfrom bs4 import BeautifulSoup\nfrom revChatGPT.V1 import Chatbot, configure\n\nEND_FLAG = \"All documents sent\"\nLINK_TO_CONTENT = \"link_to_contents.txt\"\nLINK_TO_CONTENT_DIR = \"link_to_content\"\n\n\ndef log(msg):\n    print(f\"I:{msg}\")\n\n\nclass AutoChatBot:\n    def __init__(self, base_url, chunk_size, retries, sleep_time):\n        self.base_url = base_url\n        self.chunk_size = chunk_size\n        self.retries = retries\n        self.sleep_time = sleep_time\n        self.init_chatgpt()\n\n    def extract_text(self, content):\n        soup = BeautifulSoup(content, \"html.parser\")\n        for script in soup(&#91;\"script\", \"style\"]):\n            script.decompose()\n        return \" \".join(soup.stripped_strings)\n\n    def scrape_page(self, url):\n        log(f\"scrape_page: {url}\")\n        page = requests.get(url)\n        return self.extract_text(page.content)\n\n    def fetch_link_contents(self):\n        log(\"fetch_link_contents\")\n        page_contents = {}\n        links = &#91;]\n        # Fetch the main page\n        main_page = requests.get(self.base_url)\n        soup = BeautifulSoup(main_page.content, \"html.parser\")\n        # Extract all links from the main page\n        for link in soup.find_all(\"a\"):\n            href = link.get(\"href\")\n            if href and self.base_url in href:\n                links.append(href)\n        # Fetch the contents of each link\n        if len(links) == 0:\n            log(\"not link found, and no contents\")\n            exit(0)\n        for link in links:\n            page_contents&#91;link] = self.scrape_page(link)\n        # Store the mapping of link to contents\n        with open(LINK_TO_CONTENT, \"w\") as f:\n            for link, content in page_contents.items():\n                f.write(f\"{link}: {content}\\n\")\n\n    def split_file(self, file_path, output_dir, chunk_size=1024 * 4):\n        if not os.path.exists(LINK_TO_CONTENT_DIR):\n            os.makedirs(LINK_TO_CONTENT_DIR)\n        with open(file_path, \"rb\") as f:\n            chunk = f.read(chunk_size)\n            chunk_num = 1\n            while chunk:\n                output_file = os.path.join(output_dir, f\"link_to_contents_{chunk_num}.txt\")\n                with open(output_file, \"wb\") as output_f:\n                    output_f.write(chunk)\n                chunk = f.read(chunk_size)\n                chunk_num += 1\n\n    def init_chatgpt(self):\n        self.chatbot = Chatbot(configure())\n        log(\"init_chatgpt\")\n\n    def chatbot_ask(self, query):\n        retries = 0\n        while retries &lt; self.retries:\n            try:\n                data = list(self.chatbot.ask(query))&#91;-1]\n                message = data.get(\"message\", \"\")\n                if message:\n                    message = \"ChatGPT: \" + message\n                    print(message)\n                    if query not in END_FLAG:\n                        if \"understood\" not in message:\n                            log(\"You should only response: Received and understood\")\n                            self.chatbot_ask(\"You should only response: Received and understood\")\n                            retries += 1\n                            continue\n                break\n            except Exception as e:\n                log(\"Error in chatbot_ask: \", str(e))\n                retries += 1\n        log(\"Sleep 5 seconds\")\n        time.sleep(self.sleep_time)\n\n    def send_all_files_to_chatgpt(self):\n        path = LINK_TO_CONTENT_DIR\n        files = os.listdir(path)\n        files.sort(key=lambda x: os.path.getctime(os.path.join(path, x)))\n        for filename in files:\n            with open(os.path.join(path, filename), \"r\", encoding=\"utf-8\", errors=\"replace\") as f:\n                log(f\"Sending file: {filename}\")\n                content = f.read()\n                self.chatbot_ask(content)\n\n\n# if __name__ == \"__main__\":\n#     # fetch_link_contents()\n# split_files()\n#     bot = AutoChatBot()\n#     log(f\"I am going to send you some documents, and you just need say: received and understood, and after all the files sent finished, I will let you know, such as: {END_FLAG}, and later I will ask questions\")\n#     bot.chatbot_ask(f\"I am going to send you some text documents, and you just need say: received and understood, and after all the documents sent finished, I will let you know, such as: {END_FLAG}, and later I will ask questions about those documents\")\n#     bot.send_all_files_to_chatgpt()\n#     log(END_FLAG)\n#     bot.chatbot_ask(END_FLAG)\n#     log(\"Summary of the documents I just sent to you\")\n#     bot.chatbot_ask(\"Summary of the documents I just sent to you\")\n\n\nif __name__ == \"__main__\":\n    parser = argparse.ArgumentParser(\n        description=\"Fetch the contents from a website and summarize the contents using OpenAI GPT-3\")\n    parser.add_argument(\"--base-url\", type=str, default=\"https:\/\/pjq.me\/?p=1906\",\n                        help=\"The website to fetch the links and contents from\")\n    parser.add_argument(\"--chunk-size\", type=int, default=1024 * 4, help=\"The size of each smaller file in bytes\")\n    parser.add_argument(\"--retries\", type=int, default=2,\n                        help=\"The number of retries when sending a file to the OpenAI GPT-3 model\")\n    parser.add_argument(\"--sleep-time\", type=int, default=5, help=\"The time to wait between each file in seconds\")\n    args = parser.parse_args()\n\n    bot = AutoChatBot(base_url=args.base_url, chunk_size=args.chunk_size, retries=args.retries, sleep_time=args.sleep_time)\n    bot.fetch_link_contents()\n    bot.split_file(LINK_TO_CONTENT, LINK_TO_CONTENT_DIR, args.chunk_size)\n    log(f\"I am going to send you some documents, and you just need say: received and understood, and after all the files sent finished, I will let you know, such as: {END_FLAG}, and later I will ask questions\")\n    bot.chatbot_ask(\n        f\"I am going to send you some text documents, and you just need say: received and understood, and after all the documents sent finished, I will let you know, such as: {END_FLAG}, and later I will ask questions about those documents\")\n    bot.send_all_files_to_chatgpt()\n    log(END_FLAG)\n    bot.chatbot_ask(END_FLAG)\n    log(\"Summary of the documents I just sent to you\")\n    bot.chatbot_ask(\"Summary of the documents I just sent to you\")<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Repo Most of the code is generated by ChatGPT, all you need is to provide the appropriate prompt message, and debug, even this document is also generated by ChatGPT This is a Python script for fetching documents from the Internet<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[202,200,213,219],"class_list":["post-1952","post","type-post","status-publish","format-standard","hentry","category-uncategorized","tag-ai","tag-chatgpt","tag-openai","tag-python"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.0 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>ChatGPT-AutoSummaryBot - Jianqing&#039;s Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/pjq.me\/?p=1952\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"ChatGPT-AutoSummaryBot - Jianqing&#039;s Blog\" \/>\n<meta property=\"og:description\" content=\"Repo Most of the code is generated by ChatGPT, all you need is to provide the appropriate prompt message, and debug, even this document is also generated by ChatGPT This is a Python script for fetching documents from the Internet\" \/>\n<meta property=\"og:url\" content=\"https:\/\/pjq.me\/?p=1952\" \/>\n<meta property=\"og:site_name\" content=\"Jianqing&#039;s Blog\" \/>\n<meta property=\"article:published_time\" content=\"2023-02-19T03:38:50+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-02-19T03:56:03+00:00\" \/>\n<meta name=\"author\" content=\"pengjianqing\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"pengjianqing\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"7 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/pjq.me\/?p=1952#article\",\"isPartOf\":{\"@id\":\"https:\/\/pjq.me\/?p=1952\"},\"author\":{\"name\":\"pengjianqing\",\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60\"},\"headline\":\"ChatGPT-AutoSummaryBot\",\"datePublished\":\"2023-02-19T03:38:50+00:00\",\"dateModified\":\"2023-02-19T03:56:03+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/pjq.me\/?p=1952\"},\"wordCount\":313,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60\"},\"keywords\":[\"AI\",\"ChatGPT\",\"OpenAI\",\"Python\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/pjq.me\/?p=1952#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/pjq.me\/?p=1952\",\"url\":\"https:\/\/pjq.me\/?p=1952\",\"name\":\"ChatGPT-AutoSummaryBot - Jianqing&#039;s Blog\",\"isPartOf\":{\"@id\":\"https:\/\/pjq.me\/#website\"},\"datePublished\":\"2023-02-19T03:38:50+00:00\",\"dateModified\":\"2023-02-19T03:56:03+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/pjq.me\/?p=1952#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/pjq.me\/?p=1952\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/pjq.me\/?p=1952#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/pjq.me\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ChatGPT-AutoSummaryBot\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/pjq.me\/#website\",\"url\":\"https:\/\/pjq.me\/\",\"name\":\"Jianqing&#039;s Blog\",\"description\":\"Thoughts and Future\",\"publisher\":{\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/pjq.me\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60\",\"name\":\"pengjianqing\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/pjq.me\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-02-at-6.10.58-PM.png\",\"contentUrl\":\"https:\/\/pjq.me\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-02-at-6.10.58-PM.png\",\"width\":460,\"height\":752,\"caption\":\"pengjianqing\"},\"logo\":{\"@id\":\"https:\/\/pjq.me\/#\/schema\/person\/image\/\"},\"url\":\"https:\/\/pjq.me\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"ChatGPT-AutoSummaryBot - Jianqing&#039;s Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/pjq.me\/?p=1952","og_locale":"en_US","og_type":"article","og_title":"ChatGPT-AutoSummaryBot - Jianqing&#039;s Blog","og_description":"Repo Most of the code is generated by ChatGPT, all you need is to provide the appropriate prompt message, and debug, even this document is also generated by ChatGPT This is a Python script for fetching documents from the Internet","og_url":"https:\/\/pjq.me\/?p=1952","og_site_name":"Jianqing&#039;s Blog","article_published_time":"2023-02-19T03:38:50+00:00","article_modified_time":"2023-02-19T03:56:03+00:00","author":"pengjianqing","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pengjianqing","Est. reading time":"7 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/pjq.me\/?p=1952#article","isPartOf":{"@id":"https:\/\/pjq.me\/?p=1952"},"author":{"name":"pengjianqing","@id":"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60"},"headline":"ChatGPT-AutoSummaryBot","datePublished":"2023-02-19T03:38:50+00:00","dateModified":"2023-02-19T03:56:03+00:00","mainEntityOfPage":{"@id":"https:\/\/pjq.me\/?p=1952"},"wordCount":313,"commentCount":0,"publisher":{"@id":"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60"},"keywords":["AI","ChatGPT","OpenAI","Python"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/pjq.me\/?p=1952#respond"]}]},{"@type":"WebPage","@id":"https:\/\/pjq.me\/?p=1952","url":"https:\/\/pjq.me\/?p=1952","name":"ChatGPT-AutoSummaryBot - Jianqing&#039;s Blog","isPartOf":{"@id":"https:\/\/pjq.me\/#website"},"datePublished":"2023-02-19T03:38:50+00:00","dateModified":"2023-02-19T03:56:03+00:00","breadcrumb":{"@id":"https:\/\/pjq.me\/?p=1952#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/pjq.me\/?p=1952"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/pjq.me\/?p=1952#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/pjq.me\/"},{"@type":"ListItem","position":2,"name":"ChatGPT-AutoSummaryBot"}]},{"@type":"WebSite","@id":"https:\/\/pjq.me\/#website","url":"https:\/\/pjq.me\/","name":"Jianqing&#039;s Blog","description":"Thoughts and Future","publisher":{"@id":"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/pjq.me\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/pjq.me\/#\/schema\/person\/0eb1e72d1e69fbbd9b5c0bfd8e2aae60","name":"pengjianqing","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/pjq.me\/#\/schema\/person\/image\/","url":"https:\/\/pjq.me\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-02-at-6.10.58-PM.png","contentUrl":"https:\/\/pjq.me\/wp-content\/uploads\/2021\/12\/Screen-Shot-2021-12-02-at-6.10.58-PM.png","width":460,"height":752,"caption":"pengjianqing"},"logo":{"@id":"https:\/\/pjq.me\/#\/schema\/person\/image\/"},"url":"https:\/\/pjq.me\/?author=1"}]}},"views":1824,"_links":{"self":[{"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/posts\/1952","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pjq.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1952"}],"version-history":[{"count":4,"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/posts\/1952\/revisions"}],"predecessor-version":[{"id":1958,"href":"https:\/\/pjq.me\/index.php?rest_route=\/wp\/v2\/posts\/1952\/revisions\/1958"}],"wp:attachment":[{"href":"https:\/\/pjq.me\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1952"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pjq.me\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1952"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pjq.me\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1952"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}