grailbird_updater 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +112 -112
- data/grailbird_updater.gemspec +0 -1
- data/lib/grailbird_updater.rb +3 -3
- data/lib/grailbird_updater/version.rb +1 -1
- metadata +15 -43
- data/test/grailbird_updater_test.rb +0 -12
- data/test/test_helper.rb +0 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 247f2aebfc95feb7b5940490810f185e2b604172
|
4
|
+
data.tar.gz: c81361008b3c91e1cbf5490754dbfe98523c8659
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: aedc862dcf58dae6aa349ff161062a8142f752a78480ba6963c0ef8d4b2b8565ac684487174c3c089707938eb0ebb678c1cb77f26345511f70077fc509c18c1a
|
7
|
+
data.tar.gz: 45279f4c9099a268f21c1de13ea4ecff20a15c9f55a4ef26fb9a21032933c01e83a85dbd446e0327f010084406b68d8c10dcf17ec771045b4ee249458fe8c278
|
data/README.md
CHANGED
@@ -1,112 +1,112 @@
|
|
1
|
-
# GrailbirdUpdater
|
2
|
-
|
3
|
-
For the most of the people who know me online, I've been dying to get a copy of
|
4
|
-
my Twitter archive from Twitter for forever. I was finally given one and
|
5
|
-
decided to write a quick script to keep my own archive up-to-date.
|
6
|
-
|
7
|
-
Turns out the contents in the archive are partial/trimmed API responses from
|
8
|
-
the Twitter API, so it is actually possible to drop a whole API response in
|
9
|
-
there, do some sorting and update the archive.
|
10
|
-
|
11
|
-
|
12
|
-
## Installation
|
13
|
-
|
14
|
-
Install it yourself as:
|
15
|
-
|
16
|
-
$ gem install grailbird_updater
|
17
|
-
|
18
|
-
Or add this line to your application's Gemfile:
|
19
|
-
|
20
|
-
gem 'grailbird_updater'
|
21
|
-
|
22
|
-
And then execute:
|
23
|
-
|
24
|
-
$ bundle
|
25
|
-
|
26
|
-
## Usage
|
27
|
-
|
28
|
-
```
|
29
|
-
grailbird_updater /path/to/twitter/archive
|
30
|
-
```
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
│
|
89
|
-
|
90
|
-
│
|
91
|
-
│
|
92
|
-
│
|
93
|
-
│ ├──
|
94
|
-
│ ├──
|
95
|
-
│ ├──
|
96
|
-
│ │ ├──
|
97
|
-
│ │
|
98
|
-
│ │ ├──
|
99
|
-
│ │
|
100
|
-
│ │
|
101
|
-
│
|
102
|
-
|
103
|
-
│
|
104
|
-
├──
|
105
|
-
|
106
|
-
|
107
|
-
├──
|
108
|
-
│
|
109
|
-
|
110
|
-
|
111
|
-
```
|
112
|
-
|
1
|
+
# GrailbirdUpdater
|
2
|
+
|
3
|
+
For the most of the people who know me online, I've been dying to get a copy of
|
4
|
+
my Twitter archive from Twitter for forever. I was finally given one and
|
5
|
+
decided to write a quick script to keep my own archive up-to-date.
|
6
|
+
|
7
|
+
Turns out the contents in the archive are partial/trimmed API responses from
|
8
|
+
the Twitter API, so it is actually possible to drop a whole API response in
|
9
|
+
there, do some sorting and update the archive.
|
10
|
+
|
11
|
+
|
12
|
+
## Installation
|
13
|
+
|
14
|
+
Install it yourself as:
|
15
|
+
|
16
|
+
$ gem install grailbird_updater
|
17
|
+
|
18
|
+
Or add this line to your application's Gemfile:
|
19
|
+
|
20
|
+
gem 'grailbird_updater'
|
21
|
+
|
22
|
+
And then execute:
|
23
|
+
|
24
|
+
$ bundle
|
25
|
+
|
26
|
+
## Usage
|
27
|
+
|
28
|
+
```
|
29
|
+
grailbird_updater /path/to/twitter/archive
|
30
|
+
```
|
31
|
+
|
32
|
+
To run as a cronjob, with the gem installed using rvm (at `/home/username/grailbird` in this example)
|
33
|
+
|
34
|
+
```
|
35
|
+
@daily /bin/bash -l -c 'cd /home/username/grailbird && grailbird_updater /path/to/twitter/archive'
|
36
|
+
```
|
37
|
+
|
38
|
+
## Contributing
|
39
|
+
|
40
|
+
1. Fork it
|
41
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
42
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
43
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
44
|
+
5. Create new Pull Request
|
45
|
+
|
46
|
+
## FAQ
|
47
|
+
|
48
|
+
* _I have a protected Twitter account, can I still use this updater with my Twitter archive?_
|
49
|
+
|
50
|
+
Actually, yes! Like with any account, as of v0.5.0, you will need to create your own "application" on
|
51
|
+
Twitter and then use your own consumer key/secret pair to let the application
|
52
|
+
use the oauth tokens for a user and then follow the authorization steps for
|
53
|
+
a given user.
|
54
|
+
|
55
|
+
Once you have auth'd the application for a user, you do not have to do
|
56
|
+
it again, the consumer key/secret and oauth token/secret are stored in a YAML file
|
57
|
+
at the root of your tweet archive (or a user specified locationo, if the --key-path flag is used).
|
58
|
+
|
59
|
+
__IMPORTANT__ Do NOT commit or post your own consumer key/secret or your oauth
|
60
|
+
token/secret anywhere.
|
61
|
+
|
62
|
+
Note: you will only need to create a single application on Twitter even if you
|
63
|
+
are using this to update multiple accounts. You can reuse the consumer
|
64
|
+
key/secret and just authorize each account individually.
|
65
|
+
|
66
|
+
Please see [this wiki article](https://github.com/DeMarko/grailbird_updater/wiki/Authorizing-grailbird_updater) for step-by-step instructions.
|
67
|
+
|
68
|
+
* _How do I know if I have a Twitter archive?_
|
69
|
+
|
70
|
+
Hopefully, you downloaded it from Twitter once the feature was made available
|
71
|
+
to you and have their web application which can consume it.
|
72
|
+
|
73
|
+
This gem only modifies what's in the `data` directory for a given archive,
|
74
|
+
the rest of the files are provided by Twitter.
|
75
|
+
|
76
|
+
To check if you can download a copy of your Twitter archive, go to your
|
77
|
+
[Account Settings](https://twitter.com/settings/account) and scroll all
|
78
|
+
the way to the bottom. If the feature is enabled for you, you should see
|
79
|
+
a section labeled "Your Twitter Archive".
|
80
|
+
|
81
|
+
The file structure looks somewhat like this (as of 09.04.13):
|
82
|
+
|
83
|
+
|
84
|
+
```
|
85
|
+
tweets
|
86
|
+
├── README.txt
|
87
|
+
├── css
|
88
|
+
│ └─ application.min.css
|
89
|
+
├── data
|
90
|
+
│ └── js
|
91
|
+
│ ├── payload_details.js
|
92
|
+
│ ├── tweet_index.js
|
93
|
+
│ ├── tweets
|
94
|
+
│ │ ├── 2007_03.js
|
95
|
+
│ │ ├── 2007_04.js
|
96
|
+
│ │ ├── 2007_05.js
|
97
|
+
│ │ ├─ ... // you get the idea, I've been on Twitter a while
|
98
|
+
│ │ ├── 2013_02.js
|
99
|
+
│ │ ├── 2013_03.js
|
100
|
+
│ │ └── 2013_04.js
|
101
|
+
│ └── user_details.js
|
102
|
+
├── img
|
103
|
+
│ └─ ... // provided by Twitter
|
104
|
+
├── index.html
|
105
|
+
├── js
|
106
|
+
│ └─ ... // provided by Twitter
|
107
|
+
├── lib
|
108
|
+
│ └─ ... // provided by Twitter
|
109
|
+
├── README.txt
|
110
|
+
└── tweets.csv
|
111
|
+
```
|
112
|
+
|
data/grailbird_updater.gemspec
CHANGED
data/lib/grailbird_updater.rb
CHANGED
@@ -147,7 +147,7 @@ class GrailbirdUpdater
|
|
147
147
|
end
|
148
148
|
|
149
149
|
def get_twitter_user_timeline_response(screen_name, user_id, last_tweet_id)
|
150
|
-
twitter_url = "
|
150
|
+
twitter_url = "https://api.twitter.com/1.1/statuses/user_timeline.json"
|
151
151
|
twitter_uri = URI(twitter_url)
|
152
152
|
|
153
153
|
params = {
|
@@ -236,7 +236,7 @@ EOS
|
|
236
236
|
consumer = OAuth::Consumer.new(
|
237
237
|
consumer_key,
|
238
238
|
consumer_secret,
|
239
|
-
{ :site => '
|
239
|
+
{ :site => 'https://api.twitter.com/',
|
240
240
|
:request_token_path => '/oauth/request_token',
|
241
241
|
:access_token_path => '/oauth/access_token',
|
242
242
|
:authorize_path => '/oauth/authorize' }
|
@@ -271,7 +271,7 @@ EOS
|
|
271
271
|
|
272
272
|
def prepare_access_token(consumer_key, consumer_secret, oauth_token, oauth_token_secret)
|
273
273
|
consumer = OAuth::Consumer.new(consumer_key, consumer_secret,
|
274
|
-
{ :site => "
|
274
|
+
{ :site => "https://api.twitter.com",
|
275
275
|
:scheme => :header
|
276
276
|
})
|
277
277
|
# now create the access token object from passed values
|
metadata
CHANGED
@@ -1,78 +1,55 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: grailbird_updater
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
5
|
-
prerelease:
|
4
|
+
version: 0.5.1
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Dannel Jurado
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2014-01-16 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: oauth
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :runtime
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: trollop
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :runtime
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: colorize
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :runtime
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
60
|
-
- !ruby/object:Gem::Version
|
61
|
-
version: '0'
|
62
|
-
- !ruby/object:Gem::Dependency
|
63
|
-
name: minitest
|
64
|
-
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
|
-
requirements:
|
67
|
-
- - ! '>='
|
68
|
-
- !ruby/object:Gem::Version
|
69
|
-
version: '0'
|
70
|
-
type: :runtime
|
71
|
-
prerelease: false
|
72
|
-
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
|
-
requirements:
|
75
|
-
- - ! '>='
|
52
|
+
- - ">="
|
76
53
|
- !ruby/object:Gem::Version
|
77
54
|
version: '0'
|
78
55
|
description: Twitter now allows you to download your tweets. This tool lets you keep
|
@@ -84,7 +61,7 @@ executables:
|
|
84
61
|
extensions: []
|
85
62
|
extra_rdoc_files: []
|
86
63
|
files:
|
87
|
-
- .gitignore
|
64
|
+
- ".gitignore"
|
88
65
|
- Gemfile
|
89
66
|
- LICENSE.txt
|
90
67
|
- README.md
|
@@ -93,32 +70,27 @@ files:
|
|
93
70
|
- grailbird_updater.gemspec
|
94
71
|
- lib/grailbird_updater.rb
|
95
72
|
- lib/grailbird_updater/version.rb
|
96
|
-
- test/grailbird_updater_test.rb
|
97
|
-
- test/test_helper.rb
|
98
73
|
homepage: https://github.com/DeMarko/grailbird_updater
|
99
74
|
licenses: []
|
75
|
+
metadata: {}
|
100
76
|
post_install_message:
|
101
77
|
rdoc_options: []
|
102
78
|
require_paths:
|
103
79
|
- lib
|
104
80
|
required_ruby_version: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
81
|
requirements:
|
107
|
-
- -
|
82
|
+
- - ">="
|
108
83
|
- !ruby/object:Gem::Version
|
109
84
|
version: '0'
|
110
85
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
111
|
-
none: false
|
112
86
|
requirements:
|
113
|
-
- -
|
87
|
+
- - ">="
|
114
88
|
- !ruby/object:Gem::Version
|
115
89
|
version: '0'
|
116
90
|
requirements: []
|
117
91
|
rubyforge_project:
|
118
|
-
rubygems_version:
|
92
|
+
rubygems_version: 2.2.0
|
119
93
|
signing_key:
|
120
|
-
specification_version:
|
94
|
+
specification_version: 4
|
121
95
|
summary: A way to keep an updated archive of Twitter tweets.
|
122
|
-
test_files:
|
123
|
-
- test/grailbird_updater_test.rb
|
124
|
-
- test/test_helper.rb
|
96
|
+
test_files: []
|
@@ -1,12 +0,0 @@
|
|
1
|
-
require 'minitest/autorun'
|
2
|
-
|
3
|
-
require 'grailbird_updater'
|
4
|
-
|
5
|
-
class GrailbirdUpdaterTest < Minitest::Unit::TestCase
|
6
|
-
|
7
|
-
# this test is stupid, just there to demonstrate infrastructure
|
8
|
-
def test_creation
|
9
|
-
assert_kind_of GrailbirdUpdater, GrailbirdUpdater.new(".", 10, true)
|
10
|
-
end
|
11
|
-
end
|
12
|
-
|
data/test/test_helper.rb
DELETED
File without changes
|