Skip to content

Commit

Permalink
Improve instagram client defaults
Browse files Browse the repository at this point in the history
The default values and documentation of the instagram
client have been improved.
  • Loading branch information
schettn committed Sep 6, 2020
1 parent cee2d68 commit d81b62c
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,27 +124,24 @@ class InstagramClient extends Client {
*
* @constructor
* @author Nico Schett <[email protected]>
* @param url The base URL the GithubClient should be working on.
* Default: "https://api.github.com/graphql".
* @param url The base URL the InstagramClient should be working on.
* Default: "https://graph.instagram.com"
* @param headers A object containing various request headers
* @param type A type description to differ between multiple instances
*/
constructor(
url: string = "https://api.github.com/graphql",
headers: { accessToken: string },
accessToken: string,
url: string = "https://graph.instagram.com",
headers: {} = {},
type: string = "scraper"
) {
super({ type, url, headers });

this.ep = new Scraper("https://graph.instagram.com", {
headers: { Authorization: `Bearer ${headers.accessToken}` },
this.ep = new Scraper(url, {
headers: { Authorization: `Bearer ${accessToken}` },
});

this.session = new InstagramSession(
"instagram",
headers.accessToken,
this.ep
);
this.session = new InstagramSession("instagram", accessToken, this.ep);
}
}

Expand Down

0 comments on commit d81b62c

Please sign in to comment.