stealth-favs 0.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +17 -0
- data/Gemfile +7 -0
- data/LICENSE.txt +22 -0
- data/README.md +29 -0
- data/Rakefile +1 -0
- data/bin/stealth-favs +11 -0
- data/lib/stealth_favs/cli.rb +32 -0
- data/lib/stealth_favs/main.rb +57 -0
- data/lib/stealth_favs/version.rb +5 -0
- data/lib/stealth_favs.rb +6 -0
- data/stealth-favs.gemspec +23 -0
- metadata +85 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 52b9db129c357a1250d15e742478590f3985f848
|
4
|
+
data.tar.gz: b204aec2cd8005568a5edfb3292c5609dfd3601c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: c47098eb02eb0dcf5f8c2ff9e6f4e5b5731f82a2620afd74d5d34f12b1b42897b72cc098dbd604b7c3f95efd1a252858cc6623779c02b97b074eeec5eeee49a2
|
7
|
+
data.tar.gz: 22a32a2fdf3fbf8455eb46da042b30e6be1e013f46365bb96a7412a640c68fb320ec5840e2a518537da0c2c97d7af6720620d1dbb36e118420d263be86a85988
|
data/.gitignore
ADDED
data/Gemfile
ADDED
data/LICENSE.txt
ADDED
@@ -0,0 +1,22 @@
|
|
1
|
+
Copyright (c) 2013 rhysd
|
2
|
+
|
3
|
+
MIT License
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
6
|
+
a copy of this software and associated documentation files (the
|
7
|
+
"Software"), to deal in the Software without restriction, including
|
8
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
9
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
10
|
+
permit persons to whom the Software is furnished to do so, subject to
|
11
|
+
the following conditions:
|
12
|
+
|
13
|
+
The above copyright notice and this permission notice shall be
|
14
|
+
included in all copies or substantial portions of the Software.
|
15
|
+
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
17
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
18
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
19
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
20
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
21
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
22
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
# Stealth::Favs
|
2
|
+
|
3
|
+
TODO: Write a gem description
|
4
|
+
|
5
|
+
## Installation
|
6
|
+
|
7
|
+
Add this line to your application's Gemfile:
|
8
|
+
|
9
|
+
gem 'stealth-favs'
|
10
|
+
|
11
|
+
And then execute:
|
12
|
+
|
13
|
+
$ bundle
|
14
|
+
|
15
|
+
Or install it yourself as:
|
16
|
+
|
17
|
+
$ gem install stealth-favs
|
18
|
+
|
19
|
+
## Usage
|
20
|
+
|
21
|
+
TODO: Write usage instructions here
|
22
|
+
|
23
|
+
## Contributing
|
24
|
+
|
25
|
+
1. Fork it
|
26
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
27
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
28
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
29
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
require "bundler/gem_tasks"
|
data/bin/stealth-favs
ADDED
@@ -0,0 +1,32 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'thor'
|
4
|
+
require 'stealth_favs/main'
|
5
|
+
|
6
|
+
module StealthFavs
|
7
|
+
|
8
|
+
class App < Thor
|
9
|
+
private
|
10
|
+
|
11
|
+
def self.def_command(name)
|
12
|
+
define_method name do |*args|
|
13
|
+
Main::__send__ "cmd_#{name}",options,*args
|
14
|
+
end
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.verbose_option
|
18
|
+
method_option :verbose, :type => :boolean, :aliases => '-v', :default => true, :desc => 'output result'
|
19
|
+
end
|
20
|
+
|
21
|
+
public
|
22
|
+
|
23
|
+
desc 'user [USER]', 'stealth favs to USER'
|
24
|
+
verbose_option
|
25
|
+
def_command :user
|
26
|
+
|
27
|
+
desc 'id [STATUS ID]', 'stealth favs to STATUS'
|
28
|
+
verbose_option
|
29
|
+
def_command :id
|
30
|
+
end
|
31
|
+
|
32
|
+
end # module StealthFavs
|
@@ -0,0 +1,57 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'twitter'
|
4
|
+
require 'yaml'
|
5
|
+
|
6
|
+
module StealthFavs
|
7
|
+
module Main extend self
|
8
|
+
|
9
|
+
# put your authentication keys in ~/.credential.yml
|
10
|
+
CredentialFile = File.expand_path('~') + '/.credential.yml'
|
11
|
+
|
12
|
+
def config_twitter
|
13
|
+
return @client if @client
|
14
|
+
|
15
|
+
yaml = YAML.load(File.open(CredentialFile).read)
|
16
|
+
@client ||= Twitter::Client.new(
|
17
|
+
consumer_key: yaml['consumer_key'],
|
18
|
+
consumer_secret: yaml['consumer_secret'],
|
19
|
+
oauth_token: yaml['oauth_token'],
|
20
|
+
oauth_token_secret: yaml['oauth_token_secret']
|
21
|
+
)
|
22
|
+
end
|
23
|
+
|
24
|
+
private :config_twitter
|
25
|
+
|
26
|
+
def cmd_id(opts, id, num_times = 20)
|
27
|
+
cl = config_twitter
|
28
|
+
(1..num_times).each do |i|
|
29
|
+
cl.favorite id
|
30
|
+
puts "[#{i}] Favorited status #{id}" if opts[:verbose]
|
31
|
+
sleep 0.1
|
32
|
+
cl.unfavorite id
|
33
|
+
puts "[#{i}] Unfavorited status #{id}" if opts[:verbose]
|
34
|
+
sleep 0.1
|
35
|
+
end
|
36
|
+
rescue Twitter::Error::NotFound => e
|
37
|
+
STDERR.puts "status is not found"
|
38
|
+
raise e
|
39
|
+
rescue => e
|
40
|
+
cl.unfavorite id
|
41
|
+
raise e
|
42
|
+
end
|
43
|
+
|
44
|
+
def cmd_user(opts, name, num_times = 20)
|
45
|
+
cl = config_twitter
|
46
|
+
begin
|
47
|
+
id = cl.user_timeline(name).first.id
|
48
|
+
puts "A target status is #{id}." if opts[:verbose]
|
49
|
+
rescue Twitter::Error::NotFound => e
|
50
|
+
STDERR.puts "user is not found"
|
51
|
+
raise e
|
52
|
+
end
|
53
|
+
cmd_id opts, id, num_times
|
54
|
+
end
|
55
|
+
|
56
|
+
end # module Main
|
57
|
+
end # module StealthFavs
|
data/lib/stealth_favs.rb
ADDED
@@ -0,0 +1,23 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'stealth_favs/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "stealth-favs"
|
8
|
+
spec.version = StealthFavs::VERSION
|
9
|
+
spec.authors = ["rhysd"]
|
10
|
+
spec.email = ["lin90162@yahoo.co.jp"]
|
11
|
+
spec.description = %q{Stealth favorites on Twitter.}
|
12
|
+
spec.summary = %q{Repeat fav and unfav many times on Twitter.}
|
13
|
+
spec.homepage = ""
|
14
|
+
spec.license = "MIT"
|
15
|
+
|
16
|
+
spec.files = `git ls-files`.split($/)
|
17
|
+
spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
|
18
|
+
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
|
+
spec.require_paths = ["lib"]
|
20
|
+
|
21
|
+
spec.add_development_dependency "bundler", "~> 1.3"
|
22
|
+
spec.add_development_dependency "rake"
|
23
|
+
end
|
metadata
ADDED
@@ -0,0 +1,85 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: stealth-favs
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.0.1
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- rhysd
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2013-05-30 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.3'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - ~>
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.3'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: rake
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - '>='
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '0'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - '>='
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '0'
|
41
|
+
description: Stealth favorites on Twitter.
|
42
|
+
email:
|
43
|
+
- lin90162@yahoo.co.jp
|
44
|
+
executables:
|
45
|
+
- stealth-favs
|
46
|
+
extensions: []
|
47
|
+
extra_rdoc_files: []
|
48
|
+
files:
|
49
|
+
- .gitignore
|
50
|
+
- Gemfile
|
51
|
+
- LICENSE.txt
|
52
|
+
- README.md
|
53
|
+
- Rakefile
|
54
|
+
- bin/stealth-favs
|
55
|
+
- lib/stealth_favs.rb
|
56
|
+
- lib/stealth_favs/cli.rb
|
57
|
+
- lib/stealth_favs/main.rb
|
58
|
+
- lib/stealth_favs/version.rb
|
59
|
+
- stealth-favs.gemspec
|
60
|
+
homepage: ''
|
61
|
+
licenses:
|
62
|
+
- MIT
|
63
|
+
metadata: {}
|
64
|
+
post_install_message:
|
65
|
+
rdoc_options: []
|
66
|
+
require_paths:
|
67
|
+
- lib
|
68
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
69
|
+
requirements:
|
70
|
+
- - '>='
|
71
|
+
- !ruby/object:Gem::Version
|
72
|
+
version: '0'
|
73
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
74
|
+
requirements:
|
75
|
+
- - '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
requirements: []
|
79
|
+
rubyforge_project:
|
80
|
+
rubygems_version: 2.0.2
|
81
|
+
signing_key:
|
82
|
+
specification_version: 4
|
83
|
+
summary: Repeat fav and unfav many times on Twitter.
|
84
|
+
test_files: []
|
85
|
+
has_rdoc:
|