Skip to content

Commit f15c424

Browse files
committed
Merge pull request Imgur#27 from ueg1990/examples
Move examples to EXAMPLES.md
2 parents aa5dbee + c25cf7e commit f15c424

2 files changed

Lines changed: 58 additions & 56 deletions

File tree

EXAMPLES.md

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
Examples
2+
------------
3+
4+
## Anonymous Usage without user authorization
5+
6+
### Print links in a Gallery
7+
Output links from gallery could be a GalleyImage or GalleryAlbum
8+
9+
#### Default
10+
By default, this will return links to items on the first page (0) with section 'hot' sorted by 'viral', date range is 'day' and show_viral is set to True
11+
12+
```python
13+
items = client.gallery()
14+
for item in items:
15+
print(item.link)
16+
17+
```
18+
19+
**Output**
20+
21+
22+
http://i.imgur.com/dRMIpvS.png
23+
http://imgur.com/a/uxKYS
24+
http://i.imgur.com/jYvaxQ1.jpg
25+
http://i.imgur.com/ZWQJSXp.jpg
26+
http://i.imgur.com/arP5ZwL.jpg
27+
http://i.imgur.com/BejpKnz.jpg
28+
http://i.imgur.com/4FJF0Vt.jpg
29+
http://i.imgur.com/MZSBjTP.jpg
30+
http://i.imgur.com/EbeztS2.jpg
31+
http://i.imgur.com/DuwnhKO.jpg
32+
...
33+
34+
#### With Specific Parameters
35+
In this example, return links to items on the fourth page (3) with section 'top' sorted by 'time', date range is 'week' and show_viral is set to False
36+
37+
```python
38+
items = client.gallery(section='top', sort='time', page=3, window='week', show_viral=False)
39+
for item in items:
40+
print(item.link)
41+
42+
```
43+
44+
**Output**
45+
46+
47+
http://i.imgur.com/ls7OPx7.gif
48+
http://i.imgur.com/FI7yPWo.png
49+
http://imgur.com/a/8QKvH
50+
http://i.imgur.com/h4IDMyK.gif
51+
http://i.imgur.com/t4NpfCT.jpg
52+
http://i.imgur.com/kyCP6q9.jpg
53+
http://imgur.com/a/CU11w
54+
http://i.imgur.com/q4rJFbR.jpg
55+
http://i.imgur.com/gWaNC22.jpg
56+
http://i.imgur.com/YEQomCd.gif
57+
...

README.md

Lines changed: 1 addition & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -118,61 +118,7 @@ For more information about rate-limiting, please see the note in our [docs](http
118118

119119
Examples
120120
------------
121-
122-
## Anonymous Usage without user authorization
123-
124-
### Print links in a Gallery
125-
Output links from gallery could be a GalleyImage or GalleryAlbum
126-
127-
#### Default
128-
By default, this will return links to items on the first page (0) with section 'hot' sorted by 'viral', date range is 'day' and show_viral is set to True
129-
130-
```python
131-
items = client.gallery()
132-
for item in items:
133-
print(item.link)
134-
135-
```
136-
137-
**Output**
138-
139-
140-
http://i.imgur.com/dRMIpvS.png
141-
http://imgur.com/a/uxKYS
142-
http://i.imgur.com/jYvaxQ1.jpg
143-
http://i.imgur.com/ZWQJSXp.jpg
144-
http://i.imgur.com/arP5ZwL.jpg
145-
http://i.imgur.com/BejpKnz.jpg
146-
http://i.imgur.com/4FJF0Vt.jpg
147-
http://i.imgur.com/MZSBjTP.jpg
148-
http://i.imgur.com/EbeztS2.jpg
149-
http://i.imgur.com/DuwnhKO.jpg
150-
...
151-
152-
#### With Specific Parameters
153-
In this example, return links to items on the fourth page (3) with section 'top' sorted by 'time', date range is 'week' and show_viral is set to False
154-
155-
```python
156-
items = client.gallery(section='top', sort='time', page=3, window='week', show_viral=False)
157-
for item in items:
158-
print(item.link)
159-
160-
```
161-
162-
**Output**
163-
164-
165-
http://i.imgur.com/ls7OPx7.gif
166-
http://i.imgur.com/FI7yPWo.png
167-
http://imgur.com/a/8QKvH
168-
http://i.imgur.com/h4IDMyK.gif
169-
http://i.imgur.com/t4NpfCT.jpg
170-
http://i.imgur.com/kyCP6q9.jpg
171-
http://imgur.com/a/CU11w
172-
http://i.imgur.com/q4rJFbR.jpg
173-
http://i.imgur.com/gWaNC22.jpg
174-
http://i.imgur.com/YEQomCd.gif
175-
...
121+
Examples can be found [here](EXAMPLES.md)
176122

177123
## ImgurClient Functions
178124

@@ -210,7 +156,6 @@ for item in items:
210156
### Comment
211157
* `get_comment(comment_id)`
212158
* `delete_comment(comment_id)`
213-
* `create_album(fields)`
214159
* `get_comment_replies(comment_id)`
215160
* `post_comment_reply(comment_id, image_id, comment)`
216161
* `comment_vote(comment_id, vote='up')`

0 commit comments

Comments
 (0)