{"id":19309797,"url":"https://github.com/mitica/ascrape-js","last_synced_at":"2025-08-05T10:33:35.406Z","repository":{"id":57143856,"uuid":"63302613","full_name":"mitica/ascrape-js","owner":"mitica","description":"Extracts article content from a web page.","archived":false,"fork":false,"pushed_at":"2017-02-25T13:43:17.000Z","size":230,"stargazers_count":10,"open_issues_count":0,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-26T23:58:59.605Z","etag":null,"topics":["article-extracting","cheerio"],"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/mitica.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":"2016-07-14T04:35:34.000Z","updated_at":"2023-03-28T05:22:03.000Z","dependencies_parsed_at":"2022-09-06T00:11:42.625Z","dependency_job_id":null,"html_url":"https://github.com/mitica/ascrape-js","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/mitica/ascrape-js","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitica%2Fascrape-js","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitica%2Fascrape-js/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitica%2Fascrape-js/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitica%2Fascrape-js/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/mitica","download_url":"https://codeload.github.com/mitica/ascrape-js/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/mitica%2Fascrape-js/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266829030,"owners_count":23991222,"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","status":"online","status_checked_at":"2025-07-24T02:00:09.469Z","response_time":99,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["article-extracting","cheerio"],"created_at":"2024-11-10T00:20:50.692Z","updated_at":"2025-08-05T10:33:35.365Z","avatar_url":"https://github.com/mitica.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ascrape\n\nNodejs module for extracting web page content using Cheerio.\n\nThis module is based on [luin](https://github.com/luin/readability)'s readability project.\n\n## Install\n\n```\nnpm install ascrape\n```\n\n## Usage\n\n```\nvar scrape = require('ascrape');\n\nscrape(html [, options], callback);\n```\n\n**Where**\n\n- **html** url or html code.\n- **options** is an optional options object\n- **callback** is the callback to run - callback(error, article, meta)\n\n## Example\n\n```\nvar scrape = require('ascrape');\n\nscrape('http://howtonode.org/really-simple-file-uploads', function(err, article, meta) {\n  // Main Article\n  console.log(article.content.text());\n\n  // Title\n  console.log(article.title);\n\n  // Article HTML Source Code\n  console.log(article.content.html());\n});\n```\n\n**NB** If the page has been marked with charset other than utf-8, it will be converted automatically. Charsets such as GBK, GB2312 is also supported.\n\n## Options\n\nascrape will pass the options to request directly. See request lib to view all available options.\n\nascrape has one additional option:\n\n- **preprocess** - which should be a function to check or modify downloaded source before passing it to ascrape.\n\n```\nscrape(url, {\n  preprocess: function(source, response, contentType, callback) {\n    if (source.length \u003e maxBodySize) {\n      return callback(new Error('too big'));\n    }\n    callback(null, source);\n  }, function(err, article, response) {\n    //...\n  });\n```\n\n### Article object\n\n- **content** - The article content of the web page. Return false if failed. Is a Cheerio object.\n\n- **title** - The article title of the web page. It's may not same to the text in the `\u003ctitle\u003e` tag.\n\n- **excerpt** - The article description from any description, og:description or twitter:description `\u003cmeta\u003e`\n\n## License\n\nMIT License\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitica%2Fascrape-js","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmitica%2Fascrape-js","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmitica%2Fascrape-js/lists"}