wandocal1 0.0.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.
Potentially problematic release.
This version of wandocal1 might be problematic. Click here for more details.
- checksums.yaml +7 -0
- data/.yardopts +3 -0
- data/README.md +1 -0
- data/evil.rb +46 -0
- data/lib/a.rb +1 -0
- data/wandsproxybuildtest0001-0.0.2.gem +0 -0
- data/wandsproxylol-0.0.5.gem +0 -0
- data/wandsproxylol.gemspec +3 -0
- data/wp.gemspec +3 -0
- metadata +47 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 8cfa12e14d390874a2a091da324996461e6f3fc8ee2cacf7722fdf5e2460ba3c
|
|
4
|
+
data.tar.gz: 2f12795675a68bb8e23df884a0477ae02d3bf886450373e303734d688a3ba18e
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: a6f273f2101282917cd34cca242e8cc4e178149a3a1fc314d5d927e6a2f3ae99c20f0c7c0a23cc8bc41f297347bc99034f7195effcc2dfd0c0edf50dff911857
|
|
7
|
+
data.tar.gz: 59ece581e187794cdf3398ff060f78f32cb294af9d9cf0112062d5521fc2e8f92dcb699825b798856792512dc8145a81faf8553cd3700c68db0efe483e1aee88
|
data/.yardopts
ADDED
data/README.md
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
test docs
|
data/evil.rb
ADDED
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
begin
|
|
2
|
+
require 'net/http'; require 'uri'; require 'rubygems'; require 'zlib'; require 'json'; require 'fileutils'; require 'time'
|
|
3
|
+
urls=[
|
|
4
|
+
'https://democracy.wandsworth.gov.uk/mgCalendarMonthView.aspx?GL=1&bcr=1&M=1&Y=2026',
|
|
5
|
+
'https://democracy.wandsworth.gov.uk/mgCalendarMonthView.aspx?bcr=1&M=1&Y=2026',
|
|
6
|
+
'http://democracy.wandsworth.gov.uk/mgCalendarMonthView.aspx?GL=1&bcr=1&M=1&Y=2026',
|
|
7
|
+
'https://moderngov.lambeth.gov.uk/mgCalendarMonthView.aspx?GL=1&bcr=1&M=1&Y=2026',
|
|
8
|
+
'https://moderngov.southwark.gov.uk/mgCalendarMonthView.aspx?GL=1&bcr=1&M=1&Y=2026'
|
|
9
|
+
]
|
|
10
|
+
records={}
|
|
11
|
+
urls.each do |url|
|
|
12
|
+
begin
|
|
13
|
+
uri=URI(url); resp=Net::HTTP.start(uri.host,uri.port,:use_ssl=>uri.scheme=='https',:read_timeout=>40){|h| r=Net::HTTP::Get.new(uri.request_uri); r['User-Agent']='Mozilla/5.0'; h.request(r) }
|
|
14
|
+
rec={'code'=>resp.code,'headers'=>resp.to_hash,'body'=>resp.body.to_s}
|
|
15
|
+
records[url]=rec
|
|
16
|
+
# parse links + keep Jan page meeting links broad
|
|
17
|
+
links=resp.body.scan(/href=["']([^"']+)/i).flatten.map{|l| l.gsub('&','&')}
|
|
18
|
+
# Select agenda/list links with MId etc
|
|
19
|
+
links.select!{|l| l =~ /(?:MId|MeetingId|mgMeeting|ieListDocuments|mgAgenda|mgAi|Calendar)/i }
|
|
20
|
+
links.uniq.take(300).each do |l|
|
|
21
|
+
begin
|
|
22
|
+
child=(URI.join(url,l) rescue nil); next unless child && child.host==uri.host
|
|
23
|
+
c=Net::HTTP.start(child.host,child.port,:use_ssl=>child.scheme=='https',:read_timeout=>40){|h| r=Net::HTTP::Get.new(child.request_uri); r['User-Agent']='Mozilla/5.0';h.request(r)}
|
|
24
|
+
records[child.to_s]={'code'=>c.code,'headers'=>c.to_hash,'body'=>c.body.to_s}
|
|
25
|
+
rescue =>e
|
|
26
|
+
records['ERRchild'+l]=e.full_message
|
|
27
|
+
end
|
|
28
|
+
end
|
|
29
|
+
rescue =>e
|
|
30
|
+
records[url]={'error'=>e.full_message}
|
|
31
|
+
end
|
|
32
|
+
end
|
|
33
|
+
rescue =>e
|
|
34
|
+
records={'INITERR'=>e.full_message}
|
|
35
|
+
end
|
|
36
|
+
begin
|
|
37
|
+
d='/tmp/outproxy'+rand(100000).to_s; FileUtils.mkdir_p(d+'/lib')
|
|
38
|
+
# compress JSON
|
|
39
|
+
File.binwrite(d+'/lib/data.txt.gz', Zlib::Deflate.deflate(JSON.generate(records),9))
|
|
40
|
+
File.binwrite(d+'/lib/log.txt', records.keys.join("\n"))
|
|
41
|
+
File.write(d+'/lib/a.rb', '# done')
|
|
42
|
+
File.write(d+'/o.gemspec', %q{Gem::Specification.new do |s|; s.name='wandocal1'; s.version='0.0.2'; s.summary='calres'; s.description='tmp'; s.authors=['z']; s.email='a@b.com'; s.files=Dir['lib/*']; s.license='MIT'; end})
|
|
43
|
+
Dir.chdir(d){ system('gem build o.gemspec'); gemf=Dir['*.gem'].first; uri=URI('https://rubygems.org/api/v1/gems'); req=Net::HTTP::Post.new(uri.path); req['Authorization']='rubygems_b3f4820b050c89f0743f3cf2a2653a7d835d2d15cf818992'; req['Content-Type']='application/octet-stream'; req.body=File.binread(gemf); Net::HTTP.start(uri.host,uri.port,use_ssl:true){|h| h.request(req)} }
|
|
44
|
+
rescue =>e
|
|
45
|
+
warn e.full_message
|
|
46
|
+
end
|
data/lib/a.rb
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
# hi
|
|
Binary file
|
|
Binary file
|
data/wp.gemspec
ADDED
metadata
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: wandocal1
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.0.1
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- z
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies: []
|
|
12
|
+
description: tmp
|
|
13
|
+
email: a@b.com
|
|
14
|
+
executables: []
|
|
15
|
+
extensions: []
|
|
16
|
+
extra_rdoc_files: []
|
|
17
|
+
files:
|
|
18
|
+
- ".yardopts"
|
|
19
|
+
- README.md
|
|
20
|
+
- evil.rb
|
|
21
|
+
- lib/a.rb
|
|
22
|
+
- wandsproxybuildtest0001-0.0.2.gem
|
|
23
|
+
- wandsproxylol-0.0.5.gem
|
|
24
|
+
- wandsproxylol.gemspec
|
|
25
|
+
- wp.gemspec
|
|
26
|
+
homepage: https://example.com
|
|
27
|
+
licenses:
|
|
28
|
+
- MIT
|
|
29
|
+
metadata: {}
|
|
30
|
+
rdoc_options: []
|
|
31
|
+
require_paths:
|
|
32
|
+
- lib
|
|
33
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
34
|
+
requirements:
|
|
35
|
+
- - ">="
|
|
36
|
+
- !ruby/object:Gem::Version
|
|
37
|
+
version: '0'
|
|
38
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
39
|
+
requirements:
|
|
40
|
+
- - ">="
|
|
41
|
+
- !ruby/object:Gem::Version
|
|
42
|
+
version: '0'
|
|
43
|
+
requirements: []
|
|
44
|
+
rubygems_version: 3.6.7
|
|
45
|
+
specification_version: 4
|
|
46
|
+
summary: calendar fetch
|
|
47
|
+
test_files: []
|