Skip to content

Commit

Permalink
不具合を修正
Browse files Browse the repository at this point in the history
  • Loading branch information
toshiemon18 committed Aug 31, 2014
1 parent 2ced368 commit eecf87b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
1 change: 0 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
source "https://rubygems.org"

gem "json", "~> 1.8.1"
gem "evernote_oauth", "~> 0.2.3"
gem "oauth"
gem "sinatra"
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ TweetNote

##Installation
cnf/\_tweetnote_config.jsonの"\_"をファイル名から削除してください
コンシューマキーなどは含まれていません
コンシューマキーなどは含まれていませんので、自身で用意するかなにかしてください
###Requirements
System :

Ruby2.0.0
Devkit
gems:

evernote_oauth
Expand Down
8 changes: 5 additions & 3 deletions lib/twitnote.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
require 'openssl'
require 'json'

include Tweetlib

#なんかこの一行がないとEvernote側の通信がこける
#そのくせ警告だして来るしたぶんEvernoteOauthが悪い
OpenSSL::SSL::VERIFY_PEER = OpenSSL::SSL::VERIFY_NONE
Expand All @@ -25,7 +27,7 @@ def initialize
evernote_config = setup.evernote_setup
@tweetnote_config = setup.tweetnote_setup

@twitclient = Tweetlib::Client.new(twitter_config.values)
@twitclient = Client.new(twitter_config.values)
@me = @twitclient.fetch_account_info
@token = evernote_config["token"]
@client = EvernoteOAuth::Client.new(
Expand Down Expand Up @@ -88,7 +90,7 @@ def check_tweet_text(status)

def extract_tgas(status)
hashtags = []
status["entities"]["hashtags"].each { |tag| hashtags << tag["text"] unless tag["text"] == "tweetnote" }
status["entities"]["hashtags"].each { |tag| hashtags << tag["text"].to_s }
return hashtags
end

Expand All @@ -97,7 +99,7 @@ def tweet_demolish(status_text, hashtags)
hashtags.each do |tag|
tweet_text.to_s.slice!("#" + "#{tag}" + " ")
end
return tweet_text.to_s.slice!("#tweetnote ")
tweet_text
end

def process_exist?(status_text)
Expand Down

0 comments on commit eecf87b

Please sign in to comment.