Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed Jul 18, 2018
1 parent 3241815 commit 011a1ad
Showing 1 changed file with 111 additions and 1 deletion.
112 changes: 111 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,117 @@ await instagram.close()

## API

TODO
<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

#### Table of Contents

- [PuppeteerInstagram](#puppeteerinstagram)
- [isAuthenticated](#isauthenticated)
- [user](#user)
- [browser](#browser)
- [signup](#signup)
- [signin](#signin)
- [signout](#signout)
- [verifyEmail](#verifyemail)
- [close](#close)

### [PuppeteerInstagram](https://github.com/transitive-bullshit/puppeteer-instagram/blob/3241815ee3d5ae673c485c829d04fba4f349ac12/index.js#L21-L175)

[Instagram](https://instagram.com) automation driven by headless chrome.

Type: `function (opts)`

- `opts` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options (optional, default `{}`)
- `opts.browser` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Puppeteer browser instance to use
- `opts.puppeteer` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)?** Puppeteer [launch options](https://github.com/GoogleChrome/puppeteer/blob/master/docs/api.md#puppeteerlaunchoptions)

* * *

#### [isAuthenticated](https://github.com/transitive-bullshit/puppeteer-instagram/blob/3241815ee3d5ae673c485c829d04fba4f349ac12/index.js#L32-L32)

Whether or not this instance is authenticated with Instagram.

Type: [boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)

* * *

#### [user](https://github.com/transitive-bullshit/puppeteer-instagram/blob/3241815ee3d5ae673c485c829d04fba4f349ac12/index.js#L39-L39)

Authenticated user if authenticated with Instagram.

Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)

* * *

#### [browser](https://github.com/transitive-bullshit/puppeteer-instagram/blob/3241815ee3d5ae673c485c829d04fba4f349ac12/index.js#L46-L52)

Puppeteer Browser instance to use.

Type: `function ()`

* * *

#### [signup](https://github.com/transitive-bullshit/puppeteer-instagram/blob/3241815ee3d5ae673c485c829d04fba4f349ac12/index.js#L68-L100)

Automates the creation of a new Instagram account.

Type: `function (user, opts): Promise`

- `user` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** User details for new account
- `user.email` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Email
- `user.username` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Username
- `user.firstName` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** First name
- `user.lastName` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Last name
- `user.password` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Password
- `opts` **[object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options (optional, default `{}`)
- `opts.verify` **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)?** Whether or not to verify email
- `opts.emailPassword` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Email password for verification

* * *

#### [signin](https://github.com/transitive-bullshit/puppeteer-instagram/blob/3241815ee3d5ae673c485c829d04fba4f349ac12/index.js#L114-L130)

Signs into an existing Instagram account.

Note: either username or email is required.

Type: `function (user, opts): Promise`

- `user` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** User details for new account
- `user.username` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Username
- `user.email` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Email
- `user.password` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Password
- `opts` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options (optional, default `{}`)

* * *

#### [signout](https://github.com/transitive-bullshit/puppeteer-instagram/blob/3241815ee3d5ae673c485c829d04fba4f349ac12/index.js#L136-L142)

Signs out of the currently authenticated Instagram account.

Type: `function (): Promise`

* * *

#### [verifyEmail](https://github.com/transitive-bullshit/puppeteer-instagram/blob/3241815ee3d5ae673c485c829d04fba4f349ac12/index.js#L152-L161)

Verifies the authenticated Instagram account's email via `puppeteer-email`.

Type: `function (opts): Promise`

- `opts` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** Options
- `opts.emailPassword` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** Email password for verification
- `opts.email` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** Email verification (defaults to user's GitHub email)

* * *

#### [close](https://github.com/transitive-bullshit/puppeteer-instagram/blob/3241815ee3d5ae673c485c829d04fba4f349ac12/index.js#L168-L174)

Closes the underlying browser instance, effectively ending this session.

Type: `function (): Promise`

* * *

## Related

Expand Down

0 comments on commit 011a1ad

Please sign in to comment.