Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 51 lines (33 sloc) 1.61 kb
7a54828 @mislav link to official stuff
authored
1 # Unofficial [Instagram][] Ruby library
0d89980 @mislav Instagram is ours
authored
2
7a54828 @mislav link to official stuff
authored
3 This library acts as a client for the [unofficial Instagram API][wiki]. It was used to create [the missing Instagram web interface][web] before [their main API][official] went public.
a4278ff @mislav gem install instagram
authored
4
5 With it, you can:
0d89980 @mislav Instagram is ours
authored
6
7 * fetch popular photos;
8 * get user info;
9 * browse photos by a user.
10
11 Caveat: you need to know user IDs; usernames can't be used. However, you can start from the popular feed and drill down from there.
12
13 ## Example usage
14
15 require 'instagram'
16
17 photos = Instagram::popular
18 photo = photos.first
19
20 photo.caption #=> "Extreme dog closeup"
21 photo.likes.size #=> 54
b0356bf @mislav document `filter_name` and `image_url`
authored
22 photo.filter_name #=> "X-Pro II"
0d89980 @mislav Instagram is ours
authored
23
24 photo.user.username #=> "johndoe"
25 photo.user.full_name #=> "John Doe"
26 photo.comments[1].text #=> "That's so cute"
27 photo.images.last.width #=> 612
28
cd42290 @mislav add helpful comments to models code
authored
29 # available sizes: 150px / 306px / 612px square
b0356bf @mislav document `filter_name` and `image_url`
authored
30 photo.image_url(612)
cd42290 @mislav add helpful comments to models code
authored
31 # => "http://distillery.s3.amazonaws.com/media/-.jpg" (612×612px image)
0d89980 @mislav Instagram is ours
authored
32
33 # fetch extended info for John
34 john_info = Instagram::user_info(photo.user.id)
35
96b01ee @mislav deprecate `User#following`, `#followers`, `#avatar`
authored
36 john_info.media_count #=> 32
37 john_info.follower_count #=> 160
0d89980 @mislav Instagram is ours
authored
38
39
40 # find more photos by John
41 photos_by_john = Instagram::by_user(photo.user.id)
42
cd42290 @mislav add helpful comments to models code
authored
43 To see which models and properties are available, see [models.rb][models].
0d89980 @mislav Instagram is ours
authored
44
45
46 [instagram]: http://instagr.am/
a4278ff @mislav gem install instagram
authored
47 [web]: http://instagram.heroku.com
cd42290 @mislav add helpful comments to models code
authored
48 [wiki]: https://github.com/mislav/instagram/wiki "Instagram API"
7a54828 @mislav link to official stuff
authored
49 [models]: https://github.com/mislav/instagram/blob/master/lib/instagram/models.rb
50 [official]: http://instagram.com/developer/
Something went wrong with that request. Please try again.