No unreleased changes.
- Migrate from
axios
tonode-fetch
- Allow Youtube URL without
www.
- youtube: support url format:
https://www.youtube.com/channel/<channel_id>
- export twitter functions
Breaking:
-
instagram: exposing original axios error, you can check if the error is an axios error by:
import { isAxiosError } from "follower-count" try { await getFollowerCount() } catch (error) { if (isAxiosError(error)) { console.log(error.response.status) } }
Breaking:
-
instagram: handle user not found error, new api:
// Prev: getFollowerCount({ type: "instagram", username: "cristiano", auth: { username, password, }, }) // Now: getFollowerCount({ type: "instagram", username: "cristiano", sessionId: getIgSessionId(username, password), })
- twitter: Now you don't need headless chrome to fetch the follower count, it uses the twitter follow button api if a
browserContext
is not provided.
- fix: properly get youtube channel id
- Ensure the follower count of
youtube
is an integer
-
twitter: allow to pass a playwright browser context instead of chromium executable path.
// before: await getFollowerCount({ type: "twitter", username: "cristiano", chromiumPath: "/path/to/chromium", }) // after: import { getBrowserContext, destroyBrowser } from "follower-count" await getFollowerCount({ type: "twitter", username: "cristiano", browserContext: getBrowserContext({ chromiumPath: "/path/to/chromium" }), }) await destroyBrowser()
- twitter: Allow to pass a custom path to Chromium executable, by default it looks for the Chrome/Chromium executable on your system, but if you're using this on AWS lambda or Google Cloud Functions, you can use this with
chrome-aws-lambda
.
- Accept a URL as youtube channel:
getFollowerCount({ type: "youtube", channel: "https://www.youtube.com/c/CHANNEL_ID", })
- fix(twitter): disable Chrome sandbox by default.
- fix(twitter): wait for selector to appear.
- update readme
- tweaks
- tweaks
- Initial commit