Browse Source

Revert failed April Fool's Day joke

This reverts commit f8eec3523a.
master
Daniel Muckerman 8 years ago
parent
commit
22ab8d74d0
4 changed files with 2 additions and 24 deletions
  1. +0
    -1
      Gemfile
  2. +0
    -2
      Gemfile.lock
  3. +0
    -1
      slack-pixiv.rb
  4. +2
    -20
      slack-pixiv/commands/pixiv.rb

+ 0
- 1
Gemfile View File

@ -7,7 +7,6 @@ gem 'wolfram'
gem 'puma' gem 'puma'
gem 'sinatra' gem 'sinatra'
gem 'mechanize' gem 'mechanize'
gem 'xml-simple'
gem 'nokogiri' gem 'nokogiri'
group :development, :test do group :development, :test do

+ 0
- 2
Gemfile.lock View File

@ -107,7 +107,6 @@ GEM
websocket-extensions (0.1.2) websocket-extensions (0.1.2)
wolfram (0.2.1) wolfram (0.2.1)
nokogiri (>= 1.4.3) nokogiri (>= 1.4.3)
xml-simple (1.1.5)
PLATFORMS PLATFORMS
ruby ruby
@ -123,7 +122,6 @@ DEPENDENCIES
sinatra sinatra
slack-ruby-bot (~> 0.6.0) slack-ruby-bot (~> 0.6.0)
wolfram wolfram
xml-simple
BUNDLED WITH BUNDLED WITH
1.11.2 1.11.2

+ 0
- 1
slack-pixiv.rb View File

@ -1,7 +1,6 @@
require 'slack-ruby-bot' require 'slack-ruby-bot'
require 'wolfram' require 'wolfram'
require 'mechanize' require 'mechanize'
require 'xmlsimple'
require 'nokogiri' require 'nokogiri'
require 'slack-pixiv/commands/pixiv' require 'slack-pixiv/commands/pixiv'
require 'slack-pixiv/app' require 'slack-pixiv/app'

+ 2
- 20
slack-pixiv/commands/pixiv.rb View File

@ -7,9 +7,6 @@ module SlackMathbot
# Initalize Mechanize # Initalize Mechanize
agent = Mechanize.new agent = Mechanize.new
# Get time
time = Time.now
# Create Pixiv URL # Create Pixiv URL
pixiv_url = "http://www.pixiv.net" + _match[:url][0..-2] pixiv_url = "http://www.pixiv.net" + _match[:url][0..-2]
puts pixiv_url puts pixiv_url
@ -30,23 +27,8 @@ module SlackMathbot
puts title puts title
# Scrape image # Scrape image
r = Range.new(
Time.local(time.year, time.month, time.day, 12),
Time.local(time.year, time.month, time.day, 20)
) === time
if ((Date.today.to_s == "2016-04-01") && (r))
api_url = "http://rule34.paheal.net/api/danbooru/find_posts/index.xml"
agent.get(api_url)
xml = agent.current_page.body
status = XmlSimple.xml_in(xml)
image_url = status["post"].sample["file_url"]
puts agent.get(pixiv_url).images_with(:src => /600x600\/img-master/)[0].to_s.sub! '600x600','480x960'
else
image_url = agent.get(pixiv_url).images_with(:src => /600x600\/img-master/)[0].to_s.sub! '600x600','480x960'
puts image_url
end
image_url = agent.get(pixiv_url).images_with(:src => /600x600\/img-master/)[0].to_s.sub! '600x600','480x960'
puts image_url
client.web_client.chat_postMessage( client.web_client.chat_postMessage(
channel: _data.channel, channel: _data.channel,

Loading…
Cancel
Save