Socket
Book a DemoInstallSign in
Socket

asakusa-rss-monitor

Package Overview
Dependencies
Maintainers
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

asakusa-rss-monitor

0.0.4
bundlerRubygems
Version published
Maintainers
1
Created
Source

asakusa-rss-monitor

To post rss updates on AsakusaSatellite.

Installation

gem install asakusa-rss-monitor

Basic Usage

monitor = AsakusaRssMonitor.new({
  :check_file => 'last_time.txt',
  :rss_url => '<TARGET RSS>',
  :bot_config => AsakusaRssMonitor::BotConfig.new({
    :api_key => '<YOUR AS API KEY>',
    :entry_point => '<YOUR AS ENTRY POINT>', # cf. 'http://localhost:3000/api/v1'
    :room_id => '<ROOM ID>'
  })
})
monitor.call

Post Message Customizing

class CustomMonitor < AsakusaRssMonitor::RssMonitor
  def initialize(config)
    super(config)
  end

  # override this.
  def perform(rss_entry)
    "New Article. - #{rss_entry.date}\n#{rss_entry.title}\n#{rss_entry.link}"
  end
end

Monitoring RSS

To monitoring rss, you can use this script with cron or some nice libraries like clockwork.

Using clockwork

gem install clockwork

Create clock.rb:

require 'clockwork'
require 'asakusa-rss-monitor'
include Clockwork

handler do |job|
  job.call
end

monitor = AsakusaRssMonitor::RssMonitor.new({..})
another_monitor = AsakusaRssMonitor::RssMonitor.new({..}) # if you want to monitor another RSS.
every(5.minutes, monitor)
every(5.minutes, another_monitor)

Run it with the clockwork binary:

clockwork clock.rb

If you want to daemonize it, see Daemonization page on clockwork.

Milestone

  • spec..

FAQs

Package last updated on 19 Jan 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.