Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/AnonR/anonr.TX.../opt/alt/ruby27/share/ruby/rss
File: 2.0.rb
# frozen_string_literal: false
[0] Fix | Delete
require "rss/0.9"
[1] Fix | Delete
[2] Fix | Delete
module RSS
[3] Fix | Delete
[4] Fix | Delete
##
[5] Fix | Delete
# = RSS 2.0 support
[6] Fix | Delete
#
[7] Fix | Delete
# RSS has three different versions. This module contains support for version
[8] Fix | Delete
# 2.0[http://www.rssboard.org/rss-specification]
[9] Fix | Delete
#
[10] Fix | Delete
# == Producing RSS 2.0
[11] Fix | Delete
#
[12] Fix | Delete
# Producing our own RSS feeds is easy as well. Let's make a very basic feed:
[13] Fix | Delete
#
[14] Fix | Delete
# require "rss"
[15] Fix | Delete
#
[16] Fix | Delete
# rss = RSS::Maker.make("2.0") do |maker|
[17] Fix | Delete
# maker.channel.language = "en"
[18] Fix | Delete
# maker.channel.author = "matz"
[19] Fix | Delete
# maker.channel.updated = Time.now.to_s
[20] Fix | Delete
# maker.channel.link = "http://www.ruby-lang.org/en/feeds/news.rss"
[21] Fix | Delete
# maker.channel.title = "Example Feed"
[22] Fix | Delete
# maker.channel.description = "A longer description of my feed."
[23] Fix | Delete
# maker.items.new_item do |item|
[24] Fix | Delete
# item.link = "http://www.ruby-lang.org/en/news/2010/12/25/ruby-1-9-2-p136-is-released/"
[25] Fix | Delete
# item.title = "Ruby 1.9.2-p136 is released"
[26] Fix | Delete
# item.updated = Time.now.to_s
[27] Fix | Delete
# end
[28] Fix | Delete
# end
[29] Fix | Delete
#
[30] Fix | Delete
# puts rss
[31] Fix | Delete
#
[32] Fix | Delete
# As you can see, this is a very Builder-like DSL. This code will spit out an
[33] Fix | Delete
# RSS 2.0 feed with one item. If we needed a second item, we'd make another
[34] Fix | Delete
# block with maker.items.new_item and build a second one.
[35] Fix | Delete
class Rss
[36] Fix | Delete
[37] Fix | Delete
class Channel
[38] Fix | Delete
[39] Fix | Delete
[
[40] Fix | Delete
["generator"],
[41] Fix | Delete
["ttl", :integer],
[42] Fix | Delete
].each do |name, type|
[43] Fix | Delete
install_text_element(name, "", "?", name, type)
[44] Fix | Delete
end
[45] Fix | Delete
[46] Fix | Delete
[
[47] Fix | Delete
%w(category categories),
[48] Fix | Delete
].each do |name, plural_name|
[49] Fix | Delete
install_have_children_element(name, "", "*", name, plural_name)
[50] Fix | Delete
end
[51] Fix | Delete
[52] Fix | Delete
[
[53] Fix | Delete
["image", "?"],
[54] Fix | Delete
["language", "?"],
[55] Fix | Delete
].each do |name, occurs|
[56] Fix | Delete
install_model(name, "", occurs)
[57] Fix | Delete
end
[58] Fix | Delete
[59] Fix | Delete
Category = Item::Category
[60] Fix | Delete
[61] Fix | Delete
class Item
[62] Fix | Delete
[63] Fix | Delete
[
[64] Fix | Delete
["comments", "?"],
[65] Fix | Delete
["author", "?"],
[66] Fix | Delete
].each do |name, occurs|
[67] Fix | Delete
install_text_element(name, "", occurs)
[68] Fix | Delete
end
[69] Fix | Delete
[70] Fix | Delete
[
[71] Fix | Delete
["pubDate", '?'],
[72] Fix | Delete
].each do |name, occurs|
[73] Fix | Delete
install_date_element(name, "", occurs, name, 'rfc822')
[74] Fix | Delete
end
[75] Fix | Delete
alias date pubDate
[76] Fix | Delete
alias date= pubDate=
[77] Fix | Delete
[78] Fix | Delete
[
[79] Fix | Delete
["guid", '?'],
[80] Fix | Delete
].each do |name, occurs|
[81] Fix | Delete
install_have_child_element(name, "", occurs)
[82] Fix | Delete
end
[83] Fix | Delete
[84] Fix | Delete
private
[85] Fix | Delete
alias _setup_maker_element setup_maker_element
[86] Fix | Delete
def setup_maker_element(item)
[87] Fix | Delete
_setup_maker_element(item)
[88] Fix | Delete
@guid.setup_maker(item) if @guid
[89] Fix | Delete
end
[90] Fix | Delete
[91] Fix | Delete
class Guid < Element
[92] Fix | Delete
[93] Fix | Delete
include RSS09
[94] Fix | Delete
[95] Fix | Delete
[
[96] Fix | Delete
["isPermaLink", "", false, :boolean]
[97] Fix | Delete
].each do |name, uri, required, type|
[98] Fix | Delete
install_get_attribute(name, uri, required, type)
[99] Fix | Delete
end
[100] Fix | Delete
[101] Fix | Delete
content_setup
[102] Fix | Delete
[103] Fix | Delete
def initialize(*args)
[104] Fix | Delete
if Utils.element_initialize_arguments?(args)
[105] Fix | Delete
super
[106] Fix | Delete
else
[107] Fix | Delete
super()
[108] Fix | Delete
self.isPermaLink = args[0]
[109] Fix | Delete
self.content = args[1]
[110] Fix | Delete
end
[111] Fix | Delete
end
[112] Fix | Delete
[113] Fix | Delete
alias_method :_PermaLink?, :PermaLink?
[114] Fix | Delete
private :_PermaLink?
[115] Fix | Delete
def PermaLink?
[116] Fix | Delete
perma = _PermaLink?
[117] Fix | Delete
perma or perma.nil?
[118] Fix | Delete
end
[119] Fix | Delete
[120] Fix | Delete
private
[121] Fix | Delete
def maker_target(item)
[122] Fix | Delete
item.guid
[123] Fix | Delete
end
[124] Fix | Delete
[125] Fix | Delete
def setup_maker_attributes(guid)
[126] Fix | Delete
guid.isPermaLink = isPermaLink
[127] Fix | Delete
guid.content = content
[128] Fix | Delete
end
[129] Fix | Delete
end
[130] Fix | Delete
[131] Fix | Delete
end
[132] Fix | Delete
[133] Fix | Delete
end
[134] Fix | Delete
[135] Fix | Delete
end
[136] Fix | Delete
[137] Fix | Delete
RSS09::ELEMENTS.each do |name|
[138] Fix | Delete
BaseListener.install_get_text_element("", name, name)
[139] Fix | Delete
end
[140] Fix | Delete
[141] Fix | Delete
end
[142] Fix | Delete
[143] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function