Module: InstaScrape

Extended by:
Capybara::DSL
Defined in:
lib/insta_scrape.rb,
lib/insta_scrape/version.rb

Defined Under Namespace

Classes: InstagramPost, InstagramUser, InstagramUserWithPosts

Constant Summary collapse

VERSION =
"1.1.0"

Class Method Summary collapse

Class Method Details

.hashtag(hashtag) ⇒ Object

get a hashtag



7
8
9
10
11
# File 'lib/insta_scrape.rb', line 7

def self.hashtag(hashtag)
  visit "https://www.instagram.com/explore/tags/#{hashtag}/"
  @posts = []
  scrape_posts
end

.long_scrape_hashtag(hashtag, scrape_length) ⇒ Object

long scrape a hashtag



14
15
16
17
18
# File 'lib/insta_scrape.rb', line 14

def self.long_scrape_hashtag(hashtag, scrape_length)
  visit "https://www.instagram.com/explore/tags/#{hashtag}/"
  @posts = []
  long_scrape_posts(scrape_length)
end

.long_scrape_user_info_and_posts(username, scrape_length) ⇒ Object

get user info and posts



27
28
29
30
31
# File 'lib/insta_scrape.rb', line 27

def self.(username, scrape_length)
  (username)
  long_scrape_user_posts_method(username, scrape_length)
  @user = InstaScrape::InstagramUserWithPosts.new(username, @image, @post_count, @follower_count, @following_count, @description, @posts)
end

.long_scrape_user_posts(username, scrape_length) ⇒ Object

long scrape a hashtag



21
22
23
24
# File 'lib/insta_scrape.rb', line 21

def self.long_scrape_user_posts(username, scrape_length)
  @posts = []
  long_scrape_user_posts_method(username, scrape_length)
end

.user_description(username) ⇒ Object

get user description



70
71
72
73
# File 'lib/insta_scrape.rb', line 70

def self.user_description(username)
  (username)
  return @description
end

.user_follower_count(username) ⇒ Object

get user follower count



52
53
54
55
# File 'lib/insta_scrape.rb', line 52

def self.user_follower_count(username)
  (username)
  return @follower_count
end

.user_following_count(username) ⇒ Object

get user following count



58
59
60
61
# File 'lib/insta_scrape.rb', line 58

def self.user_following_count(username)
  (username)
  return @following_count
end

.user_info(username) ⇒ Object

get user info



34
35
36
37
# File 'lib/insta_scrape.rb', line 34

def self.(username)
  (username)
  @user = InstaScrape::InstagramUser.new(username, @image, @post_count, @follower_count, @following_count, @description)
end

.user_info_and_posts(username) ⇒ Object

get user info and posts



40
41
42
43
44
# File 'lib/insta_scrape.rb', line 40

def self.(username)
  (username)
  scrape_user_posts(username)
  @user = InstaScrape::InstagramUserWithPosts.new(username, @image, @post_count, @follower_count, @following_count, @description, @posts)
end

.user_post_count(username) ⇒ Object

get user post count



64
65
66
67
# File 'lib/insta_scrape.rb', line 64

def self.user_post_count(username)
  (username)
  return @post_count
end

.user_posts(username) ⇒ Object

get user posts only



47
48
49
# File 'lib/insta_scrape.rb', line 47

def self.user_posts(username)
  scrape_user_posts(username)
end