Skip to content

Commit

Permalink
feat: add g2.com support (#6)
Browse files Browse the repository at this point in the history
* Add G2.com support

* Review PR comment

Co-authored-by: Victor Fernandes <[email protected]>

* Commit PR suggestion

Co-authored-by: Victor Fernandes <[email protected]>

* PR suggestions

---------

Co-authored-by: Victor Fernandes <[email protected]>
  • Loading branch information
ricardofelgueiras and Victor Fernandes authored Jan 15, 2024
1 parent e98f66c commit a848146
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/background.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,20 @@ function getScrapperOptionsByUrl(url: string, title: string) {
};
}

if (url.includes('g2.com/search')) {
return {
header: 'G2 results',
listElementsQuery: '[class*="paper mb-1"]',
elementParser: [
{ title: 'Logo', query: '[class*="product-listing__img"] > img', type: 'get-attribute', attribute: 'data-deferred-image-src' },
{ title: 'Product name', query: '.product-listing__product-name > a > div', type: 'text' },
{ title: 'Total reviews', query: '.px-4th', type: 'text' },
{ title: 'Rating', query: '.link--header-color', type: 'text' },
{ title: 'Categories', query: '.product-listing__search-footer > .cell', type: 'text' },
]
};
}

if (url.includes('ycombinator.com/companies')) {
return {
header: 'YCombinator results',
Expand Down

0 comments on commit a848146

Please sign in to comment.