{"id":31213782,"url":"https://github.com/celrenheit/spider","last_synced_at":"2025-09-21T08:46:58.367Z","repository":{"id":57595665,"uuid":"43955371","full_name":"celrenheit/spider","owner":"celrenheit","description":"Scheduler of spiders for scraping and parsing HTML and JSON pages","archived":false,"fork":false,"pushed_at":"2017-12-27T22:45:08.000Z","size":31,"stargazers_count":174,"open_issues_count":0,"forks_count":5,"subscribers_count":12,"default_branch":"master","last_synced_at":"2025-02-28T00:59:54.177Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/celrenheit.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-10-09T12:56:12.000Z","updated_at":"2024-11-21T21:06:01.000Z","dependencies_parsed_at":"2022-09-26T19:53:06.747Z","dependency_job_id":null,"html_url":"https://github.com/celrenheit/spider","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/celrenheit/spider","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celrenheit%2Fspider","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celrenheit%2Fspider/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celrenheit%2Fspider/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celrenheit%2Fspider/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/celrenheit","download_url":"https://codeload.github.com/celrenheit/spider/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/celrenheit%2Fspider/sbom","scorecard":{"id":270637,"data":{"date":"2025-08-11","repo":{"name":"github.com/celrenheit/spider","commit":"d09055b1dc9beef4ecf5c52cc45a369e7a1804a9"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3,"checks":[{"name":"Code-Review","score":0,"reason":"Found 1/27 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 3 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}}]},"last_synced_at":"2025-08-17T13:15:27.978Z","repository_id":57595665,"created_at":"2025-08-17T13:15:27.979Z","updated_at":"2025-08-17T13:15:27.979Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":276216318,"owners_count":25604726,"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-09-21T02:00:07.055Z","response_time":72,"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":"2025-09-21T08:46:56.500Z","updated_at":"2025-09-21T08:46:58.359Z","avatar_url":"https://github.com/celrenheit.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Spider [![Build Status](https://travis-ci.org/celrenheit/spider.svg?branch=master)](https://travis-ci.org/celrenheit/spider) [![GoDoc](https://godoc.org/github.com/celrenheit/spider?status.svg)](https://godoc.org/github.com/celrenheit/spider) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\nThis package provides a simple way, yet extensible, to scrape HTML and JSON pages. It uses spiders around the web scheduled at certain configurable intervals to fetch data.\nIt is written in [Golang](https://golang.org/) and is [MIT licensed](https://github.com/celrenheit/spider#license).\n\nYou can see an example app using this package here: [https://github.com/celrenheit/trending-machine](https://github.com/celrenheit/trending-machine)\n\n# Installation\n\n```shell\n$ go get -u github.com/celrenheit/spider\n```\n\n# Usage\n\n```go\npackage main\n\nimport (\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/celrenheit/spider\"\n\t\"github.com/celrenheit/spider/schedule\"\n)\n\n// LionelMessiSpider scrape wikipedia's page for LionelMessi\n// It is defined below in the init function\nvar LionelMessiSpider spider.Spider\n\nfunc main() {\n\t// Create a new scheduler\n\tscheduler := spider.NewScheduler()\n\n\t// Register the spider to be scheduled every 15 seconds\n\tscheduler.Add(schedule.Every(15*time.Second), LionelMessiSpider)\n\t// Alternatively, you can choose a cron schedule\n\t// This will run every minute of every day\n\tscheduler.Add(schedule.Cron(\"* * * * *\"), LionelMessiSpider)\n\n\t// Start the scheduler\n\tscheduler.Start()\n\n\t// Exit 5 seconds later to let time for the request to be done.\n\t// Depends on your internet connection\n\t\u003c-time.After(65 * time.Second)\n}\n\nfunc init() {\n\tLionelMessiSpider = spider.Get(\"https://en.wikipedia.org/wiki/Lionel_Messi\", func(ctx *spider.Context) error {\n\t\tfmt.Println(time.Now())\n\t\t// Execute the request\n\t\tif _, err := ctx.DoRequest(); err != nil {\n\t\t\treturn err\n\t\t}\n\n\t\t// Get goquery's html parser\n\t\thtmlparser, err := ctx.HTMLParser()\n\t\tif err != nil {\n\t\t\treturn err\n\t\t}\n\t\t// Get the first paragraph of the wikipedia page\n\t\tsummary := htmlparser.Find(\"#mw-content-text \u003e p\").First().Text()\n\n\t\tfmt.Println(summary)\n\t\treturn nil\n\t})\n}\n```\n\n\nIn order, to create your own spiders you have to implement the [spider.Spider](https://godoc.org/github.com/celrenheit/spider#Spider) interface.\nIt has two functions, Setup and Spin.\n\n[Setup](https://godoc.org/github.com/celrenheit/spider#Spider) gets a [Context](https://godoc.org/github.com/celrenheit/spider#Context) and returns a new [Context](https://godoc.org/github.com/celrenheit/spider#Context) with an [error](https://godoc.org/builtin#error) if something wrong happened.\nUsually, it is in this function that you create a new [http client](https://golang.org/pkg/net/http/#Client) and [http request](https://golang.org/pkg/net/http/#Request).\n\n[Spin](https://godoc.org/github.com/celrenheit/spider#Spider) gets a [Context](https://godoc.org/github.com/celrenheit/spider#Context) do its work and returns an [error](https://godoc.org/builtin#error) if necessarry. It is in this function that you do your work ([do a request](https://godoc.org/github.com/celrenheit/spider#Context.DoRequest), handle response, parse [HTML](https://godoc.org/github.com/celrenheit/spider#Context.HTMLParser) or [JSON](https://godoc.org/github.com/celrenheit/spider#Context.JSONParser), etc...). It should return an error if something didn't happened correctly.\n\n\n# Documentation\n\nThe documentation is hosted on [GoDoc](https://godoc.org/github.com/celrenheit/spider).\n\n\n# Examples\n\n```shell\n$ cd $GOPATH/src/github.com/celrenheit/spider/examples\n$ go run wiki.go\n```\n\n# Contributing\n\nContributions are welcome ! Feel free to submit a pull request.\nYou can improve documentation and examples to start.\nYou can also provides spiders and better schedulers.\n\nIf you have developed your own spiders or schedulers, I will be pleased to review your code and eventually merge it into the project.\n\n# License\n\n[MIT License](https://github.com/celrenheit/spider/blob/master/LICENSE)\n\n# Inspiration\n\n[Dkron](https://github.com/victorcoder/dkron) for the new in memory scheduler (as of 0.3)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcelrenheit%2Fspider","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcelrenheit%2Fspider","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcelrenheit%2Fspider/lists"}