-
Notifications
You must be signed in to change notification settings - Fork 2
π User Information
Syashin , Chen edited this page Sep 2, 2018
·
13 revisions
If you want to get someone's user information, you should create a User Instance, and use Instance methods.
Name | Type | Description |
---|---|---|
user_id | str | Find this parameter at someone's flickr url, like this :![]() |
# Return a "User Instance"
user = PyFlickr.getUser(user_id="139958401@N06")
Now, you get a User instance named user, and it has 6 methods : getAbout, getPhotoStream, getAlbums, getFaves, getGalleries, getGroups.
This method has no parameters.
# Return user data in "About" Page
user_about = user.getAbout()
{
"title": "Syashin Chen",
"subtitle": "PythonTest",
"avatar": "https://s.yimg.com/pw/images/buddyicon01_r.png#139958401@N06",
"followers": "3",
"following": "3",
"description": "For PyFlickr Test",
"infos": {
"Joined": "March 2016",
"Hometown": "Tainan",
"Current city": "Hsinchu",
"Country": "Taiwan",
"Website": "https://medium.com/@Syashin"
},
"general_stats": {
"views": "518",
"tags": "0",
"map": "0",
"favorites": "2",
"groups": "2"
},
"showcase_photos": [
"https://www.flickr.com/photos/139958401@N06/43371867585/",
"https://www.flickr.com/photos/139958401@N06/43371866885/"
],
"popular_photos": [
"https://www.flickr.com/photos/139958401@N06/44277693001/",
"https://www.flickr.com/photos/139958401@N06/44277691471/"
]
}
Name | Type | Description |
---|---|---|
limit_trigger | bool | It is uesd to set a limit to the returning pages through there are perhaps too many photos on Photostream Page. Default limit_trigger = True . |
limit_page | int | The limit number of returning pages. Default limit_page = 1, and will be invalid when limit_trigger = False . |
# Return 1 page of "PhotoStream" Page
user_photo_stream = user.getPhotoStream()
# Return 3 pages of "PhotoStream" Page
user_photo_stream = user.getPhotoStream(limit_page = 3)
# Return all pages of "PhotoStream" Page
user_photo_stream = user.getPhotoStream(limit_trigger = False)
{
"Limit_Trigger": "False",
"Limit_Page": "None",
"Time_Spend": 19,
"PhotoStream_Count": 26,
"PhotoStream_Result": [
"https://www.flickr.com/photos/139958401@N06/44277693001/",
"https://www.flickr.com/photos/139958401@N06/43371871895/",
"https://www.flickr.com/photos/139958401@N06/43371871115/",
"https://www.flickr.com/photos/139958401@N06/44277691911/",
"https://www.flickr.com/photos/139958401@N06/44277691471/"
...more
]
}
Name | Type | Description |
---|---|---|
limit_trigger | bool | It is uesd to set a limit to the returning pages through there are perhaps too many albums on Album Page. Default limit_trigger = True . |
limit_page | int | The limit number of returning pages. Default limit_page = 1, and will be invalid when limit_trigger = False . |
# Return 1 page of "Albums" Page
user_albums = user.getAlbums()
# Return 3 pages of "Albums" Page
user_albums = user.getAlbums(limit_page = 3)
# Return all pages of "Albums" Page
user_albums = user.getAlbums(limit_trigger = False)
{
"Limit_Trigger": "False",
"Limit_Page": "None",
"Time_Spend": 21,
"Albums_Count": 2,
"Albums_Result": [
{
"title": "Travel_to_Japan",
"url": "https://www.flickr.com/photos/139958401@N06/albums/72157700310278564"
},
{
"title": "Tainan_Taiwan",
"url": "https://www.flickr.com/photos/139958401@N06/albums/72157670574464187"
}
]
}
Name | Type | Description |
---|---|---|
limit_trigger | bool | It is uesd to set a limit to the returning pages through there are perhaps too many favorites photo on Faves Page. Default limit_trigger = True . |
limit_page | int | The limit number of returning pages. Default limit_page = 1, and will be invalid when limit_trigger = False . |
# Return 1 page of "Faves" Page
user_favorites = user.getFaves()
# Return 3 pages of "Faves" Page
user_favorites = user.getFaves(limit_page = 3)
# Return all pages of "Faves" Page
user_favorites = user.getFaves(limit_trigger = False)
{
"Limit_Trigger": "False",
"Limit_Page": "None",
"Time_Spend": 19,
"Faves_Count": 2,
"Faves_Result": [
"https://www.flickr.com/photos/othree/9480817678",
"https://www.flickr.com/photos/bahnlandschaften/42447232940"
]
}
Name | Type | Description |
---|---|---|
limit_trigger | bool | It is uesd to set a limit to the returning pages through there are perhaps too many Galleries on Galleries Page. Default limit_trigger = True . |
limit_page | int | The limit number of returning pages. Default limit_page = 1, and will be invalid when limit_trigger = False . |
# Return 1 page of "Galleries" Page
user_galleries = user.getGalleries()
# Return 3 pages of "Galleries" Page
user_galleries = user.getGalleries(limit_page = 3)
# Return all pages of "Galleries" Page
user_galleries = user.getGalleries(limit_trigger = False)
{
"Limit_Trigger": "False",
"Limit_Page": "None",
"Time_Spend": 16,
"Galleries_Count": 0,
"Galleries_Result": []
}
Name | Type | Description |
---|---|---|
limit_trigger | bool | It is uesd to set a limit to the returning pages through there are perhaps too many Galleries on Galleries Page. Default limit_trigger = True . |
limit_page | int | The limit number of returning pages. Default limit_page = 1, and will be invalid when limit_trigger = False . |
# Return 1 page of "Groups" Page
user_groups = user.getGroups()
# Return 3 pages of "Groups" Page
user_groups = user.getGroups(limit_page = 3)
# Return all pages of "Groups" Page
user_groups = user.getGroups(limit_trigger = False)
{
"Limit_Trigger": "False",
"Limit_Page": "None",
"Time_Spend": 17,
"Groups_Count": 2,
"Groups_Result": [
{
"url": "https://www.flickr.com/groups/challengefactory/",
"title": "ε·₯εηζζ",
"members": {
"numbers": "5,595",
"url": "https://www.flickr.com/groups/challengefactory/members"
},
"photos": {
"numbers": "105,935",
"url": "https://www.flickr.com/groups/challengefactory/pool"
},
"discuss": {
"numbers": "145,849",
"url": "https://www.flickr.com/groups/challengefactory/discuss"
}
},
{
"url": "https://www.flickr.com/groups/35mmphotography/",
"title": "35mm - Photography",
"members": {
"numbers": "6,569",
"url": "https://www.flickr.com/groups/35mmphotography/members"
},
"photos": {
"numbers": "150,907",
"url": "https://www.flickr.com/groups/35mmphotography/pool"
},
"discuss": {
"numbers": "19",
"url": "https://www.flickr.com/groups/35mmphotography/discuss"
}
}
]
}