Skip to content

Instantly share code, notes, and snippets.

@missingno15
Created June 4, 2015 08:46
Show Gist options
  • Save missingno15/e79d4073fd795ed2f538 to your computer and use it in GitHub Desktop.
Save missingno15/e79d4073fd795ed2f538 to your computer and use it in GitHub Desktop.
parse album ids from attachments
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