Naughtygram

Main functionality for interacting with the private Instagram API

Summary

Functions

This is for getting the user's recent notifications, which appear in the "you" tab of the "activity" section in Instagram's app and will be sent to the user as push notifications if they have them enabled

Comment on some media Takes a media id, comment text, identity, cookies and optional proxy url

Follows a user as the user asociated with passed cookie and identity. Takes a user id, identity, cookies and optional proxy url

Likes a media item as the user asociated with passed cookie and identity. Takes a media id, identity, cookies and optional proxy url

Log the user in and return a cookieset which should be sent with further requests to identify the session to IG

Unfollows a user as the user asociated with passed cookie and identity. Takes a user id, identity, cookies and optional proxy url

Unlikes a media item as the user asociated with passed cookie and identity. Takes a media id, identity, cookies and optional proxy url

Upload a picture from the filesystem Takes a photo filepath, caption text, identity, cookies and optional proxy url

Functions

activity_inbox(identity, cookies, proxy_url \\ :none)

This is for getting the user's recent notifications, which appear in the "you" tab of the "activity" section in Instagram's app and will be sent to the user as push notifications if they have them enabled.

add_comment(id, text, identity, cookies, proxy_url \\ :none)

Comment on some media Takes a media id, comment text, identity, cookies and optional proxy url

follow_user(id, identity, cookies, proxy_url \\ :none)

Follows a user as the user asociated with passed cookie and identity. Takes a user id, identity, cookies and optional proxy url

like_media(id, identity, cookies, proxy_url \\ :none)

Likes a media item as the user asociated with passed cookie and identity. Takes a media id, identity, cookies and optional proxy url

login_and_return_cookies(username, password, identity, proxy_url \\ :none)

Log the user in and return a cookieset which should be sent with further requests to identify the session to IG.

Takes a username, password, identity generated with Naughtygram.Identity.create_random and an optional proxy url.

These identities contain the user agent, device guid, etc.. So should ideally be created once per user and stored for later use.

Example

iex(1)> identity = Naughtygram.Identity.create_random
%{device_id: "android-c2c1eac1-df83-496a-aaa6-dc5f4c001aa6", guid: "c2c1eac1-df83-496a-aaa6-dc5f4c001aa6", user_agent: "Instagram 4.1.1 Android (10/2.4.4; 320; 720x1280; samsung; GT-I9100; GT-I9100; smdkc210; en_US)"}
iex(2)> Naughtygram.login_and_return_cookies("username", "password", identity, "127.0.0.1:8888")
{:ok, ...}
unfollow_user(id, identity, cookies, proxy_url \\ :none)

Unfollows a user as the user asociated with passed cookie and identity. Takes a user id, identity, cookies and optional proxy url

unlike_media(id, identity, cookies, proxy_url \\ :none)

Unlikes a media item as the user asociated with passed cookie and identity. Takes a media id, identity, cookies and optional proxy url

upload_media(photo, caption, identity, cookies, proxy_url \\ :none)

Upload a picture from the filesystem Takes a photo filepath, caption text, identity, cookies and optional proxy url