-
Notifications
You must be signed in to change notification settings - Fork 38
People
George Kye edited this page May 22, 2016
·
10 revisions
Get the general person information for a specific id.
PersonMDB.person_id(apikey, personID: 287){
personRtn in
let person = personRtn.data!
print(person.name)
print(person.also_known_as)
print(person.biography)
print(person.birthday)
print(person.homepage)
}
Get the movie credits for a specific person id.
PersonMDB.movie_credits(apikey, personID: 1245, language: "en"){
credits in
let d = credits.data
print(d?.cast.count)
print(d?.crew.count)
print(d?.crew[0].title)
print(d?.crew[0].poster_path)
}
Get the TV credits for a specific person id.
PersonMDB.tv_credits(apikey, personID: 1245, language: "en"){
credits in
let d = credits.data
print(d?.cast.count)
print(d?.crew.count)
print(d?.cast[0].episode_count)
print(d?.cast[0].character)
print(d?.cast[0].original_name)
}
Get the combined (movie and TV) credits for a specific person id.
PersonMDB.combined_credits(apikey, personID: 1245, language: "en"){
credits in
let d = credits.data
print(d?.movieCredits.cast?.count)
print(d?.movieCredits.crew?.count)
print(d?.tvCredits.cast?.count)
print(d?.tvCredits.crew?.count)
}
Get the external ids for a specific person id.
PersonMDB.externalIDS(apikey, personID: 287){
apiReturn in
let exIds = apiReturn.data!
print(exIds.freebase_id)
print(exIds.imdb_id)
print(exIds.tvrage_id)
print(exIds.id)
}
Get the images for a specific person id.
PersonMDB.images(apikey, personID: 287){
apiReturn in
let images = apiReturn.data
for image in images!{
print(image.file_path)
print(image.width)
print(image.iso_639_1)
}
}
Get the images that have been tagged with a specific person id. Will return all of the image results with a media object mapped for each image.
PersonMDB.tagged_images(apikey, personID: 1245, page: 2){
imgs in
let data = imgs.data
print(data?.movieImages.count)
print(data?.tvImages.count)
print(data?.movieImages[0].file_path)
print(data?.movieImages[0].media.overview)
}
Get the latest person id.
PersonMDB.latest(apikey){
personRtn in
let person = personRtn.data!
print(person.name)
print(person.also_known_as)
print(person.biography)
print(person.birthday)
print(person.homepage)
}
///TODO: popular, taggedImages, tv & movies credits