Created
March 5, 2011 16:28
-
-
Save hramos/856483 to your computer and use it in GitHub Desktop.
superfeedr lssnr
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_superfeedr_checkin | |
json_response = Hash.new # parse from superfeedr | |
checkin_url = "" #get from superfeedr | |
user_id = "" # get from superfeedr | |
user = User.find(user_id) # else could get username from superfeedr and fetch by_nickname | |
if user | |
checkin = user.checkins.find_by_url(checkin_url) || user.checkins.create_with_superfeedr_response(json_response) | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
could add an else to create user, but that should not happen as users must exist before registering to superfeedr