Skip to content

Commit 6750ebb

Browse files
author
Franca Rast
committed
+ keep up with plattform changes
1 parent 0050f7c commit 6750ebb

File tree

3 files changed

+78
-40
lines changed

3 files changed

+78
-40
lines changed

lib/mogen.rb

Lines changed: 71 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
`PATH=/usr/local/bin:/usr/local/sbin:~/bin:/usr/bin:/bin:/usr/sbin:/sbin`
22
# the above is needed for cronjob
3+
#
4+
# ca 200 follower per month
35

46
#require_relative '../bin/mogen'
57
require_relative 'session'
@@ -10,45 +12,78 @@
1012
# tag_names = %w(flamingofloat flamingo flamingos flamingofloats floaties flamingopink flamingopoolparty pool river beer tropical)
1113

1214

15+
#worked good:
16+
# love
17+
# instagood
18+
# photooftheday
19+
# fashion
20+
# beautiful
21+
# happy
22+
# cute
23+
# tbt
24+
# like4like
25+
# followme
26+
# picoftheday
27+
# follow
28+
# selfie
29+
# art
30+
# summer
31+
# instadaily
32+
# friends
33+
# repost
34+
# nature
35+
# girl
36+
# fun
37+
# style
38+
# smile
39+
# food
40+
# travel
41+
# likeforlike
42+
# family
43+
# fitness
44+
# follow4follow
45+
# igers
46+
# beauty
47+
# tagsforlikes
48+
# life
49+
# nofilter
1350
tag_names = %w(
14-
love
15-
instagood
16-
photooftheday
51+
FashionPhoto
52+
FashionInfluencer
53+
FashionDaily
54+
StyleInspiration
55+
Clothes
56+
Urbanstyle
57+
DressedUp
58+
StyleBlog
59+
Fashionstylist
60+
makeupturorial
61+
makeupgoals
62+
makeupidea
63+
makeuplove
64+
glammakeup
65+
mua
66+
makeuppro
67+
makeuptransformatio
68+
makeuptime
69+
makeuptutorial
70+
eyeshadowlooks
71+
makeuplooks
72+
makeup
73+
beautybloggers
74+
beautytips
75+
muasfeaturing
76+
photoshoot
77+
photo
78+
session
79+
photomodel
1780
fashion
18-
beautiful
19-
happy
20-
cute
21-
tbt
22-
like4like
23-
followme
24-
picoftheday
25-
follow
26-
me
27-
selfie
28-
art
29-
summer
30-
instadaily
31-
friends
32-
repost
33-
nature
34-
girl
35-
fun
36-
style
37-
smile
38-
food
39-
instalike
40-
travel
41-
likeforlike
42-
family
43-
fitness
44-
follow4follow
45-
igers
46-
beauty
47-
tagsforlikes
48-
life
49-
nofilter
50-
amazing
81+
love
82+
beautiful
5183
)
84+
# amazing
85+
#instalike
86+
#me
5287
# tag namess optional
5388
# @session = Session.new(tag_names)
5489
#

lib/page/login.rb

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,9 @@ def submit
2828
page.find('button[type="submit"]').trigger('click')
2929
# page.find('button div', text: 'Log In', match: :first).click
3030
# page.find('button div', text: 'Log In', match: :first).click
31-
sleep 10
32-
page.visit '/'
31+
# page.visit '/'
32+
sleep 5
33+
page.find('button', text: "Not Now").trigger('click')
3334

3435
page.find("a[href='/#{username}/']", match: :first)
3536
puts 'logged in' unless page.has_selector?('Log in')

lib/session.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
Capybara.run_server = false
1010
Capybara.app_host = "https://www.instagram.com"
1111
Capybara.current_driver = :cuprite
12+
#Capybara.current_driver = :selenium_chrome
1213

1314
class Session
1415
attr_accessor :like_counter, :comment_counter, :tags, :like_tags, :user, :page
@@ -20,6 +21,7 @@ def initialize(tag_names = [], user)
2021
@user = user
2122
@page = Capybara::Session.new(Capybara.current_driver)
2223
@page.driver.options[:js_errors] = false
24+
@page.driver.headers = { "User-Agent" => "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:86.0) Gecko/20100101 Firefox/86.0" }
2325
end
2426

2527
def login
@@ -42,13 +44,13 @@ def get_tags(names)
4244

4345
def like_tags
4446
tags.each do |tag|
45-
tag.like_posts(57)
47+
tag.like_posts(50)
4648
end
4749
end
4850

4951
def comment_tags
5052
tags.each do |tag|
51-
tag.comment_posts(57)
53+
tag.comment_posts(50)
5254
end
5355
end
5456

0 commit comments

Comments
 (0)