{"id":16247896,"url":"https://github.com/jcblw/snapscrape","last_synced_at":"2025-04-08T12:17:24.247Z","repository":{"id":9096790,"uuid":"10875293","full_name":"jcblw/snapscrape","owner":"jcblw","description":"scrapper for nodejs with middleware","archived":false,"fork":false,"pushed_at":"2017-05-12T14:16:07.000Z","size":5,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-14T08:16:48.789Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jcblw.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-06-23T00:27:34.000Z","updated_at":"2014-08-28T05:18:22.000Z","dependencies_parsed_at":"2022-07-21T12:03:43.274Z","dependency_job_id":null,"html_url":"https://github.com/jcblw/snapscrape","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcblw%2Fsnapscrape","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcblw%2Fsnapscrape/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcblw%2Fsnapscrape/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jcblw%2Fsnapscrape/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jcblw","download_url":"https://codeload.github.com/jcblw/snapscrape/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247838447,"owners_count":21004580,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T14:39:09.839Z","updated_at":"2025-04-08T12:17:24.225Z","avatar_url":"https://github.com/jcblw.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"### Snapscape it\n\nscraping the web with node on request.\n\n#### Use it.\n\n```javascript\nvar scrapper = require(\"snapscrape\");\n\nscrapper.scrape(\"http://google.com\", function(res, body){\n\tconsole.log(arguments);\n});\n```\ncool beans\n\n#### Add to it\n\n```javascript\n\nscrapper.use(/*middleware*/);\n\n//comes with a htmlparser\nscrapper.use(scrapper.htmlParser);\nscrapper.scrape(\"http://google.com\", function(res, body){\n\t// see googles javascripts\n\tconsole.log(res.html(\"body\").text());\n});\n```\n\n#### Build for it\n\nthe middleware is very similiar to connects middleware\n\n```javascript\nmodule.exports = function(response, body, next){\n\tnext();\t\n};\n```\n\n`response` is the response from the server your pulling from\n\n`body` is the body from server, or aka the goods\n\n`next` is a function called to pass payload to next middleware function or callback;\n\n###### to come\n\nprobably hooking this into a promise system so that you can have nice errors;\n\n```javascript\nvar error = function(){\n\tconsole.log(\"you fail\")\n}\nscrapper.scrape(\"FAIL\", function(res, body){\n\t\n}, err);\n```\n\nand test!\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcblw%2Fsnapscrape","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjcblw%2Fsnapscrape","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjcblw%2Fsnapscrape/lists"}