From 11d3369cf200e6cd27efa14f68be0c74f595a9e2 Mon Sep 17 00:00:00 2001 From: Le Alternative Date: Wed, 15 Dec 2021 13:50:27 +0100 Subject: [PATCH] Aggiungi 'codebergpost.php' comandi per aprire in automatico su codeberg delle issue --- codebergpost.php | 67 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 codebergpost.php diff --git a/codebergpost.php b/codebergpost.php new file mode 100644 index 0000000..51bbe30 --- /dev/null +++ b/codebergpost.php @@ -0,0 +1,67 @@ +è stato scritto da ' . $usernamereply . ' sul gruppo Telegram chiamato ' . $grouptitle . '.
Qui di seguito il messaggio:

' . $replymessagetext . '", +"closed": false, +"labels": [ xxx, xxx ], +"milestone": 0, +"title": "' . $titolopronto . '" +}'; + +$ch = curl_init(); +curl_setopt($ch, CURLOPT_URL, "https://codeberg.org/api/v1/repos/lealternative/LeAlternative/issues?access_token=xxx"); +curl_setopt($ch, CURLOPT_POST, 1); +curl_setopt($ch, CURLOPT_HTTPHEADER, array('accept: application/json','Content-Type: application/json')); +curl_setopt($ch, CURLOPT_POSTFIELDS, $codeberg ); +$response = curl_exec($ch); +curl_close($ch); + +echo $response; + +$content = array( + 'chat_id' => $chat_id, + 'reply_to_message_id' => $replymessageid, + 'text' => "Ok, l'errore è stato segnalato in automatico su Codeberg, grazie!", +'parse_mode' => 'HTML', +'disable_web_page_preview' => true + ); + $telegram->sendMessage($content); + +} + +if ($userID == 'xxx' || $userID == 'xxx' AND stripos($text, "/new") === 0) { +$titolopronto = substr($text, 4); +$codeberg = '{ +"assignee": "xxx", +"body": "Questo post è creato automaticamente da un bot. Questo messaggio è stato scritto da ' . $usernamereply . ' sul gruppo Telegram chiamato ' . $grouptitle . '.
Qui di seguito il messaggio:

' . $replymessagetext . '", +"closed": false, +"labels": [ xxx, xxx ], +"milestone": 0, +"title": "' . $titolopronto . '" +}'; + +$ch = curl_init(); +curl_setopt($ch, CURLOPT_URL, "https://codeberg.org/api/v1/repos/lealternative/LeAlternative/issues?access_token=xxx"); +curl_setopt($ch, CURLOPT_POST, 1); +curl_setopt($ch, CURLOPT_HTTPHEADER, array('accept: application/json','Content-Type: application/json')); +curl_setopt($ch, CURLOPT_POSTFIELDS, $codeberg ); +$response = curl_exec($ch); +curl_close($ch); + +echo $response; + +$content = array( + 'chat_id' => $chat_id, + 'reply_to_message_id' => $replymessageid, + 'text' => "Ok, il suggerimento è stato segnalato in automatico su Codeberg, grazie!", +'parse_mode' => 'HTML', +'disable_web_page_preview' => true + ); + $telegram->sendMessage($content); + +} + +?> \ No newline at end of file