{"id":15480153,"url":"https://github.com/andycall/page-hook-generator","last_synced_at":"2026-06-25T01:32:01.966Z","repository":{"id":69962062,"uuid":"75705939","full_name":"andycall/page-hook-generator","owner":"andycall","description":"auto get page selector of page title, content and publishTime","archived":false,"fork":false,"pushed_at":"2017-04-01T05:46:38.000Z","size":2000,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-31T08:49:15.641Z","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/andycall.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-12-06T07:25:45.000Z","updated_at":"2016-12-06T07:53:40.000Z","dependencies_parsed_at":"2023-02-23T15:01:12.739Z","dependency_job_id":null,"html_url":"https://github.com/andycall/page-hook-generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/andycall/page-hook-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andycall%2Fpage-hook-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andycall%2Fpage-hook-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andycall%2Fpage-hook-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andycall%2Fpage-hook-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/andycall","download_url":"https://codeload.github.com/andycall/page-hook-generator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/andycall%2Fpage-hook-generator/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34756205,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-24T02:00:07.484Z","response_time":106,"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":[],"created_at":"2024-10-02T04:41:00.635Z","updated_at":"2026-06-25T01:32:01.926Z","avatar_url":"https://github.com/andycall.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# page-hook-generator\n通用解析算法，可识别任意新闻站点的页面结构，识别出标题和内容区域块\n\n## How it work\n此插件仅支持分析新闻类网站。\n\n新闻类网站的生成通常都是通过后台的富文本编辑器生成\n但是不同的富文本编辑器之间都有一个相同的特性 ---- 生成的HTML结构平整，嵌套结构层级简单，同时一个新闻最重要的是： 文字多。\n\n## try by yourself\n\n[page-hook-generator-plugin](./demo/page-hook-generator.crx) \n\n去百度feed上随便找个新闻 https://www.baidu.com/\n\n点下这个按钮 ![button](./demo/icon.png)\n\n然后就能得到结果：\n![screenshot](./demo/screenshot.png)\n\n# How to test\n```bash\nnpm run test\n```\n\n# How to install\n```\nnpm install page-hook-generator\n```\n\n# How to use\n```javascript\nvar generator = require('page-hook-generator');\nvar request = require('request');\n\nrequest({\n\turl: 'http://tech.hexun.com/2016-12-06/187208491.html',\n\tmethod: 'GET'\n}, function(err, response, str) {\n    if (!err \u0026\u0026 response.statusCode === 200) {\n        let info = generator(str);\n        \n        console.log('the title selector is', info.title);\n        console.log('the content selector is', info.content);\n        console.log('the page created time is', info.date);\n    }\n})\n\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandycall%2Fpage-hook-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fandycall%2Fpage-hook-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fandycall%2Fpage-hook-generator/lists"}