/
examples.py
executable file
·91 lines (75 loc) · 3 KB
/
examples.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
#!/usr/bin/env python
from meme import Meme
# --> examples - posts
print '========== Popular memes =========='
print Meme.Posts.popular()
print '========== Popular memes from Brazil =========='
print Meme.Posts.popular(locale='pt')
print '========== Sample post search =========='
posts = Meme.Posts.search('meme rocks')
print posts
print '---------- Results for "meme rocks" ----------'
for post in posts:
print 'Content: %s' % post.content
print 'Caption: %s' % post.caption
print '----------------------------------------------'
print '========== Sample meme search =========='
memes = Meme.search('designer')
print memes
print '---------- Results for "designer" ----------'
for meme in memes:
print 'Name: %s' % meme.name
print 'Title: %s' % meme.title
print 'Description: %s' % meme.description
print '----------------------------------------------'
print '========== Get gchapiewski Meme =========='
meme = Meme.get(name='gchapiewski')
print meme
print meme.title
print meme.description
print meme.url
print '========== Memes that gchapiewski is following =========='
print meme.following()
print '========== 50 Memes that gchapiewski is following =========='
print meme.following(count=50)
print '========== Memes following gchapiewski Meme =========='
print meme.followers()
print '========== 50 Memes following gchapiewski Meme =========='
print meme.followers(count=50)
print '========== Posts from gchapiewski Meme =========='
posts = meme.posts()
print posts
print '---------- Results ----------'
for post in posts:
print 'Type: %s' % post.type
print 'Repost count: %s' % post.repost_count
print 'Original: %s' % post.is_original
print '----------------------------------------------'
print '========== The latest post from gchapiewski Meme =========='
latest_post = posts[0]
print '---------- Details ----------'
print 'Type: %s' % post.type
print 'Repost count: %s' % post.repost_count
print 'Content: %s' % post.content
print 'Caption: %s' % post.caption
print '----------------------------------------------'
print '========== The activity around the latest post =========='
for post in latest_post.activity():
print 'Type: %s' % post.type #repost or commment
print 'Comment: %s' % post.comment
print 'GUID: %s' % post.guid
print '----------------------------------------------'
print '========== Most reposted posts from gchapiewski =========='
for post in meme.most_reposted_posts():
print 'Type: %s' % post.type #repost or commment
print 'Comment: %s' % post.comment
print 'GUID: %s' % post.guid
print 'reposts: %s' % post.repost_count
print '----------------------------------------------'
print '========== 2 most reposted TEXT posts from gchapiewski =========='
for post in meme.most_reposted_posts(media='text', count=2):
print 'Type: %s' % post.type #repost or commment
print 'Comment: %s' % post.comment
print 'GUID: %s' % post.guid
print 'reposts: %s' % post.repost_count
print '----------------------------------------------'