Home

Awesome

Nick Bot

Adding some much needed nick to your Instagram photos.

Dependencies

$ sudo apt install libopencv-dev

Build

$ git clone https://github.com/icholy/nick_bot.git
$ cd nick_bot
$ go get -d -v .
$ go build

Usage

Usage of ./nick_bot:
  -auto.follow
    	auto follow random people
  -draw.face
    	Draw the face (default true)
  -draw.rects
    	Show the detection rectangles
  -face.dir string
    	directory to load faces from (default "faces")
  -face.opacity float
    	Face opacity [0-255] (default 1)
  -haar string
    	The location of the Haar Cascade XML configuration to be provided to OpenCV. (default "haarcascade_frontalface_alt.xml")
  -http.port string
    	http port (example :8080)
  -margin float
    	The face rectangle margin (default 60)
  -min.neighboor int
    	the lower this number is, the more faces will be found (default 9)
  -min.faces int
    	minimum faces (default 1)
  -password string
    	instagram password
  -post.interval duration
    	how often to post
  -post.now
    	post and exit
  -reset.store
    	mark all store records as available
  -sentry.dsn string
    	Sentry DSN
  -store string
    	the store file (default "store.db")
  -test.dir string
    	test a directory of images
  -test.image string
    	test image
  -upload
    	enable photo uploading
  -username string
    	instagram username

Example Usage

$ ./nick_bot -autofollow=true -minfaces=3 -upload=true -username=<username> -password=<password>

Design

Posting Schedule

The bot posts at peak engagement times

The schedule is configured using the schedule.cron file (uses cron format).

Auto-Follow

The bot automatically follows people.

Image Selection

When it's time to post, an photo must be selected from the image store.

Strategies:
  1. Top faces of all followers (P: 0.40)
  2. Top likes of all followers (P: 0.40)
  3. Most faces of a random follower (P: 0.10)
  4. Most likes of a random follower (P: 0.10)

Crawler

The crawler's job is to find follower's photos.

Image Store

The image store is an index of all crawled photos.

CREATE TABLE media (
  media_id    TEXT,    -- photo id
  media_url   TEXT,    -- photo url
  user_id     TEXT,    -- original poster user id
  user_name   TEXT,    -- original poster username
  like_count  INTEGER, -- number of likes
  face_count  INTEGER, -- number of detected faces
  posted_at   INTEGER, -- timestamp of when the original was posted
  state       INTEGER  -- available, used, or rejected
);

Face Detection

Uses a Haar Feature-based Cascade Classifier for Object Detection.

Captions

Captions are randomly selected from the captions.txt file.

Demo

Relevant Instagram TOS

Remember to post authentic content, and don’t post anything you’ve copied or collected from the Internet that you don’t have the right to post.

Help us stay spam-free by not artificially collecting likes, followers, or shares, posting repetitive comments or content, or repeatedly contacting people for commercial purposes without their consent.

We remove [...] content that targets private individuals to degrade or shame them, personal information meant to blackmail or harass someone, and repeated unwanted messages.

Credit:

Idea and code was taken from https://github.com/zikes/chrisify