isis-plugin-bbcworldnews 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/.gitignore +11 -0
- data/.travis.yml +3 -0
- data/Gemfile +4 -0
- data/README.md +23 -0
- data/Rakefile +1 -0
- data/bin/console +14 -0
- data/bin/setup +7 -0
- data/isis-plugin-bbcworldnews.gemspec +22 -0
- data/lib/isis/plugin/bbcworldnews.rb +46 -0
- metadata +81 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 0e3e4d3eb4e8a5c59d683e1bc9b117111d7d904f
|
4
|
+
data.tar.gz: 25fea1c12fc6e760dcbba623c0d5f403ee318090
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1998462b5b7682331dc887f3513fa6fad475d2ac01e6d111ab036018e02c32af3c689874feb816215101bef53ba6cc2e289c5af468e4d074fcac2ed51466e10a
|
7
|
+
data.tar.gz: f8a8dfaa4690c9d4a054af0516927d32d5b9985b4e798c98e533bf50b9f8a94de37ab89a5251346fb59c3ae55f52cae1614c63a13f2c1f04e8c717b8b79f6db6
|
data/.gitignore
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/README.md
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# Isis plugin: BBC World News
|
2
|
+
|
3
|
+
This plugin adds a BBC World News command to the [Isis chatbot](https://github.com/silentgrowl/isis)
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your Isis installation's Gemfile:
|
8
|
+
|
9
|
+
```ruby
|
10
|
+
gem 'isis-plugin-bbcworldnews'
|
11
|
+
```
|
12
|
+
|
13
|
+
And then execute:
|
14
|
+
|
15
|
+
$ bundle
|
16
|
+
|
17
|
+
## Usage
|
18
|
+
|
19
|
+
Trigger a report of the latest news headlines from the BBC by typing ```!bbc``` in chat.
|
20
|
+
|
21
|
+
## Links
|
22
|
+
|
23
|
+
* [isis-plugin-bbcworldnews on RubyGems](https://rubygems.org/gems/isis-plugin-bbcworldnews)
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "isis/plugin/bbcworldnews"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
|
5
|
+
Gem::Specification.new do |spec|
|
6
|
+
spec.name = "isis-plugin-bbcworldnews"
|
7
|
+
spec.version = "1.0.0"
|
8
|
+
spec.authors = ["Brendon Rapp"]
|
9
|
+
spec.email = ["brendon@silentgrowl.com"]
|
10
|
+
|
11
|
+
spec.summary = %q{Isis plugin: BBC World News}
|
12
|
+
spec.description = %q{Isis plugin: BBC World News}
|
13
|
+
spec.homepage = "https://github.com/silentgrowl/isis-plugin-bbcworldnews"
|
14
|
+
|
15
|
+
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
16
|
+
spec.bindir = "exe"
|
17
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
18
|
+
spec.require_paths = ["lib"]
|
19
|
+
|
20
|
+
spec.add_development_dependency "bundler", "~> 1.9"
|
21
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
22
|
+
end
|
@@ -0,0 +1,46 @@
|
|
1
|
+
require "rss"
|
2
|
+
|
3
|
+
module Isis
|
4
|
+
module Plugin
|
5
|
+
class BBCWorldNews < Isis::Plugin::Base
|
6
|
+
def respond_to_msg?(msg, speaker)
|
7
|
+
msg.downcase == '!bbc'
|
8
|
+
end
|
9
|
+
|
10
|
+
private
|
11
|
+
|
12
|
+
def response_html
|
13
|
+
output = %Q[<img src='http://i.imgur.com/jxh78YE.png'> ISIS World News Report] +
|
14
|
+
%Q[- #{timestamp} #{zone} (powered by BBC World News)<br>]
|
15
|
+
feed_items.each do |item|
|
16
|
+
output += %Q[<a href="#{item.link}">#{item.title}</a><br>]
|
17
|
+
end
|
18
|
+
output
|
19
|
+
end
|
20
|
+
|
21
|
+
def response_md
|
22
|
+
output = %Q[ISIS World News Report] +
|
23
|
+
%Q[- #{timestamp} #{zone} (powered by BBC World News)\n]
|
24
|
+
feed_items.each do |item|
|
25
|
+
output += "<#{item.link}|#{item.title}>\n"
|
26
|
+
end
|
27
|
+
output
|
28
|
+
end
|
29
|
+
|
30
|
+
def response_text
|
31
|
+
output = []
|
32
|
+
output.push %Q(ISIS World News Report - #{timestamp} #{zone}) +
|
33
|
+
%Q{ (powered by BBC World News)}
|
34
|
+
feed_items.each do |a|
|
35
|
+
output.push %Q(#{item.title} - #{item.link})
|
36
|
+
end
|
37
|
+
output
|
38
|
+
end
|
39
|
+
|
40
|
+
def feed_items
|
41
|
+
feed = RSS::Parser.parse(open('http://feeds.bbci.co.uk/news/rss.xml'))
|
42
|
+
feed.items.take(5)
|
43
|
+
end
|
44
|
+
end
|
45
|
+
end
|
46
|
+
end
|
metadata
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: isis-plugin-bbcworldnews
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.0.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Brendon Rapp
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2015-05-15 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: bundler
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.9'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.9'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '10.0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '10.0'
|
41
|
+
description: 'Isis plugin: BBC World News'
|
42
|
+
email:
|
43
|
+
- brendon@silentgrowl.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- ".gitignore"
|
49
|
+
- ".travis.yml"
|
50
|
+
- Gemfile
|
51
|
+
- README.md
|
52
|
+
- Rakefile
|
53
|
+
- bin/console
|
54
|
+
- bin/setup
|
55
|
+
- isis-plugin-bbcworldnews.gemspec
|
56
|
+
- lib/isis/plugin/bbcworldnews.rb
|
57
|
+
homepage: https://github.com/silentgrowl/isis-plugin-bbcworldnews
|
58
|
+
licenses: []
|
59
|
+
metadata: {}
|
60
|
+
post_install_message:
|
61
|
+
rdoc_options: []
|
62
|
+
require_paths:
|
63
|
+
- lib
|
64
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
70
|
+
requirements:
|
71
|
+
- - ">="
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
74
|
+
requirements: []
|
75
|
+
rubyforge_project:
|
76
|
+
rubygems_version: 2.2.2
|
77
|
+
signing_key:
|
78
|
+
specification_version: 4
|
79
|
+
summary: 'Isis plugin: BBC World News'
|
80
|
+
test_files: []
|
81
|
+
has_rdoc:
|