{"id":19851326,"url":"https://github.com/spekulatius/phpscraper-keyword-length-distribution-example","last_synced_at":"2025-10-18T11:13:48.224Z","repository":{"id":59741278,"uuid":"296482423","full_name":"spekulatius/phpscraper-keyword-length-distribution-example","owner":"spekulatius","description":"Example to demonstration the parsing of keywords as well as the simple analysis of the data to get a length distribution","archived":false,"fork":false,"pushed_at":"2023-05-28T10:44:06.000Z","size":122,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-06-10T19:06:49.236Z","etag":null,"topics":["example-project","keyword-extraction","keyword-scraper","keyword-search","php","php-scraper","phpscraper-example","scraper","web-scraping"],"latest_commit_sha":null,"homepage":"https://phpscraper.de/examples/extract-keywords.html","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/spekulatius.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE.md","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":"spekulatius","custom":"https://www.buymeacoffee.com/spekulatius"}},"created_at":"2020-09-18T01:31:13.000Z","updated_at":"2025-01-03T04:29:17.000Z","dependencies_parsed_at":"2025-02-28T20:50:17.619Z","dependency_job_id":"856644a1-1480-463a-bd61-1bb00089425a","html_url":"https://github.com/spekulatius/phpscraper-keyword-length-distribution-example","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/spekulatius/phpscraper-keyword-length-distribution-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spekulatius%2Fphpscraper-keyword-length-distribution-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spekulatius%2Fphpscraper-keyword-length-distribution-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spekulatius%2Fphpscraper-keyword-length-distribution-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spekulatius%2Fphpscraper-keyword-length-distribution-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spekulatius","download_url":"https://codeload.github.com/spekulatius/phpscraper-keyword-length-distribution-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spekulatius%2Fphpscraper-keyword-length-distribution-example/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264149293,"owners_count":23564436,"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":["example-project","keyword-extraction","keyword-scraper","keyword-search","php","php-scraper","phpscraper-example","scraper","web-scraping"],"created_at":"2024-11-12T13:29:23.213Z","updated_at":"2025-10-18T11:13:43.206Z","avatar_url":"https://github.com/spekulatius.png","language":"PHP","funding_links":["https://github.com/sponsors/spekulatius","https://www.buymeacoffee.com/spekulatius"],"categories":[],"sub_categories":[],"readme":"# Keyword Length Distribution Example using [PHPScraper](https://phpscraper.de)\n\n[PHPScraper](https://github.com/spekulatius/PHPScraper) is a scraping library aimed at making web-scraping easier. It simplifies the coding effort involved by reducing verbosity.\n\nThis is an example of the library scraping keywords from the [Wikipedia article \"Online Advertising\"](https://en.wikipedia.org/wiki/Online_advertising). After the keyword extraction, the data is processed to analyze the distribution of keyword length. The expected output can be found below.\n\nWithin PHPScraper, the library [RAKE PHP Plus](https://github.com/Donatello-za/rake-php-plus) is used. RAKE stands for \"Rapid Automatic Keyword Extraction\" algorithm.\n\nYou can also check the [PHPScraper keyword extraction example](https://github.com/spekulatius/phpscraper-keyword-scraping-example) and [Keyword Merge Package](https://github.com/spekulatius/keyword-merge).\n\n\n## Installation\n\nThis example has been built on PHP 7.2.24 run on an Ubuntu-based Linux distro.\n\nTo run this example you will need to clone the repository and install the dependencies:\n\n```bash\ngit clone git@github.com:spekulatius/phpscraper-keyword-scraping-example.git\ncomposer install\n```\n\nIf you would like to make changes you will need to fork the repository.\n\n## Execution\n\n```bash\n$ php keyword-length-distribution.php\n```\n\n\n## Result\n\nAs graphic:\n\n[![Keyword Length Distribution for \"Online Marketing\"](/images/chart.png)](https://quickchart.io/sandbox/#{%22type%22:%22line%22,%22data%22:{%22labels%22:[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,51,52,53,54,55,56,57,59,61,66,67,70,71,76,77,81,84,85,93,97,99,106,107,110,120,121,123,142,148,156,159,166,169,174,191,193,195,201,205,229,252,269,280,288,308,332,392,408,473,506,1422,2184],%22datasets%22:[{%22fill%22:false,%22backgroundColor%22:%22rgb(54,%20162,%20235)%22,%22borderColor%22:%22rgb(54,%20162,%20235)%22,%22data%22:[7,5,46,95,80,84,129,137,117,103,91,71,76,58,82,71,72,76,51,57,40,33,45,34,21,29,29,17,22,17,17,11,11,10,11,8,7,10,10,3,5,4,5,4,5,2,3,2,2,3,3,3,1,2,3,2,1,1,1,1,1,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1],%22pointRadius%22:0}]},%22options%22:{%22title%22:{%22display%22:false},%22legend%22:{%22display%22:false}}})\n\nAs text:\n\n```\nThis page contains around 1989 keywords/phrases.\nBelow are some selected keyword extractions.\n\nLength Distribution of Keywords:\n\nArray\n(\n    [1] =\u003e 7\n    [2] =\u003e 5\n    [3] =\u003e 46\n    [4] =\u003e 95\n    [5] =\u003e 80\n    [6] =\u003e 84\n    [7] =\u003e 129\n    [8] =\u003e 137\n    [9] =\u003e 117\n    [10] =\u003e 103\n    [11] =\u003e 91\n    [12] =\u003e 71\n    [13] =\u003e 76\n    [14] =\u003e 58\n    [15] =\u003e 82\n    [16] =\u003e 71\n    [17] =\u003e 72\n    [18] =\u003e 76\n    [19] =\u003e 51\n    [20] =\u003e 57\n    [21] =\u003e 40\n    [22] =\u003e 33\n    [23] =\u003e 45\n    [24] =\u003e 34\n    [25] =\u003e 21\n    [26] =\u003e 29\n    [27] =\u003e 29\n    [28] =\u003e 17\n    [29] =\u003e 22\n    [30] =\u003e 17\n    [31] =\u003e 17\n    [32] =\u003e 11\n    [33] =\u003e 11\n    [34] =\u003e 10\n    [35] =\u003e 11\n    [36] =\u003e 8\n    [37] =\u003e 7\n    [38] =\u003e 10\n    [39] =\u003e 10\n    [40] =\u003e 3\n    [41] =\u003e 5\n    [42] =\u003e 4\n    [43] =\u003e 5\n    [44] =\u003e 4\n    [45] =\u003e 5\n    [46] =\u003e 2\n    [47] =\u003e 3\n    [48] =\u003e 2\n    [49] =\u003e 2\n    [51] =\u003e 3\n    [52] =\u003e 3\n    [53] =\u003e 3\n    [54] =\u003e 1\n    [55] =\u003e 2\n    [56] =\u003e 3\n    [57] =\u003e 2\n    [59] =\u003e 1\n    [61] =\u003e 1\n    [66] =\u003e 1\n    [67] =\u003e 1\n    [70] =\u003e 1\n    [71] =\u003e 1\n    [76] =\u003e 2\n    [77] =\u003e 1\n    [81] =\u003e 2\n    [84] =\u003e 1\n    [85] =\u003e 1\n    [93] =\u003e 1\n    [97] =\u003e 1\n    [99] =\u003e 1\n    [106] =\u003e 1\n    [107] =\u003e 1\n    [110] =\u003e 1\n    [120] =\u003e 1\n    [121] =\u003e 1\n    [123] =\u003e 1\n    [142] =\u003e 1\n    [148] =\u003e 1\n    [156] =\u003e 1\n    [159] =\u003e 1\n    [166] =\u003e 1\n    [169] =\u003e 1\n    [174] =\u003e 1\n    [191] =\u003e 1\n    [193] =\u003e 1\n    [195] =\u003e 1\n    [201] =\u003e 1\n    [205] =\u003e 1\n    [229] =\u003e 1\n    [252] =\u003e 1\n    [269] =\u003e 1\n    [280] =\u003e 1\n    [288] =\u003e 1\n    [308] =\u003e 1\n    [332] =\u003e 1\n    [392] =\u003e 1\n    [408] =\u003e 1\n    [473] =\u003e 1\n    [506] =\u003e 1\n    [1422] =\u003e 1\n    [2184] =\u003e 1\n)\n\n1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,34,35,36,37,38,39,40,41,42,43,44,45,46,47,48,49,51,52,53,54,55,56,57,59,61,66,67,70,71,76,77,81,84,85,93,97,99,106,107,110,120,121,123,142,148,156,159,166,169,174,191,193,195,201,205,229,252,269,280,288,308,332,392,408,473,506,1422,2184\n\n7,5,46,95,80,84,129,137,117,103,91,71,76,58,82,71,72,76,51,57,40,33,45,34,21,29,29,17,22,17,17,11,11,10,11,8,7,10,10,3,5,4,5,4,5,2,3,2,2,3,3,3,1,2,3,2,1,1,1,1,1,1,2,1,2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1\n```\n\n*Please note: These results might have changed by now.*\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspekulatius%2Fphpscraper-keyword-length-distribution-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspekulatius%2Fphpscraper-keyword-length-distribution-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspekulatius%2Fphpscraper-keyword-length-distribution-example/lists"}