Created
June 4, 2015 08:46
-
-
Save missingno15/e79d4073fd795ed2f538 to your computer and use it in GitHub Desktop.
parse album ids from attachments
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
def parse_album_id(type, url) | |
if type == "photo" | |
album_id = url.split('/')[-2] | |
elsif type == "album" | |
album_id = url.split('/')[-1].split('?')[0] | |
else | |
raise "The type, \"#{type}\" is not supported, #{}" | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment