{"id":16540621,"url":"https://github.com/itzg/restify","last_synced_at":"2025-04-12T09:28:13.212Z","repository":{"id":57558808,"uuid":"60437125","full_name":"itzg/restify","owner":"itzg","description":"Enables REST-like access to HTML pages by scraping and parsing them into JSON.","archived":false,"fork":false,"pushed_at":"2024-10-07T12:40:13.000Z","size":96,"stargazers_count":40,"open_issues_count":0,"forks_count":7,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-12T18:52:57.434Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/itzg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.txt","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},"funding":{"github":"itzg","custom":["https://www.buymeacoffee.com/itzg","https://paypal.me/itzg"]}},"created_at":"2016-06-05T01:02:26.000Z","updated_at":"2024-10-07T12:40:16.000Z","dependencies_parsed_at":"2023-10-16T21:37:52.204Z","dependency_job_id":"f2c55031-3e23-4323-825d-f13015d70a55","html_url":"https://github.com/itzg/restify","commit_stats":null,"previous_names":[],"tags_count":30,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzg%2Frestify","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzg%2Frestify/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzg%2Frestify/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itzg%2Frestify/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itzg","download_url":"https://codeload.github.com/itzg/restify/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248545588,"owners_count":21122167,"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-11T18:52:55.514Z","updated_at":"2025-04-12T09:28:13.187Z","avatar_url":"https://github.com/itzg.png","language":"Go","funding_links":["https://github.com/sponsors/itzg","https://www.buymeacoffee.com/itzg","https://paypal.me/itzg"],"categories":[],"sub_categories":[],"readme":"\nA little utility/library (written in Go) that enables REST-like access to HTML pages by scraping and parsing them into JSON.\n\n[![Test](https://github.com/itzg/restify/actions/workflows/test.yml/badge.svg)](https://github.com/itzg/restify/actions/workflows/test.yml)\n\n```\nusage: restify [\u003cflags\u003e] \u003curl\u003e\n\nFlags:\n  --help                      Show context-sensitive help (also try --help-long and --help-man).\n  --class=CLASS               If specified, first-level elements encountered with this class will be extracted.\n  --id=ID                     If specified, the element with this id will be extracted.\n  --tag=TAGNAME               If specified, the first-level element with this tag name will be extracted.\n  --attribute=ATTRIBUTE       If specified, as key=value, the element with the given attribute name set to the given value is extracted.\n  --version                   Print version and exit\n  --debug                     Enable debugging output\n  --user-agent=\"restify/1.4.0\"  user-agent header to provide with request\n\nArgs:\n  \u003curl\u003e  A URL to RESTify into JSON\n```\n\n## Output Structure\n\nWhen a successful URL retrieval and match occurs, the utility will output\nthe JSON conversion to stdout.\n\nThe top-level structure is an array of `jsonNode`, where each `jsonNode` is\nstructured as:\n\n```\n{\n  \"name\":   \"...element name...\",\n  \"class\":  \"...class attribute, if present...\",\n  \"id\":     \"...id attribute, if present...\",\n  \"href\":   \"...href attribute, if present...\",\n  \"text\":   \"...element text content, if present...\",\n  \"elements\": [\n    ...jsonNodes, if present...\n  ]\n}\n```\n\n## Examples\n\nLocate the latest Minecraft Bedrock server version by picking off the `\u003ca\u003e`'s with `data-platform` set:\n\n```bash\nrestify --attribute=data-platform https://www.minecraft.net/en-us/download/server/bedrock/\n```\n\nwhich produces:\n```json\n[\n  {\"name\":\"a\",\"attributes\":{\"data-platform\":\"serverBedrockWindows\",\"role\":\"button\"},\"class\":\"btn btn-disabled-outline mt-4 downloadlink\",\"href\":\"https://minecraft.azureedge.net/bin-win/bedrock-server-1.12.0.28.zip\",\"text\":\"Download\"},\n  {\"name\":\"a\",\"attributes\":{\"data-platform\":\"serverBedrockLinux\",\"role\":\"button\"},\"class\":\"btn btn-disabled-outline mt-4 downloadlink\",\"href\":\"https://minecraft.azureedge.net/bin-linux/bedrock-server-1.12.0.28.zip\",\"text\":\"Download\"}\n]\n```\n\nor to grab just the Linux instance:\n\n```bash\nrestify --attribute=data-platform=serverBedrockLinux https://www.minecraft.net/en-us/download/server/bedrock/\n```\n\n## Using as a library\n\nThe package `github.com/itzg/restify` provides the library functions used by the command-line utility.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitzg%2Frestify","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitzg%2Frestify","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitzg%2Frestify/lists"}