gls_agent 0.4.0 → 0.4.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +8 -8
- data/README.md +14 -6
- data/gls_agent.gemspec +2 -2
- data/lib/gls_agent/gls_mech.rb +4 -0
- data/lib/gls_agent/version.rb +1 -1
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
MmVkODVmYmY5YjQwYzg3NTVhZWI4N2Y0N2FjYjRlNmQ1ZWRkMGZmYQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NTMwNjMyZjc4ZGFjMTNjNWE1YTMwYmE3NzNhMzBlNTVlZDE3M2MzNg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
MjkxYmNiNTdkMTY1NTJmNjgyNDBiZjFiZmJkNDNlODU4NzUzYjBmNzBhOTZh
|
10
|
+
NTkyM2VhNGRjODhjNzQ3OWY2NmY3ZTU4NGY2ZTk1MGM4MmE0NWU3YzM4OWI3
|
11
|
+
OThhMzhjZTlmYzMxOTNhY2JkN2I3Njg3YzFlMDc2MGY3NmQwOWM=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
MmNlNGNjNWYxODUwY2I4YzQyODgzMmY1ZWQ5MTY5MTFmYmIzZWIwZWM4ODE1
|
14
|
+
NmIzNTE2MTZhMjBkYmE0YTU4YTRjMWU3YmY2NTE5YTMxNTJlYWFjNGZmMGNm
|
15
|
+
MWIyMzFiZTUwMDZmZTI2Y2IwNzk4NDYzMGMzOWMyMzllYzkxYmM=
|
data/README.md
CHANGED
@@ -4,6 +4,8 @@ Log into the German GLS (General Logistics Systems) webpage, create a new parcel
|
|
4
4
|
|
5
5
|
You'll need a "Easy-Start"/"Your GLS" account to do so.
|
6
6
|
|
7
|
+
GLS changed their webpage, now without JavaScript it seems that you need to save a Consignee Number with each request. This will be a timestamp, so this script will create a lot of unique customers with weirdish numbers (one for each generated parcel sticker).
|
8
|
+
|
7
9
|
## Installation
|
8
10
|
|
9
11
|
Add this line to your application's Gemfile:
|
@@ -24,7 +26,11 @@ Or install it yourself as:
|
|
24
26
|
|
25
27
|
There is a small standalone script:
|
26
28
|
|
27
|
-
$ gls_create_label -u glsuser -p glspass -
|
29
|
+
$ gls_create_label -u glsuser -p glspass -l "12.12.2014,John Doe,Companyname,Home Street,1,1234,City,1" -o output.pdf
|
30
|
+
|
31
|
+
Multiple labels can be created by not passing the data via --label-data or -l flag but by shoving in a file as argument (which contains mutliple lines that conform to the same format then with the -l flag):
|
32
|
+
|
33
|
+
$ gls_create_label -u glsuser -p glspass parcel_label_data.csv
|
28
34
|
|
29
35
|
Note that while not gemified, use
|
30
36
|
|
@@ -45,7 +51,7 @@ To use gls_agent in your ruby project, install the gem and use something along t
|
|
45
51
|
mech.user = options[:user]
|
46
52
|
mech.pass = options[:pass]
|
47
53
|
|
48
|
-
GLSAgent::ParcelJob.new('31.01.2014','Frank Sinatra','CloudStreet','1',1234,'HeavenCity','1')
|
54
|
+
GLSAgent::ParcelJob.new('31.01.2014','Frank Sinatra','Singing Ltd.,'CloudStreet','1',1234,'HeavenCity','1')
|
49
55
|
saved_as = mech.save_parcel_label parcel,'gls_label_frank_sinatra.pdf'
|
50
56
|
|
51
57
|
### Configuration
|
@@ -58,11 +64,13 @@ Its syntax follows the
|
|
58
64
|
option=value
|
59
65
|
|
60
66
|
scheme, where option can be anything of: user, pass, name, street, streetno, zip, city, weight, output_file .
|
67
|
+
Note that these options are ignored if gls_create_label is given a file to create multiple labels.
|
61
68
|
|
62
69
|
## Contributing
|
63
70
|
|
64
71
|
1. Fork it ( https://github.com/[my-github-username]/gls_agent/fork )
|
65
|
-
2.
|
66
|
-
3.
|
67
|
-
4.
|
68
|
-
5.
|
72
|
+
2. Mail me.
|
73
|
+
3. Create your feature branch (`git checkout -b my-new-feature`)
|
74
|
+
4. Commit your changes (`git commit -am 'Add some feature'`)
|
75
|
+
5. Push to the branch (`git push origin my-new-feature`)
|
76
|
+
6. Create a new Pull Request
|
data/gls_agent.gemspec
CHANGED
@@ -18,8 +18,8 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_dependency 'mechanize'
|
22
|
-
spec.add_dependency 'rainbow'
|
21
|
+
spec.add_dependency 'mechanize', "~> 2.7"
|
22
|
+
spec.add_dependency 'rainbow', "~> 2.0"
|
23
23
|
|
24
24
|
spec.add_development_dependency "bundler", "~> 1.6"
|
25
25
|
spec.add_development_dependency "rake"
|
data/lib/gls_agent/gls_mech.rb
CHANGED
@@ -103,6 +103,10 @@ class GLSMech
|
|
103
103
|
end
|
104
104
|
|
105
105
|
def fill_parcel_form form, parcel_job
|
106
|
+
@mech.page.save_as 'form.html'
|
107
|
+
d = DateTime.now
|
108
|
+
timestamp = d.strftime("%Y%m%d%H%M") + (d.second_fraction.to_f*1000).to_i.to_s
|
109
|
+
form.field_with(:name => 'txtConsigneeNo').value = timestamp
|
106
110
|
form.field_with(:name => 'txtName1').value = parcel_job.name
|
107
111
|
form.field_with(:name => 'txtName2').value = parcel_job.company
|
108
112
|
form.field_with(:name => 'txtStreet').value = parcel_job.street
|
data/lib/gls_agent/version.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,43 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: gls_agent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Felix Wolfsteller
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mechanize
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - ~>
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '2.7'
|
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: '
|
26
|
+
version: '2.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rainbow
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- -
|
31
|
+
- - ~>
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '0'
|
33
|
+
version: '2.0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- -
|
38
|
+
- - ~>
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '0'
|
40
|
+
version: '2.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: bundler
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|