{"id":23962823,"url":"https://github.com/wileylabs/data-block-extract","last_synced_at":"2025-09-12T20:31:51.410Z","repository":{"id":43657188,"uuid":"153521935","full_name":"WileyLabs/data-block-extract","owner":"WileyLabs","description":"Extract content from HTML data block script elements","archived":true,"fork":false,"pushed_at":"2022-02-25T15:29:31.000Z","size":30,"stargazers_count":1,"open_issues_count":0,"forks_count":5,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-24T13:14:02.277Z","etag":null,"topics":["data-block","experiment","html","html5","json-ld"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/WileyLabs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-17T20:49:23.000Z","updated_at":"2023-08-02T19:59:01.000Z","dependencies_parsed_at":"2022-09-12T21:21:47.589Z","dependency_job_id":null,"html_url":"https://github.com/WileyLabs/data-block-extract","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/WileyLabs/data-block-extract","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WileyLabs%2Fdata-block-extract","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WileyLabs%2Fdata-block-extract/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WileyLabs%2Fdata-block-extract/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WileyLabs%2Fdata-block-extract/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/WileyLabs","download_url":"https://codeload.github.com/WileyLabs/data-block-extract/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/WileyLabs%2Fdata-block-extract/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274873241,"owners_count":25365823,"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-12T02:00:09.324Z","response_time":60,"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":["data-block","experiment","html","html5","json-ld"],"created_at":"2025-01-06T20:56:58.151Z","updated_at":"2025-09-12T20:31:51.163Z","avatar_url":"https://github.com/WileyLabs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# HTML5 data block extractor\n\nDid you know you can embed \"raw\" data into an HTML `\u003cscript\u003e` tag? The HTML5\nspec calls them [data blocks](https://www.w3.org/TR/html5/semantics-scripting.html#data-block).\n\nThey look like this...\n```html\n\u003cscript type=\"application/ld+json\"\u003e\n{\n  \"@context\": \"http://schema.org/\",\n  \"type\": \"SoftwareApplication\",\n  \"name\": \"data block extractor\",\n  \"alternateName\": \"data-block-extractor\"\n}\n\u003c/script\u003e\n```\n\nThis little command-line script takes a URL or a file, and extracts the content\nfrom any data blocks found in that file.\n\nCurrently, it just dumps them to standard out and only looks for\n`application/ld+json`, but it's a start anyway!\n\n## Install\n\nFor now, you have to `npm i -g` from inside a clone of this repository. At\nsomepoint, we'll get this up on NPM for easier re-use.\n\nHowever, once you've done that, you can run `data-block-extractor` anywhere to\nuse this awesomeness!\n\n## Usage\n\n```sh\n$ data-block-extract http://bestbuy.com/\n```\n\nThree results are (currently) found at [BestBuy](http://bestbuy.com/), which\nlooks like this in the output:\n```\n{\"@context\" : \"http://schema.org\",\"@type\" : \"WebSite\",\"name\" : \"Best Buy\",\"url\" : \"http://www.bestbuy.com/\"}\n\n{\"@context\": \"http://schema.org\",\"@type\": \"Organization\",\"name\": \"Best Buy\",\"url\": \"http://www.bestbuy.com/\",\"sameAs\": [\"http://www.facebook.com/bestbuy\",\"https://twitter.com/BestBuy\",\"https://plus.google.com/+BestBuy\",\"https://www.instagram.com/bestbuy/\",\"https://www.youtube.com/user/bestbuy\",\"https://www.linkedin.com/company/best-buy\",\"https://pinterest.com/BestBuy\"],\"contactPoint\": [{\"@type\": \"ContactPoint\",\"telephone\": \"+1-888-237-8289\",\"contactType\": \"customer service\",\"contactOption\": \"TollFree\",\"availableLanguage\": [\"English\",\"Spanish\"]}, {\"@type\": \"ContactPoint\",\"telephone\": \"+1-888-574-1301\",\"contactType\": \"credit card support\",\"contactOption\": \"TollFree\",\"availableLanguage\": [\"English\",\"Spanish\"]}]}\n\n{\"@context\":\"http://schema.org\",\"@type\":\"BreadcrumbList\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"item\":{\"@id\":\"https://www-ssl.bestbuy.com/\",\"name\":\"Best Buy\"}}]}\n```\n\nAt the moment there is no additional parsing, but that's coming!\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwileylabs%2Fdata-block-extract","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwileylabs%2Fdata-block-extract","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwileylabs%2Fdata-block-extract/lists"}