diff options
author | Minteck <nekostarfan@gmail.com> | 2021-08-24 15:37:01 +0200 |
---|---|---|
committer | Minteck <nekostarfan@gmail.com> | 2021-08-24 15:37:01 +0200 |
commit | e3298dbeaae79bb1d384fa8cd78a67be89819720 (patch) | |
tree | 871560e330f6c7225fb50ae86e3586776d81356a /telemetry/report | |
download | kartik-net-e3298dbeaae79bb1d384fa8cd78a67be89819720.tar.gz kartik-net-e3298dbeaae79bb1d384fa8cd78a67be89819720.tar.bz2 kartik-net-e3298dbeaae79bb1d384fa8cd78a67be89819720.zip |
Initial commit
Diffstat (limited to 'telemetry/report')
-rw-r--r-- | telemetry/report/index.php | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/telemetry/report/index.php b/telemetry/report/index.php new file mode 100644 index 0000000..442d53a --- /dev/null +++ b/telemetry/report/index.php @@ -0,0 +1,44 @@ +<?php + +class UUID { + public static function v4() { + return sprintf('%04x%04x-%04x-%04x-%04x-%04x%04x%04x', + mt_rand(0, 0xffff), mt_rand(0, 0xffff), + mt_rand(0, 0xffff), + mt_rand(0, 0x0fff) | 0x4000, + mt_rand(0, 0x3fff) | 0x8000, + mt_rand(0, 0xffff), mt_rand(0, 0xffff), mt_rand(0, 0xffff) + ); + } +} + +if (isset($_GET['report'])) { + $d = utf8_encode(base64_decode($_GET['report'])); +} else { + echo("Not set"); + die(); +} + +$ch = curl_init(); +curl_setopt($ch, CURLOPT_URL, "https://familine.jetbrains.space/api/http/projects/id:cUW7s1nHBNd/planning/issues"); +curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); +curl_setopt($ch, CURLOPT_USERPWD, "kos:yc2c\VT<6T.?`h43p$[ttyD,4(VqDKM<F)hXxdCP72a~ghXJe@4CLF8P3K.;r+XAr;n6(*\a4[J>!{t<WA4=&EpZ!pgnA}W#8\"UfqN9Vs,-rPW;C!?a_94%SPrRH~Rm>"); +curl_setopt($ch, CURLOPT_HTTPAUTH, CURLAUTH_BASIC); +curl_setopt($ch, CURLOPT_HTTPHEADER, array( + 'Content-Type: application/json', + 'Accept: application/json', +)); +curl_setopt($ch, CURLOPT_POST, 1); +$j = "{\"title\":\"Rapport de bug automatique (" . UUID::v4() . ")\",\"description\":\"\",\"assignee\":\"id:3hh9iS36gW9p\",\"status\":\"458T9x3wM0zN\",\"tags\":[\"3XhWk14WX0Jj\"]}"; +$a = json_decode($j, true); +$a["description"] = "```" . str_replace("`", "'", $d) . "```"; +curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($a)); +var_dump(json_encode($a)); +$output = curl_exec($ch); +$info = curl_getinfo($ch); +curl_close($ch); + +echo("Done!"); +var_dump($output); +var_dump($info); +die(); |