Skip to content

Commit

Permalink
#118 bugfix - improved pages parsing
Browse files Browse the repository at this point in the history
  • Loading branch information
kas-elvirov committed May 15, 2021
1 parent abafa1b commit e50c2f1
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
APP_VERSION=8.2.47
APP_VERSION=8.2.48
PAYPAL_URL=https://www.paypal.me/ArtemSolovev
OPENCOLLECTIVE_URL=https://opencollective.com/artem-solovev
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ ___

## History
### Version:
- current: 8.2.47 ( 2021, 16 february )
- current: 8.2.48 ( 2021, 15 april )
- initial: 2.0.1 ( 2017, 12 february )

I made this program in the Russian Army while I was on duty. I was coding as fast as i could )))
Expand Down
2 changes: 1 addition & 1 deletion manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"short_name": "__MSG_shortName__",
"author": "__MSG_author__",
"description": "__MSG_description__",
"version": "8.2.47",
"version": "8.2.48",
"browser_action": {
"default_icon": "img/icon128.png",
"default_popup": "index.html",
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
{
"name": "gloc",
"version": "8.2.47",
"description": "Extension counts the number of lines of code in GitHub pages.",
"author": "Artem Solovev",
"version": "8.2.48",
"description": "Browser extension - counts locs on GitHub pages",
"authors": [
"Artem Vadimovich Solovev <[email protected]> (https://github.com/artem-solovev)"
],
"license": "GPL-2.0",
"bugs": {
"url": "https://github.com/artem-solovev/gloc/issues"
Expand Down
4 changes: 2 additions & 2 deletions src/configs/parametersToMap.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,15 @@ export const parametersToMap: ParameterToMap[] = [
*/
locationName: LOCATION.USER,
selector: 'querySelectorAll',
pathToSelect: '.js-pinned-items-reorder-container ol li a.text-bold.flex-auto.min-width-0',
pathToSelect: 'ol li div div div a',
pathToInsert: '.wb-break-all',
existenceChecker: (entity: HTMLAnchorElement[]) => entity && entity.length > 0,
wrapper: (entity) => Array.prototype.slice.call(entity),
},
{
locationName: LOCATION.ORGANIZATION,
selector: 'querySelectorAll',
pathToSelect: '.repo-list h3 a',
pathToSelect: '#org-repositories div ul div.flex-auto > h3 > a',
existenceChecker: (entity: HTMLAnchorElement[]) => entity && entity.length > 0,
wrapper: (entity) => Array.prototype.slice.call(entity),
},
Expand Down
2 changes: 2 additions & 0 deletions src/utils/scrapData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ export const scrapData = (parameters: ParameterToMap[]): InitialData | void => {
const entityToInsert = document[selector](pathToInsert);

if ((existenceChecker as ExistenceChecker)(entity)) {
console.log('scrapData.locationName', locationName);
console.log('scrapData.links', (wrapper as Wrapper)(entity));
return {
location: locationName,
links: (wrapper as Wrapper)(entity) as HTMLAnchorElement[],
Expand Down

0 comments on commit e50c2f1

Please sign in to comment.