Skip to content
This repository has been archived by the owner on Sep 8, 2023. It is now read-only.

Commit

Permalink
Merge pull request #227 from Aerglonus/fixes
Browse files Browse the repository at this point in the history
changed the name of `_getProfilePage` to `_getCleanedProfileHTML`
  • Loading branch information
junhoyeo authored Jul 20, 2023
2 parents f88a75a + 561bcf7 commit 65fe721
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions threads-api/src/threads-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ export class ThreadsAPI {
...(!!username ? { referer: `https://www.threads.net/@${username}` } : undefined),
});

getProfilePage = async (url: string, username: string, options?: AxiosRequestConfig) => {
_getCleanedProfileHTML = async (url: string, username: string, options?: AxiosRequestConfig) => {
const res = await axios.get(`${url}${username}`, {
...options,
httpAgent: this.httpAgent,
Expand Down Expand Up @@ -536,7 +536,7 @@ export class ThreadsAPI {
username: string,
options?: AxiosRequestConfig,
): Promise<string | undefined> => {
const text = await this.getProfilePage('https://www.instagram.com/', username, options);
const text = await this._getCleanedProfileHTML('https://www.instagram.com/', username, options);

const userID: string | undefined = text.match(/"user_id":"(\d+)",/)?.[1];
const lsdToken: string | undefined = text.match(/"LSD",\[\],{"token":"(\w+)"},\d+\]/)?.[1];
Expand All @@ -555,7 +555,7 @@ export class ThreadsAPI {
username: string,
options?: AxiosRequestConfig,
): Promise<string | undefined> => {
const text = await this.getProfilePage('https://www.threads.net/@', username, options);
const text = await this._getCleanedProfileHTML('https://www.threads.net/@', username, options);

const userID: string | undefined = text.match(/"user_id":"(\d+)"/)?.[1];
const lsdToken: string | undefined = text.match(/"LSD",\[\],{"token":"(\w+)"},\d+\]/)?.[1];
Expand Down

0 comments on commit 65fe721

Please sign in to comment.