Skip to content

Latest commit

 

History

History
158 lines (116 loc) · 5.48 KB

README.md

File metadata and controls

158 lines (116 loc) · 5.48 KB

instabot.rb

An ruby instagram bot and scrapper works without instagram api, only needs your username and password.

https://rubygems.org/gems/instabot https://rubygems.org/gems/instabot https://travis-ci.org/eVanilla/instabot.rb

installation

Add this to your Gemfile:

gem 'instabot'

and then execute

$ bundle install

or install it yourself as:

$ gem install instabot --no-ri --no-rdoc

Usage

here is the basic usage:

require 'instabot' 

bot = Instabot.new :manual
bot.login("username","password")

bot.follow('user_id')
bot.unfollow('user_id')
bot.like('media_id')
bot.unlike('media_id')
bot.comment('media_id', 'comment text here')

bot.logout()

and here is the automatic usage:

require 'instabot'

Config.setup do |set|
  set.username             = 'username'
  set.password             = 'password'
  set.tags                 = %w[test hello birthday]
  
  # set.use_proxy            = true # => it's important to enable the proxy usage
  # set.proxy                = ["localhost",8888] # without username and password
  # set.proxy                = ["localhost",8000,"USERNAME","PASSWORD"] # with username and password
  
  # set.use_tor              = true # default is false

  set.wait_per_action      = 5 * 60
  set.max_like_per_day     = 50
  set.max_follow_per_day   = 50
  set.max_unfollow_per_day = 50
  set.max_comment_per_day  = 50
  set.log_status           = true
  set.infinite_tags        = true
  set.add_tag_per_post     = 5
  set.print_banner         = true
  set.pre_load             = false

  set.unwanted_list        = ["_id","free_","free"]
  set.white_list_users     = ["john","alex","nick"]

  set.comments             = [
    %w[this the your],
    %w[photo picture pic shot snapshot],
    %w[is looks feels is really],
    %w[great super good very good good wow WOW cool GREAT magnificent magical very cool stylish beautiful so beautiful so stylish so professional lovely so lovely very lovely glorious so glorious very glorious adorable excellent amazing],
    %w[. .. ... ! !! !!!]
  ]
end

bot = Instabot.new
bot.mode(:infinite) # => :cleanup, :infinite, ...

Note: Example files are here and be careful about using infinite_tags option

Using proxies

set.use_proxy                 = true # => it's so important to enable the proxy usage
set.proxy                     = ["localhost",8888] # without username and password
set.proxy                     = ["localhost",8000,"USERNAME","PASSWORD"] # with username and password

don't have money to buy a proxy? no problem! continue reading

Using tor

first of all you have to download the latest tor expert bundle from here

then navigate to the Tor folder and run the tor --controlport 9051

also don't forget to enable using tor by set.use_tor = true option, and that's it! we're done

Configuration description:

set description value (example)
username this is your IG username your_ig_username
password this is your IG password your_ig_password
tags This script use tags for searching medias & users write whatever you want like this ["hello_world", "test"] in an array
wait_per_action wait time per actions 1 * 60
log_status printing logs in the file true or false
unwanted_list unwanted names in usernames ["_id","free_","free"]
white_list_users white list usernames ["john","alex","nick"]
max_like_per_day this is the max likes per day limitation 100
max_follow_per_day this is the max follows per day limitation 100
max_unfollow_per_day this is the max unfollows per day limitation 100
max_comment_per_day this is the max comments per day limitation 100
infinite_tags grab new tags by medias (infinite tag grabber) ture or false
add_tag_per_post an limit for infinite_tags 5 , default is 1
print_banner enable or disable banner true or false
comments the comments you want to post in medias just change the values in example
pre_load load pre configurations in logs folder followed_users.txt, unfollowed_users.txt, liked_medias.txt, commented_medias.txt
use_tor enabling and disabling the tor usage true or false
use_proxy enabling and disabling the proxy usage true or false
proxy http(s) proxy details write it in an array like this ["IP",PORT] or if it has username and password you have to use this format ["IP",PORT,"USERNAME","PASSWORD"]

Development description:

Methods are available on rubydoc.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/eVanilla/instabot.rb

Also thank you guys! Contributors

and if you like it just... hit the star button to make me (us) happy! (≖ᴗ≖✿)

Used gems

  • Activesupport
  • Mechanize
  • Colorize
  • Hashie
  • Socksify
  • Net-telnet

What's new in the future ?

Still no idea... what do you think?