forked from hotsh/rstat.us
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Moving classes in lib each to their own class; I had some issues gett…
…ing the constants to be recognized when running locally
- Loading branch information
1 parent
eb22cf0
commit bc581b2
Showing
5 changed files
with
36 additions
and
33 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
require_relative "queries_web_finger" | ||
|
||
FeedData = Struct.new(:url, :finger_data) | ||
|
||
class ConvertsSubscriberToFeedData | ||
def self.get_feed_data(subscriber_url) | ||
feed_data = FeedData.new | ||
|
||
case subscriber_url | ||
when /^feed:\/\// | ||
# SAFARI!!!!1 /me shakes his first at the sky | ||
feed_data.url = "http" + subscriber_url[4..-1] | ||
when /@/ | ||
finger_data = QueriesWebFinger.query(subscriber_url) | ||
feed_data.url = finger_data.url | ||
feed_data.finger_data = finger_data | ||
else | ||
feed_data.url = subscriber_url | ||
end | ||
|
||
feed_data | ||
end | ||
end |
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
require_relative "finger_data" | ||
|
||
class QueriesWebFinger | ||
def self.query(email) | ||
# XXX: ensure caching of finger lookup. | ||
xrd = Redfinger.finger(email) | ||
FingerData.new(xrd) | ||
end | ||
end |
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