File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2525
2626 - name : Fetch citation counts
2727 env :
28- SCHOLARLY_USE_PROXY : " scraperapi"
29- SCRAPERAPI_KEY : ${{ secrets.SCRAPERAPI_KEY }}
28+ SCRAPINGBEE_API_KEY : ${{ secrets.SCRAPINGBEE_API_KEY }}
3029 run : python fetch_citations.py
3130
3231 - name : Commit and push citations.json
Original file line number Diff line number Diff line change @@ -34,18 +34,20 @@ def get_title_from_doi(doi: str) -> str | None:
3434
3535pg = ProxyGenerator ()
3636
37- proxy_key = os .getenv ("SCRAPERAPI_KEY" )
37+ SCRAPINGBEE_API_KEY = os .getenv ("SCRAPINGBEE_API_KEY" )
38+
3839proxy_enabled = False
3940
40- if proxy_key :
41+ if SCRAPINGBEE_API_KEY :
4142 try :
42- proxy_enabled = pg .ScraperAPI (proxy_key )
43+ proxy_enabled = pg .SingleProxy (
44+ http = f"http://{ SCRAPINGBEE_API_KEY } :@proxy.scrapingbee.com:8886" ,
45+ https = f"http://{ SCRAPINGBEE_API_KEY } :@proxy.scrapingbee.com:8886" ,
46+ )
4347
4448 if proxy_enabled :
4549 scholarly .use_proxy (pg )
46- print ("ScraperAPI proxy enabled" )
47- else :
48- print ("Failed to enable ScraperAPI proxy" )
50+ print ("ScrapingBee proxy enabled" )
4951
5052 except Exception as exc :
5153 print (f"Proxy setup failed: { exc } " )
You can’t perform that action at this time.
0 commit comments