Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 19 additions & 26 deletions plugins/subscription/text.rb
Original file line number Diff line number Diff line change
@@ -1,32 +1,22 @@
# -*- coding: utf-8 -*-
# Name:: Automatic::Plugin::Subscription::Text
# Author:: soramugi <http://soramugi.net>
# Created:: May 6, 2013
# Updated:: May 6, 2013
# Copyright:: Copyright (c) 2012-2013 Automatic Ruby Developers.
# 774 <http://id774.net>
# Created:: May 6, 2013
# Updated:: Feb 19, 2014
# Copyright:: Copyright (c) 2012-2014 Automatic Ruby Developers.
# License:: Licensed under the GNU GENERAL PUBLIC LICENSE, Version 3.0.

module Automatic::Plugin
class TextFeed
def initialize
@link = 'http://dummy'
@title = 'dummy'
end

def link
@link
end

def title
@title
end
attr_accessor :title, :link, :description, :author, :comments

def set_link(link)
@link = link
end

def set_title(title)
@title = title
def initialize
@link = 'http://dummy'
@title = 'dummy'
@description = ''
@author = ''
@comments = ''
end
end

Expand All @@ -41,29 +31,32 @@ def initialize(config, pipeline=[])
unless @config['titles'].nil?
@config['titles'].each {|title|
textFeed = TextFeed.new
textFeed.set_title(title)
textFeed.title = title
@dummyfeeds << textFeed
}
end

unless @config['urls'].nil?
@config['urls'].each {|url|
textFeed = TextFeed.new
textFeed.set_link(url)
textFeed.link = url
@dummyfeeds << textFeed
}
end

unless @config['feeds'].nil?
@config['feeds'].each {|feed|
textFeed = TextFeed.new
textFeed.set_title(feed['title']) unless feed['title'].nil?
textFeed.set_link(feed['url']) unless feed['url'].nil?
textFeed.title = feed['title'] unless feed['title'].nil?
textFeed.link = feed['url'] unless feed['url'].nil?
textFeed.description = feed['description'] unless feed['description'].nil?
textFeed.author = feed['author'] unless feed['author'].nil?
textFeed.comments = feed['comments'] unless feed['comments'].nil?
@dummyfeeds << textFeed
}
end
end

end
end

def run
Expand Down