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
-
.hashtag(hashtag) ⇒ Object
get a hashtag.
-
.long_scrape_hashtag(hashtag, scrape_length) ⇒ Object
long scrape a hashtag.
-
.long_scrape_user_info_and_posts(username, scrape_length) ⇒ Object
get user info and posts.
-
.long_scrape_user_posts(username, scrape_length) ⇒ Object
long scrape a hashtag.
-
.user_description(username) ⇒ Object
get user description.
-
.user_follower_count(username) ⇒ Object
get user follower count.
-
.user_following_count(username) ⇒ Object
get user following count.
-
.user_info(username) ⇒ Object
get user info.
-
.user_info_and_posts(username) ⇒ Object
get user info and posts.
-
.user_post_count(username) ⇒ Object
get user post count.
-
.user_posts(username) ⇒ Object
get user posts only.
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.long_scrape_user_info_and_posts(username, scrape_length) scrape_user_info(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) scrape_user_info(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) scrape_user_info(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) scrape_user_info(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.user_info(username) scrape_user_info(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.user_info_and_posts(username) scrape_user_info(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) scrape_user_info(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 |