{"html_url": "https://github.com/simonw/datasette/issues/1928#issuecomment-1335966329", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1928", "id": 1335966329, "node_id": "IC_kwDOBm6k_c5PoTp5", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-02T23:47:11Z", "updated_at": "2022-12-02T23:47:11Z", "author_association": "OWNER", "body": "Wrote about this extensively here: https://simonwillison.net/2022/Dec/2/datasette-write-api/", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1473481262, "label": "Hacker News Datasette write demo"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1928#issuecomment-1335870889", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1928", "id": 1335870889, "node_id": "IC_kwDOBm6k_c5Pn8Wp", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-02T21:41:09Z", "updated_at": "2022-12-02T21:41:09Z", "author_association": "OWNER", "body": "Got it working!\r\n\r\nhttps://simon.datasette.cloud/data/hacker_news_posts\r\n\r\nhttps://github.com/simonw/scrape-hacker-news-by-domain/blob/main/submit-to-datasette-cloud.sh", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1473481262, "label": "Hacker News Datasette write demo"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1928#issuecomment-1335870887", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1928", "id": 1335870887, "node_id": "IC_kwDOBm6k_c5Pn8Wn", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-02T21:25:16Z", "updated_at": "2022-12-02T21:25:16Z", "author_association": "OWNER", "body": "Here's the change that should submit data to Datasette Cloud: https://github.com/simonw/scrape-hacker-news-by-domain/commit/848bb7e835a9fb87cd656362591835179cd1dc1b\r\n\r\nI ran `delete from hacker_news_posts` against my instance so https://simon.datasette.cloud/data/hacker_news_posts is now empty.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1473481262, "label": "Hacker News Datasette write demo"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1928#issuecomment-1335870884", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1928", "id": 1335870884, "node_id": "IC_kwDOBm6k_c5Pn8Wk", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-02T21:19:58Z", "updated_at": "2022-12-02T21:19:58Z", "author_association": "OWNER", "body": "But until I fix this issue:\r\n- https://github.com/simonw/datasette/issues/1927\r\n\r\nI need to insert freshly scraped data like this:\r\n\r\n```bash\r\nexport ROWS=$(\r\n jq -n --argjson rows \"$(cat simonwillison-net.json)\" \\\r\n '{ \"rows\": $rows, \"replace\": true }'\r\n)\r\n\r\ncurl -X POST \\\r\n https://simon.datasette.cloud/data/hacker_news_posts/-/insert \\\r\n -H \"Content-Type: application/json\" \\\r\n -H \"Authorization: Bearer $DS_TOKEN\" \\\r\n -d $ROWS\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1473481262, "label": "Hacker News Datasette write demo"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1928#issuecomment-1335870883", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1928", "id": 1335870883, "node_id": "IC_kwDOBm6k_c5Pn8Wj", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-02T21:19:10Z", "updated_at": "2022-12-02T21:19:10Z", "author_association": "OWNER", "body": "I created the `hacker_news_posts` table like this:\r\n\r\n```bash\r\nexport ROWS=$(\r\n jq -n --argjson rows \"$(cat simonwillison-net.json)\" \\\r\n '{ \"table\": \"hacker_news_posts\", \"rows\": $rows, \"pk\": \"id\", \"replace\": true }'\r\n)\r\n# Use curl to POST some JSON to a URL\r\ncurl -X POST \\\r\n https://simon.datasette.cloud/data/-/create \\\r\n -H \"Content-Type: application/json\" \\\r\n -H \"Authorization: Bearer $DS_TOKEN\" \\\r\n -d $ROWS\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1473481262, "label": "Hacker News Datasette write demo"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1928#issuecomment-1335870879", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1928", "id": 1335870879, "node_id": "IC_kwDOBm6k_c5Pn8Wf", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-02T21:18:25Z", "updated_at": "2022-12-02T21:18:25Z", "author_association": "OWNER", "body": "This is the SQL view for the atom feed:\r\n```sql\r\nCREATE VIEW hacker_news_posts_atom as select\r\n id as atom_id,\r\n title as atom_title,\r\n url,\r\n commentsUrl as atom_link,\r\n dt || 'Z' as atom_updated,\r\n 'Submitter: ' || submitter || ' - ' || points || ' points, ' || numComments || ' comments' as atom_content\r\nfrom\r\n hacker_news_posts\r\norder by\r\n dt desc\r\nlimit\r\n 100;\r\n```", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1473481262, "label": "Hacker News Datasette write demo"}, "performed_via_github_app": null} {"html_url": "https://github.com/simonw/datasette/issues/1928#issuecomment-1335870877", "issue_url": "https://api.github.com/repos/simonw/datasette/issues/1928", "id": 1335870877, "node_id": "IC_kwDOBm6k_c5Pn8Wd", "user": {"value": 9599, "label": "simonw"}, "created_at": "2022-12-02T21:17:50Z", "updated_at": "2022-12-02T21:17:50Z", "author_association": "OWNER", "body": "https://simon.datasette.cloud/data/hacker_news_posts_atom.atom is working now.", "reactions": "{\"total_count\": 0, \"+1\": 0, \"-1\": 0, \"laugh\": 0, \"hooray\": 0, \"confused\": 0, \"heart\": 0, \"rocket\": 0, \"eyes\": 0}", "issue": {"value": 1473481262, "label": "Hacker News Datasette write demo"}, "performed_via_github_app": null}