2016-12-02 12 views
3

私はgithubの問題を自動化しようとしていましたが、スクリプトが問題を作成せず、apiとすべてのデータを取得し、それは問題を生じさせません。これが期待どおりに動作しない場合、私は何をうまくやっていませんか?つまり、問題自体を自動作成するにはどうすればいいですか?自動github問題の作成

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&amp;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&amp;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&amp;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&amp;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"}] 
+0

GitHubには、基本認証を使用しません。あなたはおそらくgithub apiを見たいと思っています。https://developer.github.com/v3/ –

+0

@JustinWood私はそれを見ました。それが私がスクリプトを思いついた方法です。私は認証部分を見逃しましたか? – pwerhouse

+0

明らかにそうです。認証を説明するページがあります。 https://developer.github.com/v3/#authentication –

答えて

1

編集内容の後に思える、それを整理する必要があり

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" 
+0

同じ問題は、すべてのデータとすべてを取得し、情報を表示しますが、問題は作成されません。 – pwerhouse

+0

レスポンスコードとレスポンスは正確には何ですか? :)それは私たちがあなたを助けるのに役立ちます。 –

+0

質問に投稿しました – pwerhouse