Carica file su ''

This commit is contained in:
Le Alternative 2021-02-18 09:21:40 +01:00
parent 8abbee2dc1
commit 598fe4958f
1 changed files with 217 additions and 0 deletions

217
frasi.php Normal file
View File

@ -0,0 +1,217 @@
<?php
if($msgType == 'inline_query'){
if(!empty($inline_query_text)){
$results = array(
array(
"type" => "article",
"id" => "1",
"title" => "Alternative a Google Search",
"message_text" => "Come alternativa a Google consigliamo *DuckDuckGo*, *Swisscows* e *Startpage*. Leggi il nostro articolo: [Alternative a Google Search](https://t.me/iv?url=https://www.lealternative.net/2019/10/18/alternative-a-google-search/&rhash=27fd4bba8b34fa\)",
"parse_mode" => "markdown",
"url" => "https://www.lealternative.net/2019/10/18/alternative-a-google-search/",
"thumb_url" => "https://www.lealternative.net/wp-content/uploads/2019/10/alternativeagooglesearch2.jpg.webp",
"description" => "Motori di ricerca alternativi"
),
array(
"type" => "article",
"id" => "2",
"title" => "Alternative a Google Chrome",
"message_text" => "Come alternativa a Google Chrome su desktop consigliamo *Firefox* e *Brave*. Su Android meglio usare *Bromite*, *Firefox*, *Brave* oppure *DuckDuckGo Browser*. Su iOS potete provare *Firefox*, *DuckDuckGo Browser*, *Brave* e *SnowHaze*. Leggi il nostro articolo: [Alternative a Google Chrome](https://t.me/iv?url=https://www.lealternative.net/2019/10/21/alternative-a-google-chrome/&rhash=27fd4bba8b34fa)",
"parse_mode" => "markdown",
"url" => "https://www.lealternative.net/2019/10/21/alternative-a-google-chrome/",
"thumb_url" => "https://www.lealternative.net/wp-content/uploads/2019/10/alternativeagooglechrome2.jpg.webp",
"description" => "Browser alternativi"
),
array(
"type" => "article",
"id" => "3",
"title" => "Alternative a YouTube",
"message_text" => "Puoi vedere YouTube privatamente con *NewPipe* su Android. Puoi usare *FreeTube* su desktop e il sito *Invidious* sul web. Prova anche l'alternative decentralizzata a YouTube chiamata *PeerTube*! Leggi il nostro articolo: [Alternative a Youtube](https://t.me/iv?url=https://www.lealternative.net/2019/10/22/alternative-a-youtube/&rhash=27fd4bba8b34fa)",
"parse_mode" => "markdown",
"url" => "https://www.lealternative.net/2019/10/22/alternative-a-youtube/",
"thumb_url" => "https://www.lealternative.net/wp-content/uploads/2019/10/alternativeayoutube2.jpg.webp",
"description" => "YouTube e video sharing"
),
array(
"type" => "article",
"id" => "4",
"title" => "Alternative a Google Translate",
"message_text" => "Non esiste solo Google Translate. Puoi provare *DeepL*, *LibreTranslate* e *Tatoeba*. Leggi il nostro articolo: [Alternative a Google Traduttore](https://t.me/iv?url=https://www.lealternative.net/2019/10/24/alternative-a-google-traduttore/&rhash=27fd4bba8b34fa)",
"parse_mode" => "markdown",
"url" => "https://www.lealternative.net/2019/10/24/alternative-a-google-traduttore/",
"thumb_url" => "https://www.lealternative.net/wp-content/uploads/2019/10/alternativeagoogletraduttore2.jpg.webp",
"description" => "Traduzioni"
),
array(
"type" => "article",
"id" => "5",
"title" => "Alternative a Google Maps",
"message_text" => "Prova qualcosa di diverso da Google Maps come *OsmAND*, *Magic Earth* oppure le mappe su *DuckDuckGo*. Per i mezzi pubblici pubblici prova *CityMapper* e *Moovit*. Per la bici? Prova *Naviki*! Leggi il nostro articolo: [Alternative a Google Maps](https://t.me/iv?url=https://www.lealternative.net/2019/10/25/alternative-a-google-maps/&rhash=27fd4bba8b34fa)",
"parse_mode" => "markdown",
"url" => "https://www.lealternative.net/2019/10/25/alternative-a-google-maps/",
"thumb_url" => "https://www.lealternative.net/wp-content/uploads/2019/10/alternativeagooglemaps2.jpg.webp",
"description" => "Mappe e viaggi"
),
array(
"type" => "article",
"id" => "6",
"title" => "Alternative a Gmail",
"message_text" => "Esistono email sicure e private come ad esempio *ProtonMail*, *Tutanota* oppure *Posteo*. Leggi il nostro articolo: [Alternative a Gmail](https://t.me/iv?url=https://www.lealternative.net/2019/10/28/alternative-a-gmail/&rhash=27fd4bba8b34fa)",
"parse_mode" => "markdown",
"url" => "https://www.lealternative.net/2019/10/28/alternative-a-gmail/",
"thumb_url" => "https://www.lealternative.net/wp-content/uploads/2019/10/alternativeagmail2-1.jpg.webp",
"description" => "Email"
),
array(
"type" => "article",
"id" => "7",
"title" => "Alternative a Google Drive",
"message_text" => "Esistono tantissime alternative a Google Drive! Queste secondo noi le migliore: *Tresorit*, *Mega*, *Sync*, *Nextcloud*, *kDrive*, *Koofr*. Leggi il nostro articolo: [Alternative a Google Drive](https://t.me/iv?url=https://www.lealternative.net/2019/10/29/alternative-a-google-drive/&rhash=27fd4bba8b34fa)",
"parse_mode" => "markdown",
"url" => "https://www.lealternative.net/2019/10/29/alternative-a-google-drive/",
"thumb_url" => "https://www.lealternative.net/wp-content/uploads/2019/10/alternativeagoogledrive2.jpg.webp",
"description" => "File in cloud"
),
array(
"type" => "article",
"id" => "8",
"title" => "Alternative a Google Password Manager",
"message_text" => "I password manager sono fondamentali per la sicurezza online. Prova *Bitwarden*, *Keepass* oppure *Firefox Lockwise*. Leggi il nostro articolo: [Alternative a Google Password Manager](https://t.me/iv?url=https://www.lealternative.net/2019/10/31/alternative-a-google-password-manager/&rhash=27fd4bba8b34fa)",
"parse_mode" => "markdown",
"url" => "https://www.lealternative.net/2019/10/31/alternative-a-google-password-manager/",
"thumb_url" => "https://www.lealternative.net/wp-content/uploads/2019/10/alternativeagooglepassword2.jpg.webp",
"description" => "Password al sicuro"
),
array(
"type" => "article",
"id" => "9",
"title" => "Alternative a Google Authenticator",
"message_text" => "Oltre a una password sicura è fondamentale l'autenticazione a due fattori. Quale applicazione utilizzare per la 2FA? Prova *Aegis* e *andOTP*! Leggi il nostro articolo: [Alternative a Google Authenticator](https://t.me/iv?url=https://www.lealternative.net/2019/11/01/alternative-a-google-authenticator/&rhash=27fd4bba8b34fa)",
"parse_mode" => "markdown",
"url" => "https://www.lealternative.net/2019/11/01/alternative-a-google-authenticator/",
"thumb_url" => "https://www.lealternative.net/wp-content/uploads/2019/11/alternativeagoogleauthenticator2-1.jpg.webp",
"description" => "Autenticazione a due fattori"
),
array(
"type" => "article",
"id" => "10",
"title" => "Alternative a Google Keep",
"message_text" => "Sono tante le applicazioni per prendere appunti in sicurezza. Prova *Standard Notes*, *Carnet*, *Simplenote* oppure *Joplin*. Leggi il nostro articolo: [Alternative a Google Keep](https://t.me/iv?url=https://www.lealternative.net/2019/11/04/alternative-a-google-keep/&rhash=27fd4bba8b34fa)",
"parse_mode" => "markdown",
"url" => "https://www.lealternative.net/2019/11/04/alternative-a-google-keep/",
"thumb_url" => "https://www.lealternative.net/wp-content/uploads/2019/11/alternativeagooglekeep2.jpg.webp",
"description" => "Prendere appunti e creare note"
),
array(
"type" => "article",
"id" => "11",
"title" => "Alternative a GBoard",
"message_text" => "Puoi provare una tastiera open source al posto di quella predefinita di Google e al posto di Microsoft SwiftKey. Cerca *Simple Keyboard*, *OpenBoard*, *AnySoftKeyboard* oppure *Hacker's Keyboard*. Leggi il nostro articolo: [Alternative a GBoard](https://t.me/iv?url=https://www.lealternative.net/2019/12/23/alternative-a-gboard/&rhash=27fd4bba8b34fa)",
"parse_mode" => "markdown",
"url" => "https://www.lealternative.net/2019/12/23/alternative-a-gboard/",
"thumb_url" => "https://www.lealternative.net/wp-content/uploads/2019/12/alternativeagboard2.jpg.webp",
"description" => "Tastiere Android"
),
array(
"type" => "article",
"id" => "12",
"title" => "Alternative a Whatsapp",
"message_text" => "Ci sono molte alternative interessanti a Whatsapp. Parliamo di *Signal*, *Threema* ma anche di *Element* che utilizza il protocollo *Matrix*. E ovviamente *Telegram*. Leggi il nostro articolo: [Alternative a Whatsapp](https://t.me/iv?url=https://www.lealternative.net/2020/01/09/alternative-a-whatsapp/&rhash=27fd4bba8b34fa)",
"parse_mode" => "markdown",
"url" => "https://www.lealternative.net/2020/01/09/alternative-a-whatsapp/",
"thumb_url" => "https://www.lealternative.net/wp-content/uploads/2020/01/alternativeawhatsapp2-1.jpg.webp",
"description" => "Messaggistica istantanea"
),
array(
"type" => "article",
"id" => "13",
"title" => "Alternative a Google Messaggi",
"message_text" => "Anche per leggere gli SMS ci sono alternative open source valide. Prova *Signal*, *QKSMS* e *Simple SMS Messenger*. Leggi il nostro articolo: [Alternative a Google Messaggi](https://t.me/iv?url=https://www.lealternative.net/2020/01/14/alternative-a-google-messaggi/&rhash=27fd4bba8b34fa)",
"parse_mode" => "markdown",
"url" => "https://www.lealternative.net/2020/01/14/alternative-a-google-messaggi/",
"thumb_url" => "https://www.lealternative.net/wp-content/uploads/2020/01/alternativeagooglemessaggi.jpg.webp",
"description" => "SMS"
),
array(
"type" => "article",
"id" => "14",
"title" => "Alternative a Google Photos",
"message_text" => "Come archiviare le proprie foto online senza Google Photo? Prova *Piwigo*, *Cryptee*, *Jottacloud* e anche *Stingle Photos*. Leggi il nostro articolo: [Alternative a Google Photos](https://t.me/iv?url=https://www.lealternative.net/2020/01/22/alternative-a-google-photos/&rhash=27fd4bba8b34fa)",
"parse_mode" => "markdown",
"url" => "https://www.lealternative.net/2020/01/22/alternative-a-google-photos/",
"thumb_url" => "https://www.lealternative.net/wp-content/uploads/2020/01/alternativeagooglephotos2.jpg.webp",
"description" => "Fotografie in cloud"
),
array(
"type" => "article",
"id" => "15",
"title" => "Alternative a Google News",
"message_text" => "Per leggere le notizie e rimanere aggiornati noi consigliamo di utilizzare gli *RSS* con programmi come *Newsblur* o *Flym News Reader*. Leggi il nostro articolo: [Alternative a Google News](https://t.me/iv?url=https://www.lealternative.net/2020/01/29/alternative-a-google-news/&rhash=27fd4bba8b34fa)",
"parse_mode" => "markdown",
"url" => "https://www.lealternative.net/2020/01/29/alternative-a-google-news/",
"thumb_url" => "https://www.lealternative.net/wp-content/uploads/2020/01/alternativeagooglenews.jpg.webp",
"description" => "Notizie e aggiornamenti"
),
array(
"type" => "article",
"id" => "16",
"title" => "Alternative a Microsoft Office",
"message_text" => "Sapevi che OpenOffice non viene più aggiornato da quasi 10 anni? Prova a utilizzare *LibreOffice*. Leggi il nostro articolo: [Alternative a Microsoft Office](https://t.me/iv?url=https://www.lealternative.net/2020/02/05/alternative-a-microsoft-office/&rhash=27fd4bba8b34fa)",
"parse_mode" => "markdown",
"url" => "https://www.lealternative.net/2020/02/05/alternative-a-microsoft-office/",
"thumb_url" => "https://www.lealternative.net/wp-content/uploads/2020/01/microsoftoffice.jpg.webp",
"description" => "Documenti e fogli di calcolo"
),
array(
"type" => "article",
"id" => "17",
"title" => "Alternative a Google Calendar",
"message_text" => "Tante le alternative per gestire i calendari, da *Tutanota* a *Fruux* passando per *Nextcloud* e *Kolab Now*. Leggi il nostro articolo: [Alternative a Google Calendar](https://t.me/iv?url=https://www.lealternative.net/2020/02/19/alternative-a-google-calendar/&rhash=27fd4bba8b34fa)",
"parse_mode" => "markdown",
"url" => "https://www.lealternative.net/2020/02/19/alternative-a-google-calendar/",
"thumb_url" => "https://www.lealternative.net/wp-content/uploads/2020/02/calendario.jpg.webp",
"description" => "Calendario"
)
);
// INIZIO MODIFICHE FRANCESCO
//definiamo un nuovo array vuoto
$resultfiltered = [];
// Guida veloce array PHP: https://www.selectallfromdual.com/blog/5013/gli-array-in-php
// Ciclo l'array $result e inserisco il valore di ogni elemento in $value
foreach ($results as $value) {
//verifica se nel title dell'elemento dell'array è contenuto il valore che abbiamo inserito
if (strpos(strtoupper($value["title"]), strtoupper($inline_query_text)) !== false
or
strpos(strtoupper($value["description"]), strtoupper($inline_query_text)) !== false
or
strpos(strtoupper($value["message_text"]), strtoupper($inline_query_text)) !== false
) {
//se la nostra $inline_query_text è contenuta nel title del singolo elemento dell'array, allora inseriamo $value nel nostro nuovo array
array_push($resultfiltered, $value);
}
}
//$results = json_encode($results);
$results = json_encode($resultfiltered);
// così ad occhio dovrebbe funzionare :)
// FINE MODIFICHE FRANCESCO
$content = array('inline_query_id' => $inline_query_id, "results" => $results);
$telegram->answerInlineQuery($content);
}
}
?>