Skip to content

Commit

Permalink
chore: NIP
Browse files Browse the repository at this point in the history
  • Loading branch information
surmon-china committed Mar 17, 2024
1 parent 232d377 commit 54d598f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/server/getters/twitter/sotwe-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -96,10 +96,10 @@ export interface SotweAggregate {
const fetchSotweAggregate = async (twitterUsername: string): Promise<SotweAggregate> => {
try {
const target = `https://api.sotwe.com/v3/user/${twitterUsername}`
// const _scrape_do = `http://api.scrape.do/?token=${SOTWE_SCRAPER_TOKEN}&url=${target}`
const _scraper_api = `https://api.scraperapi.com/?api_key=${SOTWE_SCRAPER_TOKEN}&url=${target}`
// const scraper = `http://api.scrape.do/?token=${SOTWE_SCRAPER_TOKEN}&url=${target}`
const scraper = `https://api.scraperapi.com/?api_key=${SOTWE_SCRAPER_TOKEN}&url=${target}`
// To avoid wasting request credits, tokens are not used in development environments
const response = await axios.get<SotweAggregate>(isNodeDev ? target : _scraper_api, { timeout: 28000 })
const response = await axios.get<SotweAggregate>(isNodeDev ? target : scraper, { timeout: 28000 })
return response.data
} catch (error: unknown) {
throw isAxiosError(error) ? error.toJSON() : error
Expand Down

0 comments on commit 54d598f

Please sign in to comment.