neo4apis-twitter 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 840743cd0672c0969082835882e1ed4d27b3c107
4
- data.tar.gz: 4c0cf345be185f73c596e4a112333da92887031f
3
+ metadata.gz: 71e1141ee25fc7f64d4300313d81c784a609a655
4
+ data.tar.gz: 8f056f27356a4c52bfebbb183fa204e272c9f9c2
5
5
  SHA512:
6
- metadata.gz: d7f1c7f459200a76e5099ea52f33346861463d7eac236740fc8ac932fc964f2514a63eaa2081069244a7af1a4bc5d5ee7c44adc0db740bf56c9d3f2bf12e7e81
7
- data.tar.gz: 4594fd889423d2bda827778c87f5446d38fabd1f76bb5a4b256da5464ec05af3db316076329e5749302464f99a8bf02caefa05d4fd306ba841b09d12e37a36b0
6
+ metadata.gz: 7bf71bfc3c87e148c523868cd9229ea39e958369e7c271b84a73bd614c1734ddab57a0f5db9a8287bc6b40c15a1b75620ee8bb4bb659f83826ca34c82f724dbc
7
+ data.tar.gz: b48c79a734ec21a7dd4bc6fa25f5333d6421fae4d94f031d61dcb10dd72b375a4a589d3c85aacad6bc6349e99e6a3ba6bbe0a5c40c5dbd5b798b218bc910fe72
data/README.md CHANGED
@@ -7,7 +7,9 @@ This adapter supports objects created from the `twitter` gem.
7
7
 
8
8
  twitter_client = Twitter::REST::Client.new ...
9
9
 
10
- neo4japis_twitter = Neo4Apis::Twitter.new(Neo4j::Session.open, import_retweets: true, import_hashtags: true)
10
+ neo4japis_twitter = Neo4Apis::Twitter.new(Neo4j::Session.open,
11
+ import_retweets: true,
12
+ import_hashtags: true)
11
13
 
12
14
  neo4japis_twitter.batch do
13
15
  twitter_client.search("ebola", :result_type => "recent").take(100).each do |tweet|
@@ -11,10 +11,7 @@ module Neo4Apis
11
11
 
12
12
  retweeted_tweet_node = import :Tweet, tweet.retweeted_tweet if options[:import_retweets] && tweet.retweeted_tweet?
13
13
 
14
- node = add_node :Tweet, {
15
- id: tweet.id,
16
- text: tweet.text,
17
- }
14
+ node = add_node :Tweet, tweet, %w{id text}
18
15
 
19
16
  if options[:import_hashtags] && tweet.respond_to?(:hashtags)
20
17
  tweet.hashtags.each do |hashtag|
@@ -32,23 +29,19 @@ module Neo4Apis
32
29
  end
33
30
 
34
31
  importer :User do |user|
35
- add_node :User, {
36
- id: user.id,
37
- screen_name: user.screen_name,
38
- name: user.name,
39
- location: user.location,
40
- profile_image_url: user.profile_image_url.to_s
41
- }
32
+ add_node(:User, user, %w{id screen_name name location}) do |node|
33
+ node.profile_image_url = user.profile_image_url.to_s
34
+ end
42
35
  end
43
36
 
44
37
  importer :HashTag do |hashtag|
45
- add_node :HashTag, {
46
- text: hashtag.text.downcase
47
- }
38
+ add_node :HashTag do |node|
39
+ node.text = hashtag.text.downcase
40
+ end
48
41
  end
49
42
 
50
43
  def self.default_flush_size
51
- 3000
44
+ 1000
52
45
  end
53
46
 
54
47
  end
@@ -3,7 +3,7 @@ $:.unshift lib unless $:.include?(lib)
3
3
 
4
4
  Gem::Specification.new do |s|
5
5
  s.name = "neo4apis-twitter"
6
- s.version = '0.0.4'
6
+ s.version = '0.0.5'
7
7
  s.required_ruby_version = ">= 1.9.1"
8
8
 
9
9
  s.authors = "Brian Underwood"
@@ -18,7 +18,7 @@ A ruby gem using neo4apis to make importing twitter data to neo4j easy
18
18
  s.require_path = 'lib'
19
19
  s.files = Dir.glob("{bin,lib,config}/**/*") + %w(README.md Gemfile neo4apis-twitter.gemspec)
20
20
 
21
- s.add_dependency('neo4apis', "~> 0.0.4")
21
+ s.add_dependency('neo4apis', "~> 0.1.0")
22
22
  s.add_dependency('twitter', "~> 5.12.0")
23
23
 
24
24
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: neo4apis-twitter
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
4
+ version: 0.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brian Underwood
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.0.4
19
+ version: 0.1.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.0.4
26
+ version: 0.1.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: twitter
29
29
  requirement: !ruby/object:Gem::Requirement