Last active
November 4, 2016 02:23
-
-
Save hapiben/c904e581ea944b70533bb5fdf25efaa7 to your computer and use it in GitHub Desktop.
Example SJ Manager parser for SPCA Wellington Flickr
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Content Parner: Wellington SPCA | |
# Data Source: SPCA Wellington Flickr | |
class SPCAWellingtonFlickr < SupplejackCommon::Xml::Base | |
base_url 'https://api.flickr.com/services/rest/?method=flickr.photosets.getPhotos&api_key=66881cbc6259eae63ceb6d6453159892&user_id=73889498@N04&photoset_id=72157628780736141&privacy_filter=1&extras=description,%20license,%20date_taken,%20owner_name,%20geo,%20tags,%20media,%20machine_tags,%20url_m,%20url_z,%20url_o&format=rest' | |
paginate page_parameter: 'page', type: 'page', per_page_parameter: 'per_page', per_page: 100, page: 1, total_selector: '//*[1]/@total' | |
record_selector '//photo' | |
record_format :xml | |
throttle host: 'api.flickr.com', delay: 1 | |
attribute :title, xpath: '/@title' | |
attribute :description, xpath: '/description' | |
attribute :creator, xpath: '/@ownername' | |
attribute :thumbnail_url, xpath: '/@url_m' | |
attribute :large_thumbnail_url, xpath: '/@url_z' | |
attribute :object_url, xpath: '/@url_o' | |
attribute :internal_identifier, xpath: '/@url_m' | |
attributes :display_content_partner, :content_partner, :contributor, default: 'Wellington SPCA Flickr' | |
attributes :display_collection, :primary_collection, :collection, default: 'Wellington SPCA Flickr' | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment