datasift 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +3 -1
- data/VERSION +1 -1
- data/examples/historics/create-from-csdl.rb +6 -6
- data/examples/historics/create-from-hash.rb +6 -6
- data/examples/push/push-stream-from-csdl.rb +2 -2
- data/lib/DataSift/historic.rb +2 -1
- metadata +4 -4
data/README.md
CHANGED
@@ -19,7 +19,7 @@ If you're using the source you'll need to install the dependencies.
|
|
19
19
|
sudo gem install yajl-ruby rest-client
|
20
20
|
|
21
21
|
The library will use SSL connections by default. While we recommend using SSL
|
22
|
-
you may disable it if
|
22
|
+
you may disable it if required by passing false as the third parameter when
|
23
23
|
creating a user, or by calling user.enableSSL(false) on the user object.
|
24
24
|
|
25
25
|
Simple example
|
@@ -56,6 +56,8 @@ more details.
|
|
56
56
|
Changelog
|
57
57
|
---------
|
58
58
|
|
59
|
+
* v.2.0.2 Added missing Historic sample size into historic/prepare requests (2012-12-03)
|
60
|
+
|
59
61
|
* v.2.0.1 Fixed a bug that was preventing streaming connections from being established (2012-09-03)
|
60
62
|
|
61
63
|
* v.2.0.0 Added support for Historics queries and Push delivery (2012-08-31)
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0.
|
1
|
+
2.0.2
|
@@ -11,18 +11,18 @@ def usage(message = '', end_of_story = true)
|
|
11
11
|
puts message + '\n' unless message.length() == 0
|
12
12
|
puts
|
13
13
|
puts 'Usage: create-from-csdl <username> <api_key> \\'
|
14
|
-
puts ' <csdl_filename> <start> <end> <sources> <
|
14
|
+
puts ' <csdl_filename> <start> <end> <sources> <sample> <name>'
|
15
15
|
puts
|
16
16
|
puts 'Where: csdl_filename = the stream hash the query should run'
|
17
17
|
puts ' start = the start date for the query (YYYYMMDDHHMMSS)'
|
18
18
|
puts ' end = the end date for the query (YYYYMMDDHHMMSS)'
|
19
19
|
puts ' sources = comma separated list of data sources (e.g. twitter)'
|
20
|
-
puts ' name = a friendly name for the query'
|
21
20
|
puts ' sample = the sample rate'
|
21
|
+
puts ' name = a friendly name for the query'
|
22
22
|
puts
|
23
23
|
puts 'Example'
|
24
24
|
puts ' create-from-csdl csdl.txt 20120101000000 20120101235959 \\'
|
25
|
-
puts ' twitter HistoricsQuery123
|
25
|
+
puts ' twitter 100 HistoricsQuery123'
|
26
26
|
puts
|
27
27
|
exit 1 unless not end_of_story
|
28
28
|
end
|
@@ -42,8 +42,8 @@ csdl_filename = env.args[0]
|
|
42
42
|
start_date = env.args[1]
|
43
43
|
end_date = env.args[2]
|
44
44
|
sources = env.args[3].split(',')
|
45
|
-
|
46
|
-
|
45
|
+
sample = env.args[4]
|
46
|
+
name = env.args[5]
|
47
47
|
|
48
48
|
# Parse the dates
|
49
49
|
start_date = DateTime.strptime(start_date, '%Y%m%d%H%M%S')
|
@@ -57,7 +57,7 @@ begin
|
|
57
57
|
definition = env.user.createDefinition(csdl)
|
58
58
|
|
59
59
|
# Create the Historics query
|
60
|
-
historic = definition.createHistoric(start_date, end_date, sources,
|
60
|
+
historic = definition.createHistoric(start_date, end_date, sources, sample, name)
|
61
61
|
|
62
62
|
# Prepare the query
|
63
63
|
historic.prepare()
|
@@ -11,18 +11,18 @@ def usage(message = '', end_of_story = true)
|
|
11
11
|
puts message + '\n' unless message.length() == 0
|
12
12
|
puts
|
13
13
|
puts 'Usage: create-from-hash \\'
|
14
|
-
puts ' <username> <api_key> <hash> <start> <end> <sources> <
|
14
|
+
puts ' <username> <api_key> <hash> <start> <end> <sources> <sample> <name>'
|
15
15
|
puts
|
16
16
|
puts 'Where: hash = the stream hash the query should run'
|
17
17
|
puts ' start = the start date for the query (YYYYMMDDHHMMSS)'
|
18
18
|
puts ' end = the end date for the query (YYYYMMDDHHMMSS)'
|
19
19
|
puts ' sources = comma separated list of data sources (e.g. twitter)'
|
20
|
-
puts ' name = a friendly name for the query'
|
21
20
|
puts ' sample = the sample rate'
|
21
|
+
puts ' name = a friendly name for the query'
|
22
22
|
puts
|
23
23
|
puts 'Example'
|
24
24
|
puts ' create-from-hash <hash> 20120101000000 20120101235959 \\'
|
25
|
-
puts ' twitter HistoricsQuery123
|
25
|
+
puts ' twitter 100 HistoricsQuery123'
|
26
26
|
puts
|
27
27
|
exit 1 unless not end_of_story
|
28
28
|
end
|
@@ -42,8 +42,8 @@ stream_hash = env.args[0]
|
|
42
42
|
start_date = env.args[1]
|
43
43
|
end_date = env.args[2]
|
44
44
|
sources = env.args[3].split(',')
|
45
|
-
|
46
|
-
|
45
|
+
sample = env.args[4]
|
46
|
+
name = env.args[5]
|
47
47
|
|
48
48
|
# Parse the dates
|
49
49
|
start_date = DateTime.strptime(start_date, '%Y%m%d%H%M%S')
|
@@ -51,7 +51,7 @@ end_date = DateTime.strptime(end_date, '%Y%m%d%H%M%S')
|
|
51
51
|
|
52
52
|
begin
|
53
53
|
# Create the Historics query
|
54
|
-
historic = env.user.createHistoric(stream_hash, start_date, end_date, sources,
|
54
|
+
historic = env.user.createHistoric(stream_hash, start_date, end_date, sources, sample, name)
|
55
55
|
|
56
56
|
# Prepare the query
|
57
57
|
historic.prepare()
|
@@ -14,7 +14,7 @@ require File.dirname(__FILE__) + '/env'
|
|
14
14
|
def usage(message = '', end_of_story = true)
|
15
15
|
puts message + '\n' unless message.length() == 0
|
16
16
|
puts
|
17
|
-
puts 'Usage: push-stream-from-csdl.
|
17
|
+
puts 'Usage: push-stream-from-csdl.rb <username> <api_key> \\'
|
18
18
|
puts ' <csdl_filename> <output_type> <name> ...'
|
19
19
|
puts
|
20
20
|
puts 'Where: csdl_filename = a file containing the CSDL'
|
@@ -23,7 +23,7 @@ def usage(message = '', end_of_story = true)
|
|
23
23
|
puts ' key=val = output_type-specific arguments'
|
24
24
|
puts
|
25
25
|
puts 'Example'
|
26
|
-
puts ' push-stream-from-csdl.
|
26
|
+
puts ' push-stream-from-csdl.rb csdl.txt http PushName delivery_frequency=10 \\'
|
27
27
|
puts ' url=http://www.example.com/push_endpoint auth.type=none'
|
28
28
|
puts
|
29
29
|
exit 1 unless not end_of_story
|
data/lib/DataSift/historic.rb
CHANGED
@@ -212,7 +212,8 @@ module DataSift
|
|
212
212
|
'start' => Integer(@start_date.strftime('%s')),
|
213
213
|
'end' => Integer(@end_date.strftime('%s')),
|
214
214
|
'name' => @name,
|
215
|
-
'sources' => @sources.join(',')
|
215
|
+
'sources' => @sources.join(','),
|
216
|
+
'sample' => @sample
|
216
217
|
})
|
217
218
|
|
218
219
|
raise InvalidDataError, 'Prepared successfully but no playback ID in the response' unless res.has_key?('id')
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: datasift
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 11
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 2.0.
|
9
|
+
- 2
|
10
|
+
version: 2.0.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- DataSift
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2012-
|
18
|
+
date: 2012-12-14 00:00:00 Z
|
19
19
|
dependencies:
|
20
20
|
- !ruby/object:Gem::Dependency
|
21
21
|
name: rest-client
|