awesome-selfhosted-com icon indicating copy to clipboard operation
awesome-selfhosted-com copied to clipboard

Repository reading code

Open arylatt opened this issue 9 years ago • 5 comments

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.

arylatt avatar Aug 03 '16 06:08 arylatt

RegEx for items:

/\[.+?\]\(.+?\) (`⚠` )?- .{1,249}\. ((\(\[(Source Code|Demo|Example)\]\([^,\[\]\(\)]+?\)\)|\(\[(Demo|Example)\]\([^,\[\]\(\)]+?\), \[(Example|Source Code)\]\([^,\[\]\(\)]+?\)\)|\(\[Demo\]\([^,\[\]\(\)]+?\), \[Example\]\([^,\[\]\(\)]+?\), \[Source Code\]\([^,\[\]\(\)]+?\)\)) )?`.+?` `.+?`/

arylatt avatar Aug 19 '16 11:08 arylatt

Wow, that is fairly complex regex!

Kickball avatar Aug 19 '16 12:08 Kickball

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 avatar Aug 20 '16 12:08 arylatt

@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...

m1guelpf avatar Jan 24 '17 20:01 m1guelpf

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. ¯\_(ツ)_/¯

arylatt avatar Jan 25 '17 00:01 arylatt