scrape a website and put it in a db, use SQLite with an ORM along with (FTS) as I would…
- User
scrape a website and put it in a db, use SQLite with an ORM along with (FTS) as I would be searching in the title, body of the posts and the name of the users, the stored data will consists of users, and with each, posts corresponding to the user, the website has an api that returns json objects: eg response of a post: [{"id": "1836570","user": "6570768","service": "fanbox","title": "今日はFANBOXを始まりました!","content": "みなさんこんにちは、影おじです。先週のように、FANBOXを始まりに決定しました!そしてFANBOXの更新内容について、アンケートのみさんありがとうございました!では更新内容の詳しいことはこちらです↓毎回の絵、元も差分がありませんの場合、ボナスとして差イラストを支援者の皆様にプレゼント。もとも差分があれば、ボナスとしてヌード差分イラストを支援者の皆様にプレゼント。これから、仕以外の時間、できる限り勤勉な更新したいと思います!どうぞよろしくお願いいたします!","embed": {},"shared_file": false,"added": "2021-03-30T18:00:05.973913","published": "2021-01-24T17:54:38","edited": "2021-01-24T18:46:15","file": {"name": "a99d9674-5490-400e-acca-4bed99590699.jpg","path": "/5c/98/5c984d1f62f0990a0891d8fa359aecdff6ac1e26ac165ba7bb7f31cc99e7a674.jpg"},"attachments": []},{"id": "1836649","user": "6570768","service": "fanbox","title": "忍ちゃん 脇コキ差分","content": "","embed": {},"shared_file": false,"added": "2021-03-30T17:59:57.815397","published": "2021-01-24T18:23:12","edited": "2023-01-04T14:45:19","file": {"name": "4c5615f9-be74-4fa7-b88d-168fd37a2824.jpg","path": "/d0/3c/d03c893927521536646619f5fb33426aa4b82dc12869865d6d666932755d9acd.jpg"},"attachments": [{"name": "9cc982e4-1d94-4a1a-ac62-3dddd29f881c.png","path": "/d7/4d/d74d1727f2c3fcf7a7cc2d244d677d93b4cc562a56904765e4e708523b34fb4c.png"},{"name": "ab0e17d7-52e5-42c2-925b-5cfdb451df0c.png","path": "/1b/67/1b677a8c0525e386bf2b2f013e36e29e4033feb2308798e4e5e3780da6c0e815.png"}]}]
eg response of user: [{"favorited": 1,"id": "21101760","indexed": 1672534800,"name": "RAIGYO","service": "fanbox","updated": 1672534800}]
create a script that gets /creators.txt to get the names of the users to scrape, /{service}/user/{creator_id}?o={offset every 50 posts}, /{service}/user/{creator_id}/post/{post_id}, to get individual posts, the way to scrape should be the most random possible, get proxies by running a user defined function named "getproxy" each time we require making a new request to the website, the script has to be able to recover from a unespected shutdown and pause itself if multiple proxys are failing to get responses as the website may be temporarily down, priorize that the db is healthy, keep two backups checking always that the last saved db is healthy, else, stop the script. introduce randomness in the accessed users and posts do not scrape everything from the same user at once, make sure to not create a memory leak and create a function that for a random number between 5-15 seconds launches a random number between 5 to 25 concurrent threads.
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.