Repository reading code
We need to write code to read the repository specified in the configuration.
I would suggest creating a Grok class in the App\Library namespace, (probably use the one we used to be using, if it can be found) and a new Scanner class (also in the App\Library namespace). We can then add our scanner functionality and parsing code into the Scanner class. This can be extended into further classes if necessary.
RegEx for items:
/\[.+?\]\(.+?\) (`⚠` )?- .{1,249}\. ((\(\[(Source Code|Demo|Example)\]\([^,\[\]\(\)]+?\)\)|\(\[(Demo|Example)\]\([^,\[\]\(\)]+?\), \[(Example|Source Code)\]\([^,\[\]\(\)]+?\)\)|\(\[Demo\]\([^,\[\]\(\)]+?\), \[Example\]\([^,\[\]\(\)]+?\), \[Source Code\]\([^,\[\]\(\)]+?\)\)) )?`.+?` `.+?`/
Wow, that is fairly complex regex!
Grok:
\[%{DATA:name}\]\(%{URI:url}\) (?<proprietary>(`⚠` )?)- (?<description>.{1,249}\.) ((\(\[(?<link1_title>(Source Code|Demo|Example))\]\((?<link1_url>[^,\[\]\(\)]+?)\)\)|\(\[(?<link2_title1>(Demo|Example))\]\((?<link2_url1>[^,\[\]\(\)]+?)\), \[(?<link2_title2>(Example|Source Code))\]\((?<link2_url2>[^,\[\]\(\)]+?)\)\)|\(\[(?<link3_title1>Demo)\]\((?<link3_url1>[^,\[\]\(\)]+?)\), \[(?<link3_title2>Example)\]\((?<link3_url2>[^,\[\]\(\)]+?)\), \[(?<link3_title3>Source Code)\]\((?<link3_url3>[^,\[\]\(\)]+?)\)\)) )?`%{DATA:license}` `%{DATA:language}`
@arylatt @Kickball We should first get the content from github... See #51
https://github.com/arylatt/awesome-selfhosted-com/blob/master/app/Http/Controllers/FrontendController.php#L25 Is a bad idea. Github tells us to use his API instead of directly querying the server...
Repo is kinda stale and has old code in it. Not sure if we're even following this through anymore now we have Travis. Need to discuss with @Kickball at a later stage. Even if we are pursuing it not sure if it's really worth switching to the API when it would be more work to rewrite code and more deps. The file won't be pulled often enough to make any sort of impact anyway. ¯\_(ツ)_/¯