This repository has been archived by the owner. It is now read-only.
instagram.cr
instagram.cr
Crystal library for crawling Instagram.
Installation
Add this to your application's shard.yml
:
dependencies:
instagram:
github: omarroth/instagram.cr
Usage
require "instagram"
end_cursor = nil
(1..Float64::INFINITY).each do |i|
user = Instagram.get_user_page("natgeo", end_cursor)
end_cursor = user["edge_owner_to_timeline_media"]["page_info"]["end_cursor"].as_s?
has_next_page = user["edge_owner_to_timeline_media"]["page_info"]["has_next_page"].as_bool
File.write("#{i}.json", user.to_pretty_json)
print "Page : #{i}\r"
if !has_next_page
break
end
end
Development
TODO: Write development instructions here
Contributing
- Fork it (https://github.com/omarroth/instagram.cr/fork)
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request
Contributors
- Omar Roth - creator and maintainer
Repository
instagram.cr
Owner
Statistic
- 3
- 0
- 0
- 0
- 0
- about 4 years ago
- December 5, 2018
License
GNU General Public License v3.0
Links
Synced at
Wed, 01 May 2024 14:45:13 GMT
Languages