- xml - AJAX/Jquery XML 解析
- 具有多重继承的 XML 模式
- .net - 枚举序列化 Json 与 XML
- XML 简单类型、简单内容、复杂类型、复杂内容
我一直在尝试自动化我的 github 问题,但是我遇到了一个脚本不会产生问题的问题,它将拉取 api 和所有数据,并按应有的方式工作,但它不会创建一个问题。我在什么地方做错了这不会按预期工作,这意味着我如何自动创建问题本身?
require 'net/http'
require 'uri'
require 'openssl'
require 'json'
ID = "ID"
SECRET = "SECRET"
def create_git_issue(user, pass, repo_name, repo_owner,
title, body, assignee, milestone,
labels)
url = URI("https://api.github.com/repos/#{repo_owner}/#{repo_name}/issues?client_id=#{ID}&client_secret=#{SECRET}")
Net::HTTP.start(url.host, url.port,
:use_ssl => url.scheme == "https",
:verify_mode => OpenSSL::SSL::VERIFY_NONE) do |http|
request = Net::HTTP::Post.new url.request_uri
request.basic_auth user, pass
response = http.request request
puts response
#puts response.body
issue = {
:title => title,
:body => body,
:assignee => assignee,
:milestone => milestone,
:labels => labels
}
data = JSON.generate(issue)
request.body = data
request["Header"] = "application/vnd.github.v3+json"
end
end
create_git_issue("user", "secret", "repo", "owner",
"Test issue #1", "test", "", nil, nil)
响应:
#<Net::HTTPOK:0x2e2d7b8>
[{"url":"https://api.github.com/repos/WhitewidowScanner/whitewidow/issues/30","r
epository_url":"https://api.github.com/repos/WhitewidowScanner/whitewidow","labe
ls_url":"https://api.github.com/repos/WhitewidowScanner/whitewidow/issues/30/lab
els{/name}","comments_url":"https://api.github.com/repos/WhitewidowScanner/white
widow/issues/30/comments","events_url":"https://api.github.com/repos/WhitewidowS
canner/whitewidow/issues/30/events","html_url":"https://github.com/WhitewidowSca
nner/whitewidow/issues/30","id":192271670,"number":30,"title":"Encoding errors w
ith recursive spider","user":{"login":"Shazgul","id":20743799,"avatar_url":"http
s://avatars.githubusercontent.com/u/20743799?v=3","gravatar_id":"","url":"https:
//api.github.com/users/Shazgul","html_url":"https://github.com/Shazgul","followe
rs_url":"https://api.github.com/users/Shazgul/followers","following_url":"https:
//api.github.com/users/Shazgul/following{/other_user}","gists_url":"https://api.
github.com/users/Shazgul/gists{/gist_id}","starred_url":"https://api.github.com/
users/Shazgul/starred{/owner}{/repo}","subscriptions_url":"https://api.github.co
m/users/Shazgul/subscriptions","organizations_url":"https://api.github.com/users
/Shazgul/orgs","repos_url":"https://api.github.com/users/Shazgul/repos","events_
url":"https://api.github.com/users/Shazgul/events{/privacy}","received_events_ur
l":"https://api.github.com/users/Shazgul/received_events","type":"User","site_ad
min":false},"labels":[{"id":490987868,"url":"https://api.github.com/repos/Whitew
idowScanner/whitewidow/labels/ENCODING","name":"ENCODING","color":"b60205","defa
ult":false},{"id":458176860,"url":"https://api.github.com/repos/WhitewidowScanne
r/whitewidow/labels/temp%20fix","name":"temp fix","color":"c2e0c6","default":fal
se},{"id":480395818,"url":"https://api.github.com/repos/WhitewidowScanner/whitew
idow/labels/testing","name":"testing","color":"d4c5f9","default":false}],"state"
:"open","locked":false,"assignee":{"login":"Ekultek","id":14183473,"avatar_url":
"https://avatars.githubusercontent.com/u/14183473?v=3","gravatar_id":"","url":"h
ttps://api.github.com/users/Ekultek","html_url":"https://github.com/Ekultek","fo
llowers_url":"https://api.github.com/users/Ekultek/followers","following_url":"h
ttps://api.github.com/users/Ekultek/following{/other_user}","gists_url":"https:/
/api.github.com/users/Ekultek/gists{/gist_id}","starred_url":"https://api.github
.com/users/Ekultek/starred{/owner}{/repo}","subscriptions_url":"https://api.gith
ub.com/users/Ekultek/subscriptions","organizations_url":"https://api.github.com/
users/Ekultek/orgs","repos_url":"https://api.github.com/users/Ekultek/repos","ev
ents_url":"https://api.github.com/users/Ekultek/events{/privacy}","received_even
ts_url":"https://api.github.com/users/Ekultek/received_events","type":"User","si
te_admin":false},"assignees":[{"login":"Ekultek","id":14183473,"avatar_url":"htt
ps://avatars.githubusercontent.com/u/14183473?v=3","gravatar_id":"","url":"https
://api.github.com/users/Ekultek","html_url":"https://github.com/Ekultek","follow
ers_url":"https://api.github.com/users/Ekultek/followers","following_url":"https
://api.github.com/users/Ekultek/following{/other_user}","gists_url":"https://api
.github.com/users/Ekultek/gists{/gist_id}","starred_url":"https://api.github.com
/users/Ekultek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.c
om/users/Ekultek/subscriptions","organizations_url":"https://api.github.com/user
s/Ekultek/orgs","repos_url":"https://api.github.com/users/Ekultek/repos","events
_url":"https://api.github.com/users/Ekultek/events{/privacy}","received_events_u
rl":"https://api.github.com/users/Ekultek/received_events","type":"User","site_a
dmin":false}],"milestone":null,"comments":11,"created_at":"2016-11-29T12:42:07Z"
,"updated_at":"2016-12-01T13:55:21Z","closed_at":null,"body":"### Before you cre
ate an issue please make sure that there are no issues that relate to your issue
you are trying to create, \r\nif there is an issue that relates to this, please
add a comment to that one and describe your specific problem. There is\r\nalso
a self help guide under the docs folder. Look through the troubleshooting and se
lf help for help.\r\n--\r\n\r\n### Issue (be specific)\r\nAfter a -s Scan on a W
ebpage, Whitewidow \"encountered an error and cannot continue\".. It totally sto
ps the scan, also outputs a bunch of encoding errors\r\n\r\n### Exact error mess
age\r\nruby whitewidow.rb -s browsergames.info\r\n[13:33:46 INFO] Found http://w
ww.w3.org/1999/xhtml\r\n[13:33:46 INFO] Found http://www.w3.org/2003/g/data-view
\r\n[13:33:46 INFO] Found http://www.w3.org/StyleSheets/TR/base\r\n[13:33:46 INF
O] Found http://www.w3.org/2008/07/rdfa-xslt\r\n[13:33:46 INFO] Found http://www
.w3.org/2003/g/data-view#\r\n[13:33:47 INFO] Found http://www.w3.org/1999/xhtml\
r\n[13:33:47 INFO] Found http://www.w3.org/2008/07/rdfa-xslt\r\n[13:33:47 INFO]
Found http://www.w3.org/\r\n...\r\nencoding error : output conversion failed due
to conv error, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error : encoder error\r\nencodi
ng error : output conversion failed due to conv error, bytes 0x89 0x50 0x4E 0x47
\r\nI/O error : encoder error\r\n...\r\nencoding error : output conversion faile
d due to conv error, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error : encoder error\r\ne
ncoding error : output conversion failed due to conv error, bytes 0x89 0x50 0x4E
0x47\r\nI/O error : encoder error\r\n...\r\nencoding error : output conversion
failed due to conv error, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error : encoder error
\r\nencoding error : output conversion failed due to conv error, bytes 0x89 0x50
0x4E 0x47\r\nI/O error : encoder error\r\n...\r\nencoding error : output conver
sion failed due to conv error, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error : encoder
error\r\nencoding error : output conversion failed due to conv error, bytes 0x89
0x50 0x4E 0x47\r\nI/O error : encoder error\r\n...\r\nencoding error : output c
onversion failed due to conv error, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error : enc
oder error\r\nencoding error : output conversion failed due to conv error, bytes
0x89 0x50 0x4E 0x47\r\nI/O error : encoder error\r\n...\r\nencoding error : out
put conversion failed due to conv error, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error
: encoder error\r\nencoding error : output conversion failed due to conv error,
bytes 0x89 0x50 0x4E 0x47\r\nI/O error : encoder error\r\nencoding error : outpu
t conversion failed due to conv error, bytes 0xFF 0xC3 0x98 0xC3\r\nI/O error :
encoder error\r\n...\r\nencoding error : output conversion failed due to conv er
ror, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error : encoder error\r\nencoding error :
output conversion failed due to conv error, bytes 0x89 0x50 0x4E 0x47\r\nI/O err
or : encoder error\r\n...\r\nencoding error : output conversion failed due to co
nv error, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error : encoder error\r\nencoding err
or : output conversion failed due to conv error, bytes 0x89 0x50 0x4E 0x47\r\nI/
O error : encoder error\r\n...\r\nencoding error : output conversion failed due
to conv error, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error : encoder error\r\nencodin
g error : output conversion failed due to conv error, bytes 0x89 0x50 0x4E 0x47\
r\nI/O error : encoder error\r\n...\r\nencoding error : output conversion failed
due to conv error, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error : encoder error\r\nen
coding error : output conversion failed due to conv error, bytes 0x89 0x50 0x4E
0x47\r\nI/O error : encoder error\r\nencoding error : output conversion failed d
ue to conv error, bytes 0xFF 0xC3 0x98 0xC3\r\nI/O error : encoder error\r\n...\
r\nencoding error : output conversion failed due to conv error, bytes 0xA2 0x3C
0x2F 0x70\r\nI/O error : encoder error\r\nencoding error : output conversion fai
led due to conv error, bytes 0x89 0x50 0x4E 0x47\r\nI/O error : encoder error\r\
nencoding error : output conversion failed due to conv error, bytes 0xFF 0xC3 0x
98 0xC3\r\nI/O error : encoder error\r\n...\r\nencoding error : output conversio
n failed due to conv error, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error : encoder err
or\r\nencoding error : output conversion failed due to conv error, bytes 0x89 0x
50 0x4E 0x47\r\nI/O error : encoder error\r\nencoding error : output conversion
failed due to conv error, bytes 0xFF 0xC3 0x98 0xC3\r\nI/O error : encoder error
\r\n...\r\nencoding error : output conversion failed due to conv error, bytes 0x
A2 0x3C 0x2F 0x70\r\nI/O error : encoder error\r\nencoding error : output conver
sion failed due to conv error, bytes 0x89 0x50 0x4E 0x47\r\nI/O error : encoder
error\r\n...\r\nencoding error : output conversion failed due to conv error, byt
es 0xA2 0x3C 0x2F 0x70\r\nI/O error : encoder error\r\nencoding error : output c
onversion failed due to conv error, bytes 0x89 0x50 0x4E 0x47\r\nI/O error : enc
oder error\r\n...\r\nencoding error : output conversion failed due to conv error
, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error : encoder error\r\nencoding error : out
put conversion failed due to conv error, bytes 0x89 0x50 0x4E 0x47\r\nI/O error
: encoder error\r\n...\r\nencoding error : output conversion failed due to conv
error, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error : encoder error\r\nencoding error
: output conversion failed due to conv error, bytes 0x89 0x50 0x4E 0x47\r\nI/O e
rror : encoder error\r\nencoding error : output conversion failed due to conv er
ror, bytes 0xFF 0xC3 0x98 0xC3\r\nI/O error : encoder error\r\n...\r\nencoding e
rror : output conversion failed due to conv error, bytes 0xA2 0x3C 0x2F 0x70\r\n
I/O error : encoder error\r\nencoding error : output conversion failed due to co
nv error, bytes 0x89 0x50 0x4E 0x47\r\nI/O error : encoder error\r\n...\r\nencod
ing error : output conversion failed due to conv error, bytes 0xA2 0x3C 0x2F 0x7
0\r\nI/O error : encoder error\r\nencoding error : output conversion failed due
to conv error, bytes 0x89 0x50 0x4E 0x47\r\nI/O error : encoder error\r\n...\r\n
encoding error : output conversion failed due to conv error, bytes 0xA2 0x3C 0x2
F 0x70\r\nI/O error : encoder error\r\nencoding error : output conversion failed
due to conv error, bytes 0x89 0x50 0x4E 0x47\r\nI/O error : encoder error\r\n..
.\r\nencoding error : output conversion failed due to conv error, bytes 0xA2 0x3
C 0x2F 0x70\r\nI/O error : encoder error\r\nencoding error : output conversion f
ailed due to conv error, bytes 0x89 0x50 0x4E 0x47\r\nI/O error : encoder error\
r\nencoding error : output conversion failed due to conv error, bytes 0xFF 0xC3
0x98 0xC3\r\nI/O error : encoder error\r\n...\r\nencoding error : output convers
ion failed due to conv error, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error : encoder e
rror\r\nencoding error : output conversion failed due to conv error, bytes 0x89
0x50 0x4E 0x47\r\nI/O error : encoder error\r\n...\r\nencoding error : output co
nversion failed due to conv error, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error : enco
der error\r\nencoding error : output conversion failed due to conv error, bytes
0x89 0x50 0x4E 0x47\r\nI/O error : encoder error\r\nencoding error : output conv
ersion failed due to conv error, bytes 0xFF 0xC3 0x98 0xC3\r\nI/O error : encode
r error\r\n...\r\nencoding error : output conversion failed due to conv error, b
ytes 0xA2 0x3C 0x2F 0x70\r\nI/O error : encoder error\r\nencoding error : output
conversion failed due to conv error, bytes 0x89 0x50 0x4E 0x47\r\nI/O error : e
ncoder error\r\n...\r\nencoding error : output conversion failed due to conv err
or, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error : encoder error\r\nencoding error : o
utput conversion failed due to conv error, bytes 0x89 0x50 0x4E 0x47\r\nI/O erro
r : encoder error\r\n...\r\nencoding error : output conversion failed due to con
v error, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error : encoder error\r\nencoding erro
r : output conversion failed due to conv error, bytes 0x89 0x50 0x4E 0x47\r\nI/O
error : encoder error\r\n...\r\nencoding error : output conversion failed due t
o conv error, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error : encoder error\r\nencoding
error : output conversion failed due to conv error, bytes 0x89 0x50 0x4E 0x47\r
\nI/O error : encoder error\r\nencoding error : output conversion failed due to
conv error, bytes 0x89 0x50 0x4E 0x47\r\nI/O error : encoder error\r\n...\r\nenc
oding error : output conversion failed due to conv error, bytes 0xA2 0x3C 0x2F 0
x70\r\nI/O error : encoder error\r\nencoding error : output conversion failed du
e to conv error, bytes 0x89 0x50 0x4E 0x47\r\nI/O error : encoder error\r\nencod
ing error : output conversion failed due to conv error, bytes 0xFF 0xC3 0x98 0xC
3\r\nI/O error : encoder error\r\n...\r\nencoding error : output conversion fail
ed due to conv error, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error : encoder error\r\n
encoding error : output conversion failed due to conv error, bytes 0x89 0x50 0x4
E 0x47\r\nI/O error : encoder error\r\nencoding error : output conversion failed
due to conv error, bytes 0xFF 0xC3 0x98 0xC3\r\nI/O error : encoder error\r\n..
.\r\nencoding error : output conversion failed due to conv error, bytes 0xA2 0x3
C 0x2F 0x70\r\nI/O error : encoder error\r\nencoding error : output conversion f
ailed due to conv error, bytes 0x89 0x50 0x4E 0x47\r\nI/O error : encoder error\
r\nencoding error : output conversion failed due to conv error, bytes 0xFF 0xC3
0x98 0xC3\r\nI/O error : encoder error\r\n...\r\nencoding error : output convers
ion failed due to conv error, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error : encoder e
rror\r\nencoding error : output conversion failed due to conv error, bytes 0x89
0x50 0x4E 0x47\r\nI/O error : encoder error\r\n...\r\nencoding error : output co
nversion failed due to conv error, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error : enco
der error\r\nencoding error : output conversion failed due to conv error, bytes
0x89 0x50 0x4E 0x47\r\nI/O error : encoder error\r\n...\r\nencoding error : outp
ut conversion failed due to conv error, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error :
encoder error\r\nencoding error : output conversion failed due to conv error, b
ytes 0x89 0x50 0x4E 0x47\r\nI/O error : encoder error\r\n...\r\nencoding error :
output conversion failed due to conv error, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O er
ror : encoder error\r\nencoding error : output conversion failed due to conv err
or, bytes 0x89 0x50 0x4E 0x47\r\nI/O error : encoder error\r\n[13:37:17 INFO] Fo
und http://www.w3.org/1999/xhtml\r\n[13:37:17 INFO] Found http://www.browsergame
s.info/index.php?a=out&u='\r\n[13:37:18 INFO] Found http://www.browsergames.info
/index.php?a=out&go=1&u=mafiakoenig\r\n[13:37:18 INFO] Found http://www.browserg
ames.info/index.php?a=out&go=1&u=mafiakoenig\r\n[13:37:18 INFO] Found http://www
.browsergames.info/\r\n[13:37:18 INFO] Found http://www.browsergames.info/\r\n[1
3:37:18 INFO] Found http://www.browsergames.info/\r\n[13:37:19 INFO] Found http:
//www.browsergames.info/index.php?a=join\r\n[13:37:19 INFO] Found http://www.bro
wsergames.info/index.php?a=user_cpl\r\n[13:37:19 INFO] Found http://www.browserg
ames.info/index.php?a=out&go=1&u=rlk\r\n[13:37:19 INFO] Found http://js.adscale.
de/getads.js\r\n[13:37:19 INFO] Found http://js.adscale.de/getads.js\r\n[13:37:2
0 INFO] Found http://www.facebook.com/pages/browsergamesinfo/240976396022694\r\n
[13:37:20 INFO] Found http://www.browsergames.info/index.php?a=page&id=impre
ssum\r\nencoding error : output conversion failed due to conv error, bytes 0xA2
0x3C 0x2F 0x70\r\nI/O error : encoder error\r\nencoding error : output conversio
n failed due to conv error, bytes 0x89 0x50 0x4E 0x47\r\nI/O error : encoder err
or\r\n...\r\n[13:37:23 INFO] Found http://www.facebook.com/pages/browsergamesinf
o/240976396022694\r\n[13:37:23 INFO] Found http://www.browsergames.info/index.ph
p?a=page&id=impressum\r\nencoding error : output conversion failed due to co
nv error, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error : encoder error\r\nencoding err
or : output conversion failed due to conv error, bytes 0x89 0x50 0x4E 0x47\r\nI/
O error : encoder error\r\nencoding error : output conversion failed due to conv
error, bytes 0xFF 0xC3 0x98 0xC3\r\nI/O error : encoder error\r\n...\r\nencodin
g error : output conversion failed due to conv error, bytes 0xA2 0x3C 0x2F 0x70\
r\nI/O error : encoder error\r\nencoding error : output conversion failed due to
conv error, bytes 0x89 0x50 0x4E 0x47\r\nI/O error : encoder error\r\nencoding
error : output conversion failed due to conv error, bytes 0xFF 0xC3 0x98 0xC3\r\
nI/O error : encoder error\r\n[13:37:28 INFO] Found http://www.w3.org/1999/xhtml
\r\n[13:37:28 INFO] Found http://www.browsergames.info/index.php?a=out&u='\r\n[1
3:37:28 INFO] Found http://www.browsergames.info/index.php?a=out&go=1&u=mafiakoe
nig\r\n[13:37:28 INFO] Found http://www.browsergames.info/index.php?a=out&go=1&u
=mafiakoenig\r\n[13:37:28 INFO] Found http://www.browsergames.info/\r\n[13:37:29
INFO] Found http://www.browsergames.info/\r\n[13:37:29 INFO] Found http://www.b
rowsergames.info/\r\n[13:37:29 INFO] Found http://www.browsergames.info/index.ph
p?a=join\r\n[13:37:29 INFO] Found http://www.browsergames.info/index.php?a=user_
cpl\r\n[13:37:29 INFO] Found http://www.browsergames.info/index.php?a=out&go=1&u
=rlk\r\n[13:37:30 INFO] Found http://js.adscale.de/getads.js\r\n[13:37:30 INFO]
Found http://js.adscale.de/getads.js\r\n[13:37:30 INFO] Found http://www.faceboo
k.com/pages/browsergamesinfo/240976396022694\r\n[13:37:30 INFO] Found http://www
.browsergames.info/index.php?a=page&id=impressum\r\nencoding error : output
conversion failed due to conv error, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error : en
coder error\r\nencoding error : output conversion failed due to conv error, byte
s 0x89 0x50 0x4E 0x47\r\nI/O error : encoder error\r\n...\r\nencoding error : ou
tput conversion failed due to conv error, bytes 0xB3 0x3C 0x2F 0x70\r\nI/O error
: encoder error\r\nencoding error : output conversion failed due to conv error,
bytes 0x89 0x50 0x4E 0x47\r\nI/O error : encoder error\r\n...\r\nencoding error
: output conversion failed due to conv error, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O
error : encoder error\r\nencoding error : output conversion failed due to conv e
rror, bytes 0x89 0x50 0x4E 0x47\r\nI/O error : encoder error\r\nencoding error :
output conversion failed due to conv error, bytes 0xFF 0xC3 0x98 0xC3\r\nI/O er
ror : encoder error\r\n[13:37:42 INFO] Found http://www.w3.org/1999/xhtml\r\n[13
:37:43 INFO] Found http://www.browsergames.info/index.php?a=out&u='\r\n[13:37:43
INFO] Found http://www.browsergames.info/index.php?a=out&go=1&u=mafiakoenig\r\n
[13:37:43 INFO] Found http://www.browsergames.info/index.php?a=out&go=1&u=mafiak
oenig\r\n[13:37:43 INFO] Found http://www.browsergames.info/\r\n[13:37:43 INFO]
Found http://www.browsergames.info/\r\n[13:37:44 INFO] Found http://www.browserg
ames.info/\r\n[13:37:44 INFO] Found http://www.browsergames.info/index.php?a=joi
n\r\n[13:37:44 INFO] Found http://www.browsergames.info/index.php?a=user_cpl\r\n
[13:37:44 INFO] Found http://www.browsergames.info/index.php?a=out&go=1&u=rlk\r\
n[13:37:44 INFO] Found http://js.adscale.de/getads.js\r\n[13:37:45 INFO] Found h
ttp://js.adscale.de/getads.js\r\n[13:37:45 INFO] Found http://www.facebook.com/p
ages/browsergamesinfo/240976396022694\r\n[13:37:45 INFO] Found http://www.browse
rgames.info/index.php?a=page&id=impressum\r\nencoding error : output convers
ion failed due to conv error, bytes 0xA2 0x3C 0x2F 0x70\r\nI/O error : encoder e
rror\r\nencoding error : output conversion failed due to conv error, bytes 0x89
0x50 0x4E 0x47\r\nI/O error : encoder error\r\n[13:37:45 ERROR] browsergames.inf
o encountered an error and cannot continue.\r\n\r\n\r\n### Steps to reproduce\r\
nMake an Scan on browsergames.info\r\n\r\n### Search query if applicable\r\n-s b
rowsergames.info\r\n\r\n### Whitewidow version number\r\n1.7.2.9\r\n\r\n### Ruby
version number\r\nruby 2.3.1p112 (2016-04-26) [i386-linux-gnu]\r\n\r\n### Label
s\r\n\r\n - [X] Bug\r\n - [X] Encoding\r\n - [ ] Enhancement\r\n - [ ] Question\
r\n - [ ] Email request"}]
最佳答案
在您编辑之后,您似乎错过了“=”符号
URI("https://api.github.com/repos/#{repo_owner}/#{repo_name}/issues?client_id=#{ID}&client_secret=#{SECRET}")
这应该解决了。否则,你会得到什么回应?任何状态代码或内容? GitHub 应在回复时为您提供错误消息。
除此之外,当您需要发出 POST 请求时,您正在发出 GET 请求(请参阅 here)
像这样更改您的代码:
request = Net::HTTP::Post.new url.request_uri
request.basic_auth user, pass
请记住,您需要将请求正文作为 JSON 字符串传递。首先根据链接中的规范创建对象:
body = {
title: "Test Issue # 1",
body: "test"
}
body = JSON.generate(body)
然后将其作为正文附加到您的请求中:
request.body = body
request["Content-Type"] = "application/json"
关于ruby - 创建一个自动化的 github 问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40933972/
关闭。这个问题需要details or clarity .它目前不接受答案。 想改进这个问题吗? 通过 editing this post 添加细节并澄清问题. 关闭 5 年前。 Improve t
背景 我有一个 Azure Runbook(名为 RunStoredProcedure2),定义如下: param( [parameter(Mandatory=$True)] [string] $Sq
我有一个名为“团队”的表,其中包含“非事件”列,另一个表“事件”,其中包含“时间”列。如果任何团队的“事件”中的最新日期发生在 X 时间之前,如何将“非事件”列更新(为 true)? 我知道这可以通过
下面的问题可能有点令人困惑,但我会尽力以最好的方式解释它。 假设我们为一家制造公司工作。它制造然后用于制造产品的组件。在以下示例中,有 3 个组件和 2 个最终产品。 组件和产品的需求如下: comp
我有代码可以让我在一个范围内选择一个项目: COleVariant vItems = cstrAddr; hr = AutoWrap(
我正在开发一个应用程序,该应用程序有 4 种语言的大约 50 个应用内购买,这给了我很多表单和子表单、框和子框,需要使用 iTunesConnect 的令人痛苦且设计糟糕的表单来填充。 我想知道是否有
我想在 Azure 自动化中使用 powershell 脚本来安排打开/关闭资源。 我想在不创建帐户的情况下执行此操作,因为我们的域强制重置密码。我知道自动化帐户会创建一个证书 - 当使用资源管理器(
我尝试从 azure 自动化 run book power shell 自动检索 azure SQL 数据库中的数据。我发现azure自动化帐户的模块中缺少SQL Server模块。我已经导入了该模块
我正在自动化 Outlook,并且需要控制电子邮件的发件人身份。用户将在 Outlook 中设置两个或多个帐户,我需要能够选择从哪个帐户发送电子邮件。有什么想法吗? 需要 Outlook 2003 及
我尝试从 azure 自动化 run book power shell 自动检索 azure SQL 数据库中的数据。我发现azure自动化帐户的模块中缺少SQL Server模块。我已经导入了该模块
假设我有一个网站,我可以(随时)登录并每隔 x 小时提交数据(单击登录后可见的链接),我将如何自动化此过程? 我构建了一个图形用户界面,它为用户(现在是我,为了我自己的方便)提供了一个包含一些信息的界
我正在开发一个程序,它的任务是我们为它定义一些号码(我们的一些手机号码)并且它应该在 Telegram 中注册它们,然后获取发送到该号码的所有消息。如您所知,在 Telegram 中注册需要提供电话号
关闭。这个问题需要更多focused .它目前不接受答案。 想改进这个问题吗? 更新问题,使其只关注一个问题 editing this post . 关闭 3 年前。 Improve this qu
最近我在处理 CSS Sprite 。一切正常。 我创建了一个 sprite、.css 文件和 html 结构。看起来像 .sprites{ background-image:url
我想为一款名为 Dune 2000 的策略游戏创建一个叠加层。令人讨厌的是,要创建 10 个士兵,每次完成一个都必须单击该图标。没有队列。因此,在不干扰游戏运行方式的情况下,我想听听鼠标移动的声音,当
我是 python 的初学者,我想从自动化开始。以下是我正在尝试执行的任务。 ssh -p 2024 root@10.54.3.32 root@10.54.3.32's password: 我尝试通过
当我将一些 urlencoded Javascript 粘贴到 Firefox 和 Chrome 上的 URL 时,我看到了一些奇怪的事情发生。是否可以使用此技术告诉 Chrome 访问 URL,然后
我需要将大量请求自动提交到基于云的数据库接口(interface) (Intelex)。没有任何方法可以批量提交某些操作,但是提交单个请求所必需的只是让经过身份验证的用户尝试打开 Web 链接。因此,
假设我有一个进程的内存转储。我想对其运行报告,所以基本上我想打开 WinDBG,加载 SOS 并运行一个脚本,该脚本运行一些命令,解析输出,然后基于此运行更多命令。 除了像 SendKeys 这样的
我正在使用 ffmpeg 创建视频剪辑。我想自动化该过程并保存剪辑,而无需手动为要保存的每个文件命名。这是我拥有的代码。它将创建并保存剪辑,但只能使用扩展名和不是名字。 @echo off cd /d
我是一名优秀的程序员,十分优秀!