Class | Simpy::RSS |
In: |
lib/simpy.rb
|
Parent: | Object |
This class provides an interface to Simpy’s RSS client system. It provides Ruby methods for acquiring links from a Simpy RSS feed. The methods included in this class facilitate read-only access to the public links of a Simpy user. It should be used in situations where the username and password of a Simpy user are not available, and read-only access is sufficient.
Simpy::RSS.new("segphault")["test"].each do |l| puts l["href"] end
Get links from a user’s Simpy account
This method accesses the RSS feed for a user’s Simpy account, and uses it to acquire links. A query can optionally be provided to control which links are returned. The output is an array of Link instances parsed from the RSS XML content.
Keep in mind that this method will only show links associated with the public access type value.
q: | The string query to use for filtering the results. This string can use Simpy’s search syntax. |
Simpy::RSS.new("segphault").links("title:test tag:test2")
# File lib/simpy.rb, line 761 761: def links q="" 762: resp, data = Net::HTTP.new("www.simpy.com").get(@realm + q, @headers) 763: REXML::XPath.match(REXML::Document.new(data), "//item").map do |e| 764: Link.parse_rss e 765: end 766: end