Add files via upload

pull/1/head
to3k 2022-11-27 19:07:43 +01:00 zatwierdzone przez GitHub
rodzic f3d9b13b16
commit bbfcec3bbd
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
10 zmienionych plików z 2753 dodań i 0 usunięć

347
bug_report.php 100644
Wyświetl plik

@ -0,0 +1,347 @@
<?php
header('Content-Type: text/html; charset=utf-8');
require("/*mysql config file*/");
$mysqli = mysqli_connect($host, $user, $pass, $nazwa_bazy) or die('ERROR TD01');
mysqli_set_charset($mysqli, "utf8mb4");
$twitter = addslashes(strip_tags($_GET['t']));
$mastodon = addslashes(strip_tags($_GET['m']));
if(!empty($twitter) OR !empty($mastodon))
{
$case_get = "https://twittodon.com/confirm.php?t=".$twitter."&m=".$mastodon;
}
else
{
$case_get = "Not specified";
}
session_start();
$alert = 0;
if(isset($_POST['submit'])) {
if(addslashes(strip_tags($_POST['form_address'])) != "" AND addslashes(strip_tags($_POST['form_name'])) != "" AND addslashes(strip_tags($_POST['form_message'])) != "")
{
$email = addslashes(strip_tags($_POST['form_address']));
$check = '/^[a-zA-Z0-9.\-_]+@[a-zA-Z0-9\-.]+\.[a-zA-Z]{2,4}$/';
if(preg_match($check, $email))
{
if($_SESSION['captcha'] != addslashes(strip_tags($_POST['user_code'])))
{
$alert = 1;
}
else
{
$message = "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />
</head>
<body>
<b>Submitter's address:</b> ".addslashes(strip_tags($_POST['form_address']))."<br>
<b>Submitter's name:</b> ".addslashes(strip_tags($_POST['form_name']))."<br>
<b>IP:</b> ".addslashes(strip_tags($_POST['ip']))."<br>
<b>Problem with:</b> ".addslashes(strip_tags($_POST['form_case']))."<br>
<b>Message:</b><br>
".addslashes(strip_tags($_POST['form_message']))."
</body>
</html>";
$subject="Bug report from Twittodon.com ".date('d-m-Y H:i');
$header = "MIME-Version: 1.0r\n"."Content-type: text/html; charset=utf-8\n";
$header .= "From: ".addslashes(strip_tags($_POST['form_address']))."\n";
$address = "support@twittodon.com";
mail($address, $subject, $message, $header);
$alert = 2;
}
}
else
{
$alert = 3;
}
}
else { $alert = 4; }
}
if($_SERVER['HTTP_CLIENT_IP'])
{
$ip = $_SERVER['HTTP_CLIENT_IP'];
}
elseif($_SERVER['HTTP_X_FORWARDED_FOR'])
{
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
else
{
$ip = $_SERVER['REMOTE_ADDR'];
}
mysqli_close($mysqli);
//Change language
$full_url = "https://pl.twittodon.com".$_SERVER['REQUEST_URI'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="Author" content="Tomasz Dunia">
<meta name="Description" content="Twittodon.com - Connect your Twitter and Mastodon accounts and verify it to let you followers be sure that those are your official accounts!" />
<meta name="Keywords" content="twitter, mastodon, fediverse, connect, verify" />
<meta name="viewport" content="width=device-width, initial-scale=0.7">
<title>Report bug - Twittodon.com - Connect your Twitter and Mastodon accounts and verify it!</title>
<link rel="icon" href="favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
<style>
body {
font-family: Verdana;
font-size: 14px;
margin: 40px;
background: #333333;
display: flex;
align-items: center;
text-align: center;
justify-content: center;
place-items: center;
}
.container {
position: relative;
width: 750px;
border-radius: 20px;
padding: 40px;
box-sizing: border-box;
background: #333333;
box-shadow: 10px 10px 20px 10px #000000, -10px -10px 20px 10px #666666;
}
.home {
font-family: Verdana;
font-size: 12px;
color: #ffffff;
text-shadow: 0 0 0.5em #000000, 0 0 0.5em #000000, 0 0 0.5em #000000;
height: 100px;
width: 100px;
background: url("/img/twittodon_logo_800x800_white_transparent.png");
background-size: cover;
margin: auto;
border-radius: 50%;
box-sizing: border-box;
box-shadow: 7px 7px 10px #000000, -7px -7px 10px #666666;
cursor: pointer;
transition: 0.5s;
}
home:hover {
box-shadow: none;
}
.inputs {
text-align: center;
margin-top: 30px;
}
label, input, button, textarea {
display: block;
width: 100%;
padding: 0;
border: none;
outline: none;
box-sizing: border-box;
}
label {
margin-bottom: 10px;
text-align: center;
color: #ffffff;
}
label:nth-of-type(2) {
margin-top: 12px;
}
message-green {
margin-bottom: 4px;
color: green;
font-size:12px;
}
message-green:nth-of-type(2) {
margin-top: 12px;
}
message-red {
margin-bottom: 4px;
color: red;
font-size:12px;
}
message-red:nth-of-type(2) {
margin-top: 12px;
}
input::placeholder {
color: #ffffff;
opacity: 0.5;
}
input {
font-family: Verdana;
font-size: 12px;
background: #333333;
color: #ffffff;
padding: 10px;
padding-left: 20px;
height: 50px;
text-align: center;
border-radius: 25px;
box-shadow: inset 5px 5px 5px #000000, inset -5px -5px 5px #666666;
-webkit-appearance: none;
-webkit-text-fill-color: #ffffff;
opacity: 1;
}
textarea {
font-family: Verdana;
font-size: 12px;
background: #333333;
color: #ffffff;
padding: 10px;
padding-left: 20px;
text-align: center;
border-radius: 25px;
box-shadow: inset 5px 5px 5px #000000, inset -5px -5px 5px #666666;
-webkit-appearance: none;
opacity: 1;
resize: vertical;
}
button {
font-family: Verdana;
font-size: 14px;
color: #ffffff;
margin-top: 20px;
background: none;
height: 40px;
border-radius: 20px;
cursor: pointer;
font-weight: 900;
box-shadow: 5px 5px 5px #000000, -5px -5px 5px #666666;
transition: 0.5s;
}
button:hover {
box-shadow: none;
}
a, a:hover, a:active, a:visited { color: white; }
highlight_blue {
color: #1DA1F2;
font-weight: bold;
}
highlight_purple {
color: #6364ff;
font-weight: bold;
}
.lang {
font-family: Verdana;
font-size: 12px;
color: #ffffff;
text-shadow: 0 0 0.5em #000000, 0 0 0.5em #000000, 0 0 0.5em #000000;
height: 30px;
width: 30px;
margin: auto;
border-radius: 50%;
box-sizing: border-box;
box-shadow: 7px 7px 10px #000000, -7px -7px 10px #666666;
cursor: pointer;
transition: 0.5s;
position: absolute;
top: 15px;
right: 15px;
}
.plflag {
background: url("/img/pl_flag.png");
background-size: cover;
}
.ukflag {
background: url("/img/uk_flag.png");
background-size: cover;
}
</style>
</head>
<body>
<div class="container">
<button type="button" class="lang plflag" onClick="location.href='<?php echo "$full_url"; ?>';"></button>
<button type="button" class="home" onClick="location.href='https://twittodon.com';"></button>
<br>
<label><h2>Report bug form</h2></label>
<label>&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;</label>
<?php
if($alert==1)
{
echo "<h3><font color=\"red\"><img src=\"/img/fail.png\" height=\"15px\" /> Message not sent. Invalid CAPTCHA.</font></h3>";
}
elseif($alert==2)
{
echo "<h3><font color=\"green\">Message sent.</font></h3></body></html>";
exit;
}
elseif($alert==3)
{
echo "<h3><font color=\"red\"><img src=\"/img/fail.png\" height=\"15px\" /> The message has not been sent. An invalid email address was provided.</font></h3>";
}
elseif($alert==4)
{
echo "<h3><font color=\"red\"><img src=\"/img/fail.png\" height=\"15px\" /> The message has not been sent. All fields must be filled.</font></h3>";
}
?>
<div class="inputs">
<form method="post" action="">
<?php
echo "<input type=\"hidden\" name=\"ip\" value=\"".$ip."\" />";
echo "<input type=\"hidden\" name=\"form_case\" value=\"".$case_get."\" />";
?>
<input type="text" name="form_address" placeholder="Enter your e-mail address, so I can write you back" <?php echo "value=\"".addslashes(strip_tags($_POST['form_address']))."\""; ?> size="30"><br>
<input type="text" name="form_name" placeholder="Enter your name, so I know how to call you" <?php echo "value=\"".addslashes(strip_tags($_POST['form_name']))."\""; ?> size="30"><br>
<textarea name="form_message" placeholder="Type your message here..." size="30" rows="15"><?php echo addslashes(strip_tags($_POST['form_message'])); ?></textarea><br>
<img src="captcha.php" alt="Captcha" /><br>
<input type="text" name="user_code" placeholder="Enter the code from the image"><br>
<button type="submit" name="submit">Send</button><br>
<br><br>
</form>
</div>
<label>
<center>
<table style="font-size: 12px;">
<tr>
<td style="text-align: center; padding-right: 15px; border-right: solid 1px white;">
<a href="https://tomaszdunia.pl" target="_blank"><img src="/img/author.gif" style="border-radius: 50%; height: 80px;" /></a><br>
Author:<br>
Tomasz Dunia<br>
<i>to3k</i>
</td>
<td style="vertical-align: top; padding-left: 15px; border-left: solid 1px white;">
<img src="/img/website_icon.png" height="10px" /> Website: <a href="https://tomaszdunia.pl" target="_blank">tomaszdunia.pl</a><br>
<img src="/img/twitter_icon.png" height="10px" /> Twitter: <a href="https://twitter.com/theto3k" target="_blank">@theto3k</a><br>
<img src="/img/mastodon_icon.png" height="10px" /> Mastodon: <a href="https://mstdn.social/@to3k" target="_blank">to3k@mstdn.social</a><br>
<img src="/img/email_icon.png" height="10px" /> Write to me using <a href="contact.php">contact form</a> (🇬🇧/🇵🇱).<br>
<img src="/img/no_icon.png" height="10px" /> <img src="/img/cookies_icon.png" height="10px" /> This site is not using cookies.<br>
<img src="/img/no_icon.png" height="10px" /> <img src="/img/eye_icon.png" height="10px" /> This site is free of any tracking scripts.<br>
This site is transparent so:<br>
<img src="/img/stats_icon.png" height="10px" /> <a href="stats.php">You have an access to it's statistics!</a><br>
</td>
</tr>
</table>
</center>
</label>
</div>
</body>
</html>

20
captcha.php 100644
Wyświetl plik

@ -0,0 +1,20 @@
<?php
header("Content-type: image/png");
$string = "abcdefghijklmnopqrstuvwxyz0123456789";
$szesc_znakow = NULL;
for($i=0;$i<6;$i++){
$pozycja_znaku = rand(0,strlen($string));
$szesc_znakow .= $string[$pozycja_znaku];
}
$obrazek = ImageCreate(60, 20) or die("Serwer posiada biblioteke GD?");
//255, 255, 255 - czyli kolor bialy
$kolor_tla = ImageColorAllocate($obrazek, 255, 255, 255);
//0, 0, 0 - czyli kolor czarny
$kolor_tekstu = ImageColorAllocate($obrazek, 0, 0, 0);
ImageString($obrazek, 32, 5, 0, $szesc_znakow, $kolor_tekstu);
Imagepng($obrazek);
session_start();
$_SESSION['captcha'] = $szesc_znakow;
?>

506
confirm.php 100644
Wyświetl plik

@ -0,0 +1,506 @@
<?php
header('Content-Type: text/html; charset=utf-8');
require("/*mysql config file*/");
$mysqli = mysqli_connect($host, $user, $pass, $nazwa_bazy) or die('ERROR TD01');
mysqli_set_charset($mysqli, "utf8mb4");
$twitter = addslashes(strip_tags($_GET['t']));
$mastodon = addslashes(strip_tags($_GET['m']));
$explode = explode("@", $mastodon);
$mastodon_user = $explode[0];
$mastodon_server = $explode[1];
$mastodon_link = "https://".$explode[1]."/@".$explode[0];
if(isset($_POST['verify_twitter']))
{
$nitter_link = "https://nitter.net/".$twitter;
$curl = curl_init($nitter_link);
curl_setopt($curl, CURLOPT_URL, $nitter_link);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36');
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_HEADER, 0);
$site_source_code = curl_exec($curl);
for($i=1; $i<=5; $i++)
{
if($site_source_code == "") { $site_source_code=curl_exec($curl); }
else { break; }
}
preg_match("(<div class=\"tweet-content media-body\" dir=\"auto\">.+?".$mastodon_link.".+?Twittodon.com)is", $site_source_code, $phrase);
if(!empty($phrase[0]))
{
$update = "UPDATE connections SET twitter_verified='1' WHERE twitter_login='".$twitter."' AND mastodon_login='".$mastodon."'";
mysqli_query($mysqli, $update) or die('ERROR TD02');
}
else
{
$twitter_verified_error = true;
}
}
if(isset($_POST['verify_mastodon']))
{
$mastodon_rss = $mastodon_link.".rss";
$curl = curl_init($mastodon_rss);
curl_setopt($curl, CURLOPT_URL, $mastodon_rss);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36');
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_HEADER, 0);
$site_source_code = curl_exec($curl);
for($i=1; $i<=5; $i++)
{
if($site_source_code == "") { $site_source_code=curl_exec($curl); }
else { break; }
}
preg_match("(<description>.+?twitter.com\/".$twitter.".+?Twittodon.com)is", $site_source_code, $phrase);
if(!empty($phrase[0]))
{
$update = "UPDATE connections SET mastodon_verified='1' WHERE twitter_login='".$twitter."' AND mastodon_login='".$mastodon."'";
mysqli_query($mysqli, $update) or die('ERROR TD03');
}
else
{
$mastodon_verified_error = true;
}
}
$query = "SELECT * FROM connections WHERE twitter_login='".$twitter."' AND mastodon_login='".$mastodon."'";
$result = mysqli_query($mysqli, $query) or die('ERROR TD04');
$fromdb = mysqli_fetch_row($result);
//$fromdb[0] - id
//$fromdb[1] - twitter_login
//$fromdb[2] - twitter_verified
//$fromdb[3] - mastodon_login
//$fromdb[4] - mastodon_verified
//$fromdb[5] - twitter_name
//$fromdb[6] - twitter_img
//$fromdb[7] - mastodon_name
//$fromdb[8] - mastodon_img
//$fromdb[9] - date
mysqli_close($mysqli);
//Change language
$full_url = "https://pl.twittodon.com".$_SERVER['REQUEST_URI'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="Author" content="Tomasz Dunia">
<meta name="Description" content="Twittodon.com - Connect your Twitter and Mastodon accounts and verify it to let you followers be sure that those are your official accounts!" />
<meta name="Keywords" content="twitter, mastodon, fediverse, connect, verify" />
<meta name="viewport" content="width=device-width, initial-scale=0.7">
<title>Confirm - Twittodon.com - Connect your Twitter and Mastodon accounts and verify it!</title>
<link rel="icon" href="favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
<style>
body {
font-family: Verdana;
font-size: 14px;
margin: 40px;
background: #333333;
display: flex;
align-items: center;
text-align: center;
justify-content: center;
place-items: center;
}
.container {
position: relative;
width: 750px;
border-radius: 20px;
padding: 40px;
box-sizing: border-box;
background: #333333;
box-shadow: 10px 10px 20px 10px #000000, -10px -10px 20px 10px #666666;
}
.home {
font-family: Verdana;
font-size: 12px;
color: #ffffff;
text-shadow: 0 0 0.5em #000000, 0 0 0.5em #000000, 0 0 0.5em #000000;
height: 100px;
width: 100px;
background: url("/img/twittodon_logo_800x800_white_transparent.png");
background-size: cover;
margin: auto;
border-radius: 50%;
box-sizing: border-box;
box-shadow: 7px 7px 10px #000000, -7px -7px 10px #666666;
cursor: pointer;
transition: 0.5s;
}
home:hover {
box-shadow: none;
}
.inputs {
text-align: center;
margin-top: 30px;
}
label, label_red, label_green, input, textarea, button {
display: block;
width: 100%;
padding: 0;
border: none;
outline: none;
box-sizing: border-box;
}
label {
margin-bottom: 10px;
text-align: center;
color: #ffffff;
}
label_red {
margin-bottom: 10px;
text-align: center;
color: #ff0000;
}
label_green {
margin-bottom: 10px;
text-align: center;
color: #00ff00;
}
header {
margin-bottom: 10px;
text-align: center;
color: #ffffff;
font-size: 20px;
font-weight: bold;
}
label:nth-of-type(2) {
margin-top: 12px;
}
label_red:nth-of-type(2) {
margin-top: 12px;
}
label_green:nth-of-type(2) {
margin-top: 12px;
}
message-green {
margin-bottom: 4px;
color: green;
font-size:12px;
}
message-green:nth-of-type(2) {
margin-top: 12px;
}
message-red {
margin-bottom: 4px;
color: red;
font-size:12px;
}
message-red:nth-of-type(2) {
margin-top: 12px;
}
input::placeholder {
color: #ffffff;
opacity: 0.5;
}
input {
font-family: Verdana;
font-size: 12px;
background: #333333;
color: #ffffff;
padding: 10px;
padding-left: 20px;
height: 50px;
text-align: center;
border-radius: 25px;
box-shadow: inset 5px 5px 5px #000000, inset -5px -5px 5px #666666;
-webkit-appearance: none;
-webkit-text-fill-color: #ffffff;
opacity: 1;
}
textarea {
font-family: Verdana;
font-size: 12px;
background: #333333;
color: #ffffff;
padding: 10px;
padding-left: 20px;
height: 50px;
text-align: center;
border-radius: 25px;
box-shadow: inset 5px 5px 5px #000000, inset -5px -5px 5px #666666;
-webkit-appearance: none;
-webkit-text-fill-color: #ffffff;
opacity: 1;
resize: none;
}
button {
font-family: Verdana;
font-size: 14px;
color: #ffffff;
margin-top: 20px;
background: none;
height: 40px;
border-radius: 20px;
cursor: pointer;
font-weight: 900;
box-shadow: 5px 5px 5px #000000, -5px -5px 5px #666666;
transition: 0.5s;
}
button:hover {
box-shadow: none;
}
a, a:hover, a:active, a:visited { color: white; }
.lang {
font-family: Verdana;
font-size: 12px;
color: #ffffff;
text-shadow: 0 0 0.5em #000000, 0 0 0.5em #000000, 0 0 0.5em #000000;
height: 30px;
width: 30px;
margin: auto;
border-radius: 50%;
box-sizing: border-box;
box-shadow: 7px 7px 10px #000000, -7px -7px 10px #666666;
cursor: pointer;
transition: 0.5s;
position: absolute;
top: 15px;
right: 15px;
}
.plflag {
background: url("/img/pl_flag.png");
background-size: cover;
}
.ukflag {
background: url("/img/uk_flag.png");
background-size: cover;
}
</style>
</head>
<body>
<div class="container">
<button type="button" class="lang plflag" onClick="location.href='<?php echo "$full_url"; ?>';"></button>
<button type="button" class="home" onClick="location.href='https://twittodon.com';"></button>
<div class="inputs">
<?php
if(empty($fromdb))
{
echo "<header>VERIFICATION PROCESS</header><br>";
echo "<label_red><img src=\"/img/fail.png\" height=\"15px\" /> Something went wrong!<br>There is no such connection in the database yet. You need to declare account credentials first.<br>Complete previous step first:</label_red><br>";
echo "<button type=\"button\" onClick=\"location.href='connect.php';\">Take me there</button>";
}
elseif($fromdb[2]==1 AND $fromdb[4]==1)
{
echo "<header>SUCCESS!</header>";
echo "<label>&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;</label>";
echo "<label><h3>These accounts:</h3></label>";
echo "<label><a href=\"https://twitter.com/".$fromdb[1]."\" target=\"_blank\"><img src=\"/img/twitter_logo-napis-badge_500x2600.png\" height=\"50px\" /><br>".$fromdb[5]." (@".$fromdb[1].")</a></label>";
echo "<label><font size=\"20px\">+</font></label>";
echo "<label><a href=\"".$mastodon_link."\" target=\"_blank\"><img src=\"/img/mastodon_logo-napis-badge_500x2600.png\" height=\"50px\" /><br>".$fromdb[7]." (".$fromdb[3].")</a></label>";
echo "<label><h3>are already verified!</h3></label>";
echo "<label>&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;</label>";
echo "<label>The connection of your accounts has been placed in the database,<br>so greater audience can now easily find you!</label>";
echo "<button type=\"button\" onClick=\"location.href='verified.php'\">Go to database</button>";
echo "<br><label>&bull;</label>";
echo "<label>Now you can go to confirmation page and share it with your followers!</label>";
echo "<button type=\"button\" onClick=\"location.href='https://twittodon.com/share.php?t=".$twitter."&m=".$mastodon."'\">Take me there</button>";
echo "<br><label>&bull;</label>";
echo "<label><b>Finally, I have a bonus for you!</b><br>You can copy the link below and put it in your profile on Mastodon (<i>Preferences -> Profile -> Appearance -> Profile metadata section</i>). It will be automatically verified by your instance and will point directly to your Twittodon confirmation page with links to both your profiles and information that connection between them is verified.<br><br><img src=\"/img/twitter_verified_link_on_mastodon.png\" width=\"90%\" /></label>";
echo "<input type=\"text\" id=\"CopyInput3\" value=\"https://twittodon.com/share.php?t=".$twitter."&m=".$mastodon."\" size=\"20\" disabled>";
echo "<button type=\"button\" id=\"CopyButton3\" onclick=\"CopyFunction3()\">Copy</button>";
}
else
{
echo "<header>VERIFICATION PROCESS</header><br>";
echo "<label>By using link below, you can come back here later and finish this process:</label>";
echo "<input type=\"text\" id=\"CopyInput0\" value=\"https://twittodon.com/confirm.php?t=".$twitter."&m=".$mastodon."\" size=\"20\" disabled>";
echo "<button type=\"button\" id=\"CopyButton0\" onclick=\"CopyFunction0()\">Copy</button><br>";
echo "<label>&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;</label>";
if($fromdb[2]==1)
{
echo "<label><h3>Twitter account verification:</h3></label>";
echo "<label><a href=\"https://twitter.com/".$fromdb[1]."\" target=\"_blank\"><img src=\"/img/twitter_logo-napis-badge_500x2600.png\" height=\"50px\" /><br>".$fromdb[5]." (@".$fromdb[1].")</a></label><br>";
echo "<label_green>SUCCESS!<br>Your Twitter account has been verified successfully.<br>You may proceed to verify your Mastodon account.</label_green><br>";
}
else
{
echo "<form action=\"confirm.php?t=".$twitter."&m=".$mastodon."#twitter_step4\" method=\"POST\" name=\"form1\">";
echo "<label><h3>Twitter account verification:</h3></label>";
echo "<label><a href=\"https://twitter.com/".$fromdb[1]."\" target=\"_blank\"><img src=\"/img/twitter_logo-napis_500x2000.png\" height=\"50px\" /><br>".$fromdb[5]." (@".$fromdb[1].")</a></label><br>";
echo "<label><b>Step 1</b><br>Check if this link directs to your Twitter account:<br><a href=\"https://twitter.com/".$twitter."\" target=\"_blank\">https://twitter.com/".$twitter."</a></label>";
echo "<label><b>Step 2</b><br>To verify that you are a owner of this Twitter account you need to post a tweet with the specified content. You have two options to do that.</label>";
echo "<label><b>Step 3 - <i>option 1</i></b><br>Button below will direct you to your Twitter account and prepare a proper tweet, the only thing you need to do is to confirm sending tweet (you must be logged into account which you are verifying and your account needs to be public!):</label>";
echo "<button type=\"button\" onClick=\"window.open('https://twitter.com/share?text=This is my account on Mastodon - ".$mastodon_link." - verified by Twittodon.com', '_blank');\">Prepare tweet</button><br>";
echo "<label><b>Step 3 - <i>option 2</i></b><br>If above solution doesn't work for you or you don't want to do it that way, you can do it manually by copying the text below and tweeting it on your timeline (your account needs to be public!):</label>";
echo "<textarea id=\"CopyInput1\" wrap=\"hard\" disabled>This is my account on Mastodon - ".$mastodon_link." - verified by Twittodon.com</textarea>";
echo "<button type=\"button\" id=\"CopyButton1\" onclick=\"CopyFunction1()\">Copy</button><br>";
echo "<label id=\"twitter_step4\"><b>Step 4</b><br>After posting a tweet confirm using button below to perform verification:</label>";
echo "<button type=\"submit\" id=\"verify_twitter\" name=\"verify_twitter\">Verify</button><br>";
if($twitter_verified_error==true)
{
echo "<label_red><img src=\"/img/fail.png\" height=\"15px\" /> SOMETHING WENT WRONG!<br>Check if you did all steps correctly and try again. If further failures occur, report the problem using <a href=\"bug_report.php?t=".$twitter."&m=".$mastodon."\" target=\"_blank\">this form</a>.</label_red>";
}
echo "</form>";
}
echo "<br><label>&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;</label>";
if($fromdb[4]==1)
{
echo "<label><h3>Mastodon account verification:</h3></label>";
echo "<label><a href=\"".$mastodon_link."\" target=\"_blank\"><img src=\"/img/mastodon_logo-napis-badge_500x2600.png\" height=\"50px\" /><br>".$fromdb[7]." (".$fromdb[3].")</a></label><br>";
echo "<label_green>SUCCESS!<br>Your Mastodon account has been verified successfully.</br>You may proceed to verify your Twitter account.</label_green>";
}
else
{
echo "<form action=\"confirm.php?t=".$twitter."&m=".$mastodon."#mastodon_step4\" method=\"POST\" name=\"form2\">";
echo "<label><h3>Mastodon account verification:</h3></label>";
echo "<label><a href=\"".$mastodon_link."\" target=\"_blank\"><img src=\"/img/mastodon_logo-napis_500x2000.png\" height=\"50px\" /><br>".$fromdb[7]." (".$fromdb[3].")</a></label><br>";
echo "<label><b>Step 1</b><br>Check if this link directs to your Mastodon account:<br><a href=\"".$mastodon_link."\" target=\"_blank\">".$mastodon_link."</a></label>";
echo "<label><b>Step 2</b><br>To verify that you are a owner of this Mastodon account you need to post a toot with the specified content. You have two options to do that.</label>";
echo "<label><b>Step 3 - <i>option 1</i></b><br>Button below will direct you to your Mastodon account and prepare a proper toot, the only thing you need to do is to confirm sending toot (you must be logged into account which you are verifying and your account needs to be public!):</label>";
echo "<button type=\"button\" onClick=\"window.open('https://".$mastodon_server."/publish?text=This is my account on Twitter - https://twitter.com\/".$twitter." - verified by https://Twittodon.com', '_blank');\">Prepare toot</button><br>";
echo "<label><b>Step 3 - <i>option 2</i></b><br>If above solution doesn't work for you or you don't want to do it that way, you can do it manually by copying the text below and posting it on your timeline (your account needs to be public!):</label>";
echo "<textarea id=\"CopyInput2\" wrap=\"hard\" disabled>This is my account on Twitter - twitter.com/".$twitter." - verified by https://Twittodon.com</textarea>";
echo "<button type=\"button\" id=\"CopyButton2\" onclick=\"CopyFunction2()\">Copy</button><br>";
echo "<label id=\"mastodon_step4\"><b>Step 4</b><br>After posting a toot confirm using button below to perform verification:</label>";
echo "<button type=\"submit\" id=\"verify_mastodon\" name=\"verify_mastodon\">Verify</button><br>";
if($mastodon_verified_error==true)
{
echo "<label_red><img src=\"/img/fail.png\" height=\"15px\" /> SOMETHING WENT WRONG!<br>Check if you did all steps correctly and try again. If further failures occur, report the problem using <a href=\"bug_report.php?t=".$twitter."&m=".$mastodon."\" target=\"_blank\">this form</a>.</label_red>";
}
echo "</form>";
}
}
?>
<br><br>
<label>
<center>
<table style="font-size: 12px;">
<tr>
<td style="text-align: center; padding-right: 15px; border-right: solid 1px white;">
<a href="https://tomaszdunia.pl" target="_blank"><img src="/img/author.gif" style="border-radius: 50%; height: 80px;" /></a><br>
Author:<br>
Tomasz Dunia<br>
<i>to3k</i>
</td>
<td style="vertical-align: top; padding-left: 15px; border-left: solid 1px white;">
<img src="/img/website_icon.png" height="10px" /> Website: <a href="https://tomaszdunia.pl" target="_blank">tomaszdunia.pl</a><br>
<img src="/img/twitter_icon.png" height="10px" /> Twitter: <a href="https://twitter.com/theto3k" target="_blank">@theto3k</a><br>
<img src="/img/mastodon_icon.png" height="10px" /> Mastodon: <a href="https://mstdn.social/@to3k" target="_blank">to3k@mstdn.social</a><br>
<img src="/img/email_icon.png" height="10px" /> Write to me using <a href="contact.php">contact form</a> (🇬🇧/🇵🇱).<br>
<img src="/img/no_icon.png" height="10px" /> <img src="/img/cookies_icon.png" height="10px" /> This site is not using cookies.<br>
<img src="/img/no_icon.png" height="10px" /> <img src="/img/eye_icon.png" height="10px" /> This site is free of any tracking scripts.<br>
This site is transparent so:<br>
<img src="/img/stats_icon.png" height="10px" /> <a href="stats.php">You have an access to it's statistics!</a><br>
</td>
</tr>
</table>
</center>
</label>
</div>
<script>
function CopyFunction0() {
// Get the text field
var copyText = document.getElementById("CopyInput0");
// Select the text field
copyText.select();
copyText.setSelectionRange(0, 99999); // For mobile devices
// Copy the text inside the text field
navigator.clipboard.writeText(copyText.value);
// Alert the copied text
//alert("Copied!");
var btn = document.getElementById("CopyButton0");
btn.innerHTML = "Copied!";
}
</script>
<script>
function CopyFunction1() {
// Get the text field
var copyText = document.getElementById("CopyInput1");
// Select the text field
copyText.select();
copyText.setSelectionRange(0, 99999); // For mobile devices
// Copy the text inside the text field
navigator.clipboard.writeText(copyText.value);
// Alert the copied text
//alert("Copied!");
var btn = document.getElementById("CopyButton1");
btn.innerHTML = "Copied!";
}
</script>
<script>
function CopyFunction2() {
// Get the text field
var copyText = document.getElementById("CopyInput2");
// Select the text field
copyText.select();
copyText.setSelectionRange(0, 99999); // For mobile devices
// Copy the text inside the text field
navigator.clipboard.writeText(copyText.value);
// Alert the copied text
//alert("Copied!");
var btn = document.getElementById("CopyButton2");
btn.innerHTML = "Copied!";
}
</script>
<script>
function CopyFunction3() {
// Get the text field
var copyText = document.getElementById("CopyInput3");
// Select the text field
copyText.select();
copyText.setSelectionRange(0, 99999); // For mobile devices
// Copy the text inside the text field
navigator.clipboard.writeText(copyText.value);
// Alert the copied text
//alert("Copied!");
var btn = document.getElementById("CopyButton3");
btn.innerHTML = "Copied!";
}
</script>
</body>
</html>

348
connect.php 100644
Wyświetl plik

@ -0,0 +1,348 @@
<?php
header('Content-Type: text/html; charset=utf-8');
require("/*mysql config file*/");
$mysqli = mysqli_connect($host, $user, $pass, $nazwa_bazy) or die('ERROR TD01');
mysqli_set_charset($mysqli, "utf8mb4");
if(isset($_POST['twitter']) OR isset($_POST['mastodon']))
{
$message1 = "";
$message2 = "";
$twitter = trim(addslashes(strip_tags($_POST['twitter'])));
$check1 = '/^[A-Za-z0-9_]{1,15}$/';
if(!preg_match($check1, $twitter))
{
$message1 = "<message-red><img src=\"/img/fail.png\" height=\"15px\" /> Invalid format! Correct it and try again. Format should be: USERNAME without @ (e.g. theto3k).<br>If further failures occur, report the problem using <a href=\"bug_report.php\" target=\"_blank\">this form</a>.</message-red>";
}
$mastodon = trim(addslashes(strip_tags($_POST['mastodon'])));
$check2 = '/^[a-zA-Z0-9_]+@[a-zA-Z0-9\-.]+\.[a-zA-Z]+/';
if(!preg_match($check2, $mastodon))
{
$message2 = "<message-red><img src=\"/img/fail.png\" height=\"15px\" /> Invalid format! Correct it and try again. Format should be: USERNAME@INSTANCE (e.g. to3k@mstdn.social).<br>If further failures occur, report the problem using <a href=\"bug_report.php\" target=\"_blank\">this form</a>.</message-red><br>";
}
if(empty($message1) AND empty($message2))
{
$query = "SELECT * FROM connections WHERE twitter_login='".$twitter."' AND mastodon_login='".$mastodon."' LIMIT 1";
$result = mysqli_query($mysqli, $query) or die('ERROR TD02');
if(mysqli_num_rows($result) == false)
{
$nitter_link = "https://nitter.net/".$twitter;
$curl = curl_init($nitter_link);
curl_setopt($curl, CURLOPT_URL, $nitter_link);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36');
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_HEADER, 0);
$site_source_code = curl_exec($curl);
for($i=1; $i<=5; $i++)
{
if($site_source_code == "") { $site_source_code=curl_exec($curl); }
else { break; }
}
preg_match("(class=\"profile-card-fullname\".+?>(.+?)</a>)is", $site_source_code, $phrase);
$twitter_name = addslashes(strip_tags($phrase[1]));
if(empty($twitter_name))
{
$message1 = "<message-red><img src=\"/img/fail.png\" height=\"15px\" /> Are you sure that this account exists? Check if entered username is correct.<br>If further failures occur, report the problem using <a href=\"bug_report.php\" target=\"_blank\">this form</a>.</message-red>";
}
$explode = explode("@", $mastodon);
$mastodon_user = $explode[0];
$mastodon_server = $explode[1];
$mastodon_link = "https://".$explode[1]."/@".$explode[0];
$mastodon_rss = $mastodon_link.".rss";
$curl = curl_init($mastodon_rss);
curl_setopt($curl, CURLOPT_URL, $mastodon_rss);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($curl, CURLOPT_USERAGENT, 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/88.0.4324.182 Safari/537.36');
curl_setopt($curl, CURLOPT_TIMEOUT, 30);
curl_setopt($curl, CURLOPT_HEADER, 0);
$site_source_code = curl_exec($curl);
for($i=1; $i<=5; $i++)
{
if($site_source_code == "") { $site_source_code=curl_exec($curl); }
else { break; }
}
preg_match("(<title>(.+?)</title>)is", $site_source_code, $phrase);
$mastodon_name = addslashes(strip_tags($phrase[1]));
if(empty($mastodon_name))
{
$message2 = "<message-red><img src=\"/img/fail.png\" height=\"15px\" /> Are you sure that this account exists? Check if entered username is correct.<br>If further failures occur, report the problem using <a href=\"bug_report.php\" target=\"_blank\">this form</a>.</message-red><br>";
}
$today = date("Y-m-d");
if(empty($message1) AND empty($message2))
{
$add = "INSERT INTO connections (twitter_login, twitter_verified, mastodon_login, mastodon_verified, twitter_name, mastodon_name, date) VALUES ('".$twitter."', '0', '".$mastodon."', '0', '".$twitter_name."', '".$mastodon_name."', '".$today."')";
mysqli_query($mysqli, $add) or die('ERROR TD03');
}
}
if(empty($message1) AND empty($message2))
{
header("Location: confirm.php?t=".$twitter."&m=".$mastodon);
}
}
}
mysqli_close($mysqli);
//Change language
$full_url = "https://pl.twittodon.com".$_SERVER['REQUEST_URI'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="Author" content="Tomasz Dunia">
<meta name="Description" content="Twittodon.com - Connect your Twitter and Mastodon accounts and verify it to let you followers be sure that those are your official accounts!" />
<meta name="Keywords" content="twitter, mastodon, fediverse, connect, verify" />
<meta name="viewport" content="width=device-width, initial-scale=0.7">
<title>Connect - Twittodon.com - Connect your Twitter and Mastodon accounts and verify it!</title>
<link rel="icon" href="favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
<style>
body {
font-family: Verdana;
font-size: 14px;
margin: 40px;
background: #333333;
display: flex;
align-items: center;
text-align: center;
justify-content: center;
place-items: center;
}
.container {
position: relative;
width: 750px;
border-radius: 20px;
padding: 40px;
box-sizing: border-box;
background: #333333;
box-shadow: 10px 10px 20px 10px #000000, -10px -10px 20px 10px #666666;
}
.home {
font-family: Verdana;
font-size: 12px;
color: #ffffff;
text-shadow: 0 0 0.5em #000000, 0 0 0.5em #000000, 0 0 0.5em #000000;
height: 100px;
width: 100px;
background: url("/img/twittodon_logo_800x800_white_transparent.png");
background-size: cover;
margin: auto;
border-radius: 50%;
box-sizing: border-box;
box-shadow: 7px 7px 10px #000000, -7px -7px 10px #666666;
cursor: pointer;
transition: 0.5s;
}
home:hover {
box-shadow: none;
}
.inputs {
text-align: center;
margin-top: 30px;
}
label, input, button {
display: block;
width: 100%;
padding: 0;
border: none;
outline: none;
box-sizing: border-box;
}
label {
margin-bottom: 10px;
text-align: center;
color: #ffffff;
}
label:nth-of-type(2) {
margin-top: 12px;
}
message-green {
margin-bottom: 4px;
color: green;
font-size:12px;
}
message-green:nth-of-type(2) {
margin-top: 12px;
}
message-red {
margin-bottom: 4px;
color: red;
font-size:12px;
}
message-red:nth-of-type(2) {
margin-top: 12px;
}
input::placeholder {
color: #ffffff;
opacity: 0.5;
}
input {
font-family: Verdana;
font-size: 12px;
background: #333333;
color: #ffffff;
padding: 10px;
padding-left: 20px;
height: 50px;
text-align: center;
border-radius: 25px;
box-shadow: inset 5px 5px 5px #000000, inset -5px -5px 5px #666666;
-webkit-appearance: none;
-webkit-text-fill-color: #ffffff;
opacity: 1;
}
button {
font-family: Verdana;
font-size: 14px;
color: #ffffff;
margin-top: 20px;
background: none;
height: 40px;
border-radius: 20px;
cursor: pointer;
font-weight: 900;
box-shadow: 5px 5px 5px #000000, -5px -5px 5px #666666;
transition: 0.5s;
}
button:hover {
box-shadow: none;
}
a, a:hover, a:active, a:visited { color: white; }
highlight_blue {
color: #1DA1F2;
font-weight: bold;
}
highlight_purple {
color: #6364ff;
font-weight: bold;
}
.lang {
font-family: Verdana;
font-size: 12px;
color: #ffffff;
text-shadow: 0 0 0.5em #000000, 0 0 0.5em #000000, 0 0 0.5em #000000;
height: 30px;
width: 30px;
margin: auto;
border-radius: 50%;
box-sizing: border-box;
box-shadow: 7px 7px 10px #000000, -7px -7px 10px #666666;
cursor: pointer;
transition: 0.5s;
position: absolute;
top: 15px;
right: 15px;
}
.plflag {
background: url("/img/pl_flag.png");
background-size: cover;
}
.ukflag {
background: url("/img/uk_flag.png");
background-size: cover;
}
</style>
</head>
<body>
<div class="container">
<button type="button" class="lang plflag" onClick="location.href='<?php echo "$full_url"; ?>';"></button>
<button type="button" class="home" onClick="location.href='https://twittodon.com';"></button>
<div class="inputs">
<form action="" method="POST" name="form">
<label><highlight_blue>Your Twitter account:</highlight_blue></label>
<?php
echo "<input type=\"text\" name=\"twitter\" placeholder=\"USERNAME without @ (e.g. theto3k)\" value=\"".addslashes($twitter)."\" size=\"20\" autocomplete=\"off\"><br>";
?>
<?php
echo $message1;
?>
<label>&bull;&bull;&bull;</label><br>
<label><highlight_purple>Your Mastodon account:</highlight_purple></label>
<?php
echo "<input type=\"text\" name=\"mastodon\" placeholder=\"USERNAME@INSTANCE (e.g. to3k@mstdn.social)\" value=\"".addslashes($mastodon)."\" size=\"20\" autocomplete=\"off\"><br>";
?>
<?php
echo $message2;
?>
<br>
</div>
<?php
echo "<button type=\"submit\" id=\"ButtonNext\" name=\"next\" onclick=\"PleaseWaitButton()\">Next step</button>";
?>
<br><br>
<label>
<center>
<table style="font-size: 12px;">
<tr>
<td style="text-align: center; padding-right: 15px; border-right: solid 1px white;">
<a href="https://tomaszdunia.pl" target="_blank"><img src="/img/author.gif" style="border-radius: 50%; height: 80px;" /></a><br>
Author:<br>
Tomasz Dunia<br>
<i>to3k</i>
</td>
<td style="vertical-align: top; padding-left: 15px; border-left: solid 1px white;">
<img src="/img/website_icon.png" height="10px" /> Website: <a href="https://tomaszdunia.pl" target="_blank">tomaszdunia.pl</a><br>
<img src="/img/twitter_icon.png" height="10px" /> Twitter: <a href="https://twitter.com/theto3k" target="_blank">@theto3k</a><br>
<img src="/img/mastodon_icon.png" height="10px" /> Mastodon: <a href="https://mstdn.social/@to3k" target="_blank">to3k@mstdn.social</a><br>
<img src="/img/email_icon.png" height="10px" /> Write to me using <a href="contact.php">contact form</a> (🇬🇧/🇵🇱).<br>
<img src="/img/no_icon.png" height="10px" /> <img src="/img/cookies_icon.png" height="10px" /> This site is not using cookies.<br>
<img src="/img/no_icon.png" height="10px" /> <img src="/img/eye_icon.png" height="10px" /> This site is free of any tracking scripts.<br>
This site is transparent so:<br>
<img src="/img/stats_icon.png" height="10px" /> <a href="stats.php">You have an access to it's statistics!</a><br>
</td>
</tr>
</table>
</center>
</label>
</form>
</div>
<script>
function PleaseWaitButton() {
// Alert the copied text
//alert("Copied!");
var btn = document.getElementById("ButtonNext");
btn.innerHTML = "Please wait...";
}
</script>
</body>
</html>

333
contact.php 100644
Wyświetl plik

@ -0,0 +1,333 @@
<?php
header('Content-Type: text/html; charset=utf-8');
require("/*mysql config file*/");
$mysqli = mysqli_connect($host, $user, $pass, $nazwa_bazy) or die('ERROR TD01');
mysqli_set_charset($mysqli, "utf8mb4");
session_start();
$alert = 0;
if(isset($_POST['submit'])) {
if(addslashes(strip_tags($_POST['form_address'])) != "" AND addslashes(strip_tags($_POST['form_name'])) != "" AND addslashes(strip_tags($_POST['form_message'])) != "")
{
$email = addslashes(strip_tags($_POST['form_address']));
$check = '/^[a-zA-Z0-9.\-_]+@[a-zA-Z0-9\-.]+\.[a-zA-Z]{2,4}$/';
if(preg_match($check, $email))
{
if($_SESSION['captcha'] != addslashes(strip_tags($_POST['user_code'])))
{
$alert = 1;
}
else
{
$message = "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\" lang=\"en\">
<head>
<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />
</head>
<body>
<b>Submitter's address:</b> ".addslashes(strip_tags($_POST['form_address']))."<br>
<b>Submitter's name:</b> ".addslashes(strip_tags($_POST['form_name']))."<br>
<b>IP:</b> ".addslashes(strip_tags($_POST['ip']))."<br>
<b>Message:</b><br>
".addslashes(strip_tags($_POST['form_message']))."
</body>
</html>";
$subject="Message from Twittodon.com ".date('d-m-Y H:i');
$header = "MIME-Version: 1.0r\n"."Content-type: text/html; charset=utf-8\n";
$header .= "From: ".addslashes(strip_tags($_POST['form_address']))."\n";
$address = "contact@twittodon.com";
mail($address, $subject, $message, $header);
$alert = 2;
}
}
else
{
$alert = 3;
}
}
else { $alert = 4; }
}
if($_SERVER['HTTP_CLIENT_IP'])
{
$ip = $_SERVER['HTTP_CLIENT_IP'];
}
elseif($_SERVER['HTTP_X_FORWARDED_FOR'])
{
$ip = $_SERVER['HTTP_X_FORWARDED_FOR'];
}
else
{
$ip = $_SERVER['REMOTE_ADDR'];
}
mysqli_close($mysqli);
//Change language
$full_url = "https://pl.twittodon.com".$_SERVER['REQUEST_URI'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="Author" content="Tomasz Dunia">
<meta name="Description" content="Twittodon.com - Connect your Twitter and Mastodon accounts and verify it to let you followers be sure that those are your official accounts!" />
<meta name="Keywords" content="twitter, mastodon, fediverse, connect, verify" />
<meta name="viewport" content="width=device-width, initial-scale=0.7">
<title>Contact form - Twittodon.com - Connect your Twitter and Mastodon accounts and verify it!</title>
<link rel="icon" href="favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
<style>
body {
font-family: Verdana;
font-size: 14px;
margin: 40px;
background: #333333;
display: flex;
align-items: center;
text-align: center;
justify-content: center;
place-items: center;
}
.container {
position: relative;
width: 750px;
border-radius: 20px;
padding: 40px;
box-sizing: border-box;
background: #333333;
box-shadow: 10px 10px 20px 10px #000000, -10px -10px 20px 10px #666666;
}
.home {
font-family: Verdana;
font-size: 12px;
color: #ffffff;
text-shadow: 0 0 0.5em #000000, 0 0 0.5em #000000, 0 0 0.5em #000000;
height: 100px;
width: 100px;
background: url("/img/twittodon_logo_800x800_white_transparent.png");
background-size: cover;
margin: auto;
border-radius: 50%;
box-sizing: border-box;
box-shadow: 7px 7px 10px #000000, -7px -7px 10px #666666;
cursor: pointer;
transition: 0.5s;
}
home:hover {
box-shadow: none;
}
.inputs {
text-align: center;
margin-top: 30px;
}
label, input, button, textarea {
display: block;
width: 100%;
padding: 0;
border: none;
outline: none;
box-sizing: border-box;
}
label {
margin-bottom: 10px;
text-align: center;
color: #ffffff;
}
label:nth-of-type(2) {
margin-top: 12px;
}
message-green {
margin-bottom: 4px;
color: green;
font-size:12px;
}
message-green:nth-of-type(2) {
margin-top: 12px;
}
message-red {
margin-bottom: 4px;
color: red;
font-size:12px;
}
message-red:nth-of-type(2) {
margin-top: 12px;
}
input::placeholder {
color: #ffffff;
opacity: 0.5;
}
input {
font-family: Verdana;
font-size: 12px;
background: #333333;
color: #ffffff;
padding: 10px;
padding-left: 20px;
height: 50px;
text-align: center;
border-radius: 25px;
box-shadow: inset 5px 5px 5px #000000, inset -5px -5px 5px #666666;
-webkit-appearance: none;
-webkit-text-fill-color: #ffffff;
opacity: 1;
}
textarea {
font-family: Verdana;
font-size: 12px;
background: #333333;
color: #ffffff;
padding: 10px;
padding-left: 20px;
text-align: center;
border-radius: 25px;
box-shadow: inset 5px 5px 5px #000000, inset -5px -5px 5px #666666;
-webkit-appearance: none;
opacity: 1;
resize: vertical;
}
button {
font-family: Verdana;
font-size: 14px;
color: #ffffff;
margin-top: 20px;
background: none;
height: 40px;
border-radius: 20px;
cursor: pointer;
font-weight: 900;
box-shadow: 5px 5px 5px #000000, -5px -5px 5px #666666;
transition: 0.5s;
}
button:hover {
box-shadow: none;
}
a, a:hover, a:active, a:visited { color: white; }
highlight_blue {
color: #1DA1F2;
font-weight: bold;
}
highlight_purple {
color: #6364ff;
font-weight: bold;
}
.lang {
font-family: Verdana;
font-size: 12px;
color: #ffffff;
text-shadow: 0 0 0.5em #000000, 0 0 0.5em #000000, 0 0 0.5em #000000;
height: 30px;
width: 30px;
margin: auto;
border-radius: 50%;
box-sizing: border-box;
box-shadow: 7px 7px 10px #000000, -7px -7px 10px #666666;
cursor: pointer;
transition: 0.5s;
position: absolute;
top: 15px;
right: 15px;
}
.plflag {
background: url("/img/pl_flag.png");
background-size: cover;
}
.ukflag {
background: url("/img/uk_flag.png");
background-size: cover;
}
</style>
</head>
<body>
<div class="container">
<button type="button" class="lang plflag" onClick="location.href='<?php echo "$full_url"; ?>';"></button>
<button type="button" class="home" onClick="location.href='https://twittodon.com';"></button>
<br>
<label><h2>Contact form</h2></label>
<label>&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;</label>
<?php
if($alert==1)
{
echo "<h3><font color=\"red\"><img src=\"/img/fail.png\" height=\"15px\" /> Message not sent. Invalid CAPTCHA.</font></h3>";
}
elseif($alert==2)
{
echo "<h3><font color=\"green\">Message sent.</font></h3></body></html>";
exit;
}
elseif($alert==3)
{
echo "<h3><font color=\"red\"><img src=\"/img/fail.png\" height=\"15px\" /> The message has not been sent. An invalid email address was provided.</font></h3>";
}
elseif($alert==4)
{
echo "<h3><font color=\"red\"><img src=\"/img/fail.png\" height=\"15px\" /> The message has not been sent. All fields must be filled.</font></h3>";
}
?>
<div class="inputs">
<form method="post" action="">
<?php
echo "<input type=\"hidden\" name=\"ip\" value=\"".$ip."\" />";
?>
<input type="text" name="form_address" placeholder="Enter your e-mail address, so I can write you back" <?php echo "value=\"".addslashes(strip_tags($_POST['form_address']))."\""; ?> size="30"><br>
<input type="text" name="form_name" placeholder="Enter your name, so I know how to call you" <?php echo "value=\"".addslashes(strip_tags($_POST['form_name']))."\""; ?> size="30"><br>
<textarea name="form_message" placeholder="Type your message here..." size="30" rows="15"><?php echo addslashes(strip_tags($_POST['form_message'])); ?></textarea><br>
<img src="captcha.php" alt="Captcha" /><br>
<input type="text" name="user_code" placeholder="Enter the code from the image"><br>
<button type="submit" name="submit">Send</button><br>
<br><br>
</form>
</div>
<label>
<center>
<table style="font-size: 12px;">
<tr>
<td style="text-align: center; padding-right: 15px; border-right: solid 1px white;">
<a href="https://tomaszdunia.pl" target="_blank"><img src="/img/author.gif" style="border-radius: 50%; height: 80px;" /></a><br>
Author:<br>
Tomasz Dunia<br>
<i>to3k</i>
</td>
<td style="vertical-align: top; padding-left: 15px; border-left: solid 1px white;">
<img src="/img/website_icon.png" height="10px" /> Website: <a href="https://tomaszdunia.pl" target="_blank">tomaszdunia.pl</a><br>
<img src="/img/twitter_icon.png" height="10px" /> Twitter: <a href="https://twitter.com/theto3k" target="_blank">@theto3k</a><br>
<img src="/img/mastodon_icon.png" height="10px" /> Mastodon: <a href="https://mstdn.social/@to3k" target="_blank">to3k@mstdn.social</a><br>
<img src="/img/email_icon.png" height="10px" /> Write to me using <a href="contact.php">contact form</a> (🇬🇧/🇵🇱).<br>
<img src="/img/no_icon.png" height="10px" /> <img src="/img/cookies_icon.png" height="10px" /> This site is not using cookies.<br>
<img src="/img/no_icon.png" height="10px" /> <img src="/img/eye_icon.png" height="10px" /> This site is free of any tracking scripts.<br>
This site is transparent so:<br>
<img src="/img/stats_icon.png" height="10px" /> <a href="stats.php">You have an access to it's statistics!</a><br>
</td>
</tr>
</table>
</center>
</label>
</div>
</body>
</html>

BIN
favicon.ico 100644

Plik binarny nie jest wyświetlany.

Po

Szerokość:  |  Wysokość:  |  Rozmiar: 149 KiB

196
index.php 100644
Wyświetl plik

@ -0,0 +1,196 @@
<?php
header('Content-Type: text/html; charset=utf-8');
//Change language
$full_url = "https://pl.twittodon.com".$_SERVER['REQUEST_URI'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="Author" content="Tomasz Dunia">
<meta name="Description" content="Twittodon.com - Connect your Twitter and Mastodon accounts and verify it to let you followers be sure that those are your official accounts!" />
<meta name="Keywords" content="twitter, mastodon, fediverse, connect, verify" />
<meta name="viewport" content="width=device-width, initial-scale=0.7">
<title>Twittodon.com - Connect your Twitter and Mastodon accounts and verify it!</title>
<link rel="icon" href="favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
<style type="text/css">
body {
font-family: Verdana;
font-size: 14px;
margin: 40px;
background: #333333;
display: flex;
align-items: center;
text-align: justify;
justify-content: center;
place-items: center;
}
.container {
position: relative;
width: 750px;
border-radius: 20px;
padding: 40px;
box-sizing: border-box;
background: #333333;
box-shadow: 10px 10px 20px 10px #000000, -10px -10px 20px 10px #666666;
}
label, button {
display: inline;
width: 100%;
padding: 0;
border: none;
outline: none;
box-sizing: border-box;
}
label {
margin-bottom: 10px;
text-align: center;
color: #ffffff;
}
label:nth-of-type(2) {
margin-top: 12px;
}
button {
font-family: Verdana;
color: #ffffff;
/*text-shadow: 0 0 0.5em #000000, 0 0 0.5em #000000, 0 0 0.5em #000000;*/
font-weight: bold;
font-size:22px;
margin: 20px 20px;
background: none;
width: 290px;
height: 200px;
border-radius: 20px;
cursor: pointer;
box-shadow: 5px 5px 5px #000000, -5px -5px 5px #666666;
transition: 0.5s;
}
button:hover {
box-shadow: none;
}
a, a:hover, a:active, a:visited { color: white; }
.disabled {
opacity: 0.6;
cursor: not-allowed;
}
.connect {
background: url("/img/twittodon_twitter-plus-mastodon_white_transparent.png");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}
.verified {
background: url("/img/twittodon_verified-badge.png");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}
highlight_blue {
color: #1DA1F2;
font-weight: bold;
}
highlight_purple {
color: #6364ff;
font-weight: bold;
}
.lang {
font-family: Verdana;
font-size: 12px;
color: #ffffff;
text-shadow: 0 0 0.5em #000000, 0 0 0.5em #000000, 0 0 0.5em #000000;
height: 30px;
width: 30px;
margin: auto;
border-radius: 50%;
box-sizing: border-box;
box-shadow: 7px 7px 10px #000000, -7px -7px 10px #666666;
cursor: pointer;
transition: 0.5s;
position: absolute;
top: 15px;
right: 15px;
}
.plflag {
background: url("/img/pl_flag.png");
background-size: cover;
}
.ukflag {
background: url("/img/uk_flag.png");
background-size: cover;
}
</style>
</head>
<body>
<div class="container">
<button type="button" class="lang plflag" onClick="location.href='<?php echo "$full_url"; ?>';"></button>
<center><a href="https://twittodon.com"><img src="/img/twittodon_logo-napis_white-blue-purple.png" alt="LOGO" width="80%" /></a></center>
<br>
<label>
<center><h2>What is <highlight_blue>Twitt</highlight_blue><highlight_purple>odon</highlight_purple>.com?</h2>
&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;<br><br>
<highlight_blue>Tool to verify connection between your Twitter and Mastodon accounts.<br>Let your followers find you.</highlight_blue><br>
&bull;&bull;&bull;<br>
<highlight_purple>Main goal is to create a great database of Twitter-Mastodon verified connections.<br>To find people you know from one platform and follow them on the other.</highlight_purple><br>
&bull;&bull;&bull;<br>
<highlight_blue>Helps you with recreating your network of contacts.</highlight_blue><br>
&bull;&bull;&bull;<br>
<highlight_purple>Counteracts the existence of fake accounts and impersonators.</highlight_purple><br>
&bull;&bull;&bull;<br>
<highlight_blue>Secure and transparent solution.<br>Unlike other solutions, similar to this, there is no need to provide credentials to your accounts or give access for third-party apps.</highlight_blue><br>
&bull;&bull;&bull;<br>
<highlight_purple>Database holds only the basic information necessary for this tool to function properly.</highlight_purple><br>
&bull;&bull;&bull;<br>
<highlight_blue>Completely free tool created to serve the society.</highlight_blue><br>
<br>
</center>
</label>
<center>
<button class="button connect" onclick="window.open(this.href='connect.php','_self')">CONNECT<br><br><br><br><br>ACCOUNTS</button>
<button class="button verified" onclick="window.open(this.href='verified.php','_self')">VERIFIED<br><br><br><br><br>DATABASE</button>
</center>
<br><br>
<label>
<center>
<table style="font-size: 12px;">
<tr>
<td style="text-align: center; padding-right: 15px; border-right: solid 1px white;">
<a href="https://tomaszdunia.pl" target="_blank"><img src="/img/author.gif" style="border-radius: 50%; height: 80px;" /></a><br>
Author:<br>
Tomasz Dunia<br>
<i>to3k</i>
</td>
<td style="vertical-align: top; padding-left: 15px; border-left: solid 1px white;">
<img src="/img/website_icon.png" height="10px" /> Website: <a href="https://tomaszdunia.pl" target="_blank">tomaszdunia.pl</a><br>
<img src="/img/twitter_icon.png" height="10px" /> Twitter: <a href="https://twitter.com/theto3k" target="_blank">@theto3k</a><br>
<img src="/img/mastodon_icon.png" height="10px" /> Mastodon: <a href="https://mstdn.social/@to3k" target="_blank">to3k@mstdn.social</a><br>
<img src="/img/email_icon.png" height="10px" /> Write to me using <a href="contact.php">contact form</a> (🇬🇧/🇵🇱).<br>
<img src="/img/no_icon.png" height="10px" /> <img src="/img/cookies_icon.png" height="10px" /> This site is not using cookies.<br>
<img src="/img/no_icon.png" height="10px" /> <img src="/img/eye_icon.png" height="10px" /> This site is free of any tracking scripts.<br>
This site is transparent so:<br>
<img src="/img/stats_icon.png" height="10px" /> <a href="stats.php">You have an access to it's statistics!</a><br>
</td>
</tr>
</table>
</center>
</label>
</div>
</body>
</html>

400
share.php 100644
Wyświetl plik

@ -0,0 +1,400 @@
<?php
header('Content-Type: text/html; charset=utf-8');
require("/*mysql config file*/");
$mysqli = mysqli_connect($host, $user, $pass, $nazwa_bazy) or die('ERROR TD01');
mysqli_set_charset($mysqli, "utf8mb4");
$twitter = addslashes(strip_tags($_GET['t']));
$mastodon = addslashes(strip_tags($_GET['m']));
if(empty($twitter) OR empty($mastodon))
{
header("Location: https://twittodon.com");
}
else
{
$query = "SELECT * FROM connections WHERE twitter_login='".$twitter."' AND mastodon_login='".$mastodon."' AND twitter_verified='1' AND mastodon_verified='1'";
$result = mysqli_query($mysqli, $query) or die('ERROR TD02');
$fromdb = mysqli_fetch_row($result);
//$fromdb[0] - id
//$fromdb[1] - twitter_login
//$fromdb[2] - twitter_verified
//$fromdb[3] - mastodon_login
//$fromdb[4] - mastodon_verified
//$fromdb[5] - twitter_name
//$fromdb[6] - twitter_img
//$fromdb[7] - mastodon_name
//$fromdb[8] - mastodon_img
//$fromdb[9] - date
if(!empty($fromdb))
{
$explode = explode("@", $fromdb[3]);
$mastodon_user = $explode[0];
$mastodon_server = $explode[1];
$mastodon_link = "https://".$explode[1]."/@".$explode[0];
}
else
{
header("Location: confirm.php");
}
}
mysqli_close($mysqli);
//Change language
$full_url = "https://pl.twittodon.com".$_SERVER['REQUEST_URI'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="Author" content="Tomasz Dunia">
<meta name="Description" content="Twittodon.com - Connect your Twitter and Mastodon accounts and verify it to let you followers be sure that those are your official accounts!" />
<meta name="Keywords" content="twitter, mastodon, fediverse, connect, verify" />
<meta name="viewport" content="width=device-width, initial-scale=0.7">
<title>Shared confirmation - Twittodon.com - Connect your Twitter and Mastodon accounts and verify it!</title>
<link rel="icon" href="favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
<style>
body {
font-family: Verdana;
font-size: 14px;
margin: 40px;
background: #333333;
display: flex;
align-items: center;
text-align: center;
justify-content: center;
place-items: center;
}
.container {
position: relative;
width: 750px;
border-radius: 20px;
padding: 40px;
box-sizing: border-box;
background: #333333;
box-shadow: 10px 10px 20px 10px #000000, -10px -10px 20px 10px #666666;
}
.home {
font-family: Verdana;
font-size: 12px;
color: #ffffff;
text-shadow: 0 0 0.5em #000000, 0 0 0.5em #000000, 0 0 0.5em #000000;
height: 100px;
width: 100px;
background: url("/img/twittodon_logo_800x800_white_transparent.png");
background-size: cover;
margin: auto;
border-radius: 50%;
box-sizing: border-box;
box-shadow: 7px 7px 10px #000000, -7px -7px 10px #666666;
cursor: pointer;
transition: 0.5s;
}
home:hover {
box-shadow: none;
}
.inputs {
text-align: center;
margin-top: 30px;
}
label, label_red, label_green, input, textarea, button {
display: block;
width: 100%;
padding: 0;
border: none;
outline: none;
box-sizing: border-box;
}
label {
margin-bottom: 10px;
text-align: center;
color: #ffffff;
}
label_red {
margin-bottom: 10px;
text-align: center;
color: #ff0000;
}
label_green {
margin-bottom: 10px;
text-align: center;
color: #00ff00;
}
header {
margin-bottom: 10px;
text-align: center;
color: #ffffff;
font-size: 20px;
font-weight: bold;
}
label:nth-of-type(2) {
margin-top: 12px;
}
label_red:nth-of-type(2) {
margin-top: 12px;
}
label_green:nth-of-type(2) {
margin-top: 12px;
}
message-green {
margin-bottom: 4px;
color: green;
font-size:12px;
}
message-green:nth-of-type(2) {
margin-top: 12px;
}
message-red {
margin-bottom: 4px;
color: red;
font-size:12px;
}
message-red:nth-of-type(2) {
margin-top: 12px;
}
input::placeholder {
color: #ffffff;
opacity: 0.5;
}
input {
font-family: Verdana;
font-size: 12px;
background: #333333;
color: #ffffff;
padding: 10px;
padding-left: 20px;
height: 50px;
text-align: center;
border-radius: 25px;
box-shadow: inset 5px 5px 5px #000000, inset -5px -5px 5px #666666;
-webkit-appearance: none;
-webkit-text-fill-color: #ffffff;
opacity: 1;
}
textarea {
font-family: Verdana;
font-size: 12px;
background: #333333;
color: #ffffff;
padding: 10px;
padding-left: 20px;
height: 50px;
text-align: center;
border-radius: 25px;
box-shadow: inset 5px 5px 5px #000000, inset -5px -5px 5px #666666;
-webkit-appearance: none;
-webkit-text-fill-color: #ffffff;
opacity: 1;
resize: none;
}
button {
font-family: Verdana;
color: #ffffff;
/*text-shadow: 0 0 0.5em #000000, 0 0 0.5em #000000, 0 0 0.5em #000000;*/
font-weight: bold;
font-size:25px;
margin: 20px 20px;
background: none;
width: 290px;
height: 200px;
border-radius: 20px;
cursor: pointer;
box-shadow: 5px 5px 5px #000000, -5px -5px 5px #666666;
transition: 0.5s;
}
button:hover {
box-shadow: none;
}
a, a:hover, a:active, a:visited { color: white; }
.verified {
background: url("/img/twittodon_verified-badge.png");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}
.lang {
font-family: Verdana;
font-size: 12px;
color: #ffffff;
text-shadow: 0 0 0.5em #000000, 0 0 0.5em #000000, 0 0 0.5em #000000;
height: 30px;
width: 30px;
margin: auto;
border-radius: 50%;
box-sizing: border-box;
box-shadow: 7px 7px 10px #000000, -7px -7px 10px #666666;
cursor: pointer;
transition: 0.5s;
position: absolute;
top: 15px;
right: 15px;
}
.plflag {
background: url("/img/pl_flag.png");
background-size: cover;
}
.ukflag {
background: url("/img/uk_flag.png");
background-size: cover;
}
</style>
</head>
<body>
<div class="container">
<button type="button" class="lang plflag" onClick="location.href='<?php echo "$full_url"; ?>';"></button>
<center><a href="https://twittodon.com"><img src="/img/twittodon_logo-napis_white-blue-purple.png" alt="LOGO" width="80%" /></a></center>
<br>
<div class="inputs">
<?php
if(!empty($fromdb))
{
echo "<header>HELLO!</header>";
echo "<label>&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;</label>";
echo "<label><h3>These accounts:</h3></label>";
echo "<label><a href=\"https://twitter.com/".$fromdb[1]."\"><img src=\"/img/twitter_logo-napis-badge_500x2600.png\" height=\"50px\" /><br>".$fromdb[5]." (@".$fromdb[1].")</a></label>";
echo "<label><font size=\"20px\">+</font></label>";
echo "<label><a rel=\"me\" href=\"".$mastodon_link."\"><img src=\"/img/mastodon_logo-napis-badge_500x2600.png\" height=\"50px\" /><br>".$fromdb[7]." (".$fromdb[3].")</a></label>";
echo "<label><h3>are officially verified and owned by the same person!</h3></label>";
echo "<label>&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;</label>";
echo "<label>Visit our database if you are looking for more verified connections like this!</label>";
echo "<center><button class=\"button verified\" onclick=\"window.open(this.href='verified.php','_self')\">VERIFIED<br><br><br><br><br>DATABASE</button></center>";
}
else
{
echo "<header>VERIFICATION PROCESS</header><br>";
echo "<label>Something went wrong!</label>";
echo "<label>There is no such connection in the database yet. You need to declare account credentials first.</label>";
echo "<label>Start verification process:</label>";
echo "<button type=\"button\" onClick=\"location.href='connect.php';\">Take me there</button>";
}
?>
<br><br>
<label>
<center>
<table style="font-size: 12px;">
<tr>
<td style="text-align: center; padding-right: 15px; border-right: solid 1px white;">
<a href="https://tomaszdunia.pl" target="_blank"><img src="/img/author.gif" style="border-radius: 50%; height: 80px;" /></a><br>
Author:<br>
Tomasz Dunia<br>
<i>to3k</i>
</td>
<td style="vertical-align: top; padding-left: 15px; border-left: solid 1px white;">
<img src="/img/website_icon.png" height="10px" /> Website: <a href="https://tomaszdunia.pl" target="_blank">tomaszdunia.pl</a><br>
<img src="/img/twitter_icon.png" height="10px" /> Twitter: <a href="https://twitter.com/theto3k" target="_blank">@theto3k</a><br>
<img src="/img/mastodon_icon.png" height="10px" /> Mastodon: <a href="https://mstdn.social/@to3k" target="_blank">to3k@mstdn.social</a><br>
<img src="/img/email_icon.png" height="10px" /> Write to me using <a href="contact.php">contact form</a> (🇬🇧/🇵🇱).<br>
<img src="/img/no_icon.png" height="10px" /> <img src="/img/cookies_icon.png" height="10px" /> This site is not using cookies.<br>
<img src="/img/no_icon.png" height="10px" /> <img src="/img/eye_icon.png" height="10px" /> This site is free of any tracking scripts.<br>
This site is transparent so:<br>
<img src="/img/stats_icon.png" height="10px" /> <a href="stats.php">You have an access to it's statistics!</a><br>
</td>
</tr>
</table>
</center>
</label>
</div>
<script>
function CopyFunction0() {
// Get the text field
var copyText = document.getElementById("CopyInput0");
// Select the text field
copyText.select();
copyText.setSelectionRange(0, 99999); // For mobile devices
// Copy the text inside the text field
navigator.clipboard.writeText(copyText.value);
// Alert the copied text
//alert("Copied!");
var btn = document.getElementById("CopyButton0");
btn.innerHTML = "Copied!";
}
</script>
<script>
function CopyFunction1() {
// Get the text field
var copyText = document.getElementById("CopyInput1");
// Select the text field
copyText.select();
copyText.setSelectionRange(0, 99999); // For mobile devices
// Copy the text inside the text field
navigator.clipboard.writeText(copyText.value);
// Alert the copied text
//alert("Copied!");
var btn = document.getElementById("CopyButton1");
btn.innerHTML = "Copied!";
}
</script>
<script>
function CopyFunction2() {
// Get the text field
var copyText = document.getElementById("CopyInput2");
// Select the text field
copyText.select();
copyText.setSelectionRange(0, 99999); // For mobile devices
// Copy the text inside the text field
navigator.clipboard.writeText(copyText.value);
// Alert the copied text
//alert("Copied!");
var btn = document.getElementById("CopyButton2");
btn.innerHTML = "Copied!";
}
</script>
<script>
function CopyFunction3() {
// Get the text field
var copyText = document.getElementById("CopyInput3");
// Select the text field
copyText.select();
copyText.setSelectionRange(0, 99999); // For mobile devices
// Copy the text inside the text field
navigator.clipboard.writeText(copyText.value);
// Alert the copied text
//alert("Copied!");
var btn = document.getElementById("CopyButton3");
btn.innerHTML = "Copied!";
}
</script>
</body>
</html>

263
stats.php 100644
Wyświetl plik

@ -0,0 +1,263 @@
<?php
include '/*stats cron file*/';
header('Content-Type: text/html; charset=utf-8');
require("/*mysql config file*/");
$mysqli = mysqli_connect($host, $user, $pass, $nazwa_bazy) or die('ERROR TD01');
mysqli_set_charset($mysqli, "utf8mb4");
$chart_users_data = '';
$query = "SELECT * FROM stats_users ORDER BY date ASC";
$result = mysqli_query($mysqli, $query) or die('ERROR TD02');
while($row = mysqli_fetch_array($result))
{
// $row[0] - id
// $row[1] - date
// $row[2] - all_users
// $row[3] - verified_users
$not_verified = $row[2]-$row[3];
$chart_users_data .= "{ date:'".$row[1]."', verified:".$row[3].", notverified:".$not_verified."}, ";
}
$chart_users_data = substr($chart_users_data, 0, -2);
$chart_views_data = '';
$query = "SELECT * FROM stats_views ORDER BY date ASC";
$result = mysqli_query($mysqli, $query) or die('ERROR TD03');
while($row = mysqli_fetch_array($result))
{
// $row[0] - id
// $row[1] - date
// $row[2] - views
$chart_views_data .= "{ date:'".$row[1]."', views:".$row[2]."}, ";
}
$chart_views_data = substr($chart_views_data, 0, -2);
mysqli_close($mysqli);
//Change language
$full_url = "https://pl.twittodon.com".$_SERVER['REQUEST_URI'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="Author" content="Tomasz Dunia">
<meta name="Description" content="Twittodon.com - Connect your Twitter and Mastodon accounts and verify it to let you followers be sure that those are your official accounts!" />
<meta name="Keywords" content="twitter, mastodon, fediverse, connect, verify" />
<meta name="viewport" content="width=device-width, initial-scale=0.7">
<title>Stats - Twittodon.com - Connect your Twitter and Mastodon accounts and verify it!</title>
<link rel="icon" href="favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" href="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.css">
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.0/jquery.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.0/raphael-min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/morris.js/0.5.1/morris.min.js"></script>
<style type="text/css">
body {
font-family: Verdana;
font-size: 14px;
margin: 40px;
background: #333333;
display: flex;
align-items: center;
text-align: justify;
justify-content: center;
place-items: center;
}
.container {
position: relative;
width: 750px;
border-radius: 20px;
padding: 40px;
box-sizing: border-box;
background: #333333;
box-shadow: 10px 10px 20px 10px #000000, -10px -10px 20px 10px #666666;
}
label, button {
display: inline;
width: 100%;
padding: 0;
border: none;
outline: none;
box-sizing: border-box;
}
label {
margin-bottom: 10px;
text-align: center;
color: #ffffff;
}
label:nth-of-type(2) {
margin-top: 12px;
}
header {
margin-bottom: 10px;
text-align: center;
color: #ffffff;
font-size: 20px;
font-weight: bold;
}
button {
font-family: Verdana;
color: #ffffff;
/*text-shadow: 0 0 0.5em #000000, 0 0 0.5em #000000, 0 0 0.5em #000000;*/
font-weight: bold;
font-size:25px;
margin: 20px 20px;
background: none;
width: 290px;
height: 200px;
border-radius: 20px;
cursor: pointer;
box-shadow: 5px 5px 5px #000000, -5px -5px 5px #666666;
transition: 0.5s;
}
button:hover {
box-shadow: none;
}
a, a:hover, a:active, a:visited { color: white; }
.disabled {
opacity: 0.6;
cursor: not-allowed;
}
.connect {
background: url("/img/twittodon_twitter-plus-mastodon_white_transparent.png");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}
.verified {
background: url("/img/twittodon_verified-badge.png");
background-size: contain;
background-repeat: no-repeat;
background-position: center;
}
highlight_blue {
color: #1DA1F2;
font-weight: bold;
}
highlight_purple {
color: #6364ff;
font-weight: bold;
}
.lang {
font-family: Verdana;
font-size: 12px;
color: #ffffff;
text-shadow: 0 0 0.5em #000000, 0 0 0.5em #000000, 0 0 0.5em #000000;
height: 30px;
width: 30px;
margin: auto;
border-radius: 50%;
box-sizing: border-box;
box-shadow: 7px 7px 10px #000000, -7px -7px 10px #666666;
cursor: pointer;
transition: 0.5s;
position: absolute;
top: 15px;
right: 15px;
}
.plflag {
background: url("/img/pl_flag.png");
background-size: cover;
}
.ukflag {
background: url("/img/uk_flag.png");
background-size: cover;
}
</style>
</head>
<body>
<br /><br />
<div class="container">
<button type="button" class="lang plflag" onClick="location.href='<?php echo "$full_url"; ?>';"></button>
<center><a href="https://twittodon.com"><img src="/img/twittodon_logo-napis_white-blue-purple.png" alt="LOGO" width="80%" /></a>
<br><br><br>
<header>STATISTICS</header>
<label>&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;</label>
<br><br>
<highlight_blue>USERS</highlight_blue>
<div id="chart_users"></div>
<br><br>
<label>&bull;&bull;&bull;</label>
<br><br>
<highlight_purple>PAGE VIEWS</highlight_purple>
<div id="chart_views"></div>
<br><br>
<label>
<center>
<table style="font-size: 12px;">
<tr>
<td style="text-align: center; padding-right: 15px; border-right: solid 1px white;">
<a href="https://tomaszdunia.pl" target="_blank"><img src="/img/author.gif" style="border-radius: 50%; height: 80px;" /></a><br>
Author:<br>
Tomasz Dunia<br>
<i>to3k</i>
</td>
<td style="vertical-align: top; padding-left: 15px; border-left: solid 1px white;">
<img src="/img/website_icon.png" height="10px" /> Website: <a href="https://tomaszdunia.pl" target="_blank">tomaszdunia.pl</a><br>
<img src="/img/twitter_icon.png" height="10px" /> Twitter: <a href="https://twitter.com/theto3k" target="_blank">@theto3k</a><br>
<img src="/img/mastodon_icon.png" height="10px" /> Mastodon: <a href="https://mstdn.social/@to3k" target="_blank">to3k@mstdn.social</a><br>
<img src="/img/email_icon.png" height="10px" /> Write to me using <a href="contact.php">contact form</a> (🇬🇧/🇵🇱).<br>
<img src="/img/no_icon.png" height="10px" /> <img src="/img/cookies_icon.png" height="10px" /> This site is not using cookies.<br>
<img src="/img/no_icon.png" height="10px" /> <img src="/img/eye_icon.png" height="10px" /> This site is free of any tracking scripts.<br>
This site is transparent so:<br>
<img src="/img/stats_icon.png" height="10px" /> <a href="stats.php">You have an access to it's statistics!</a><br>
</td>
</tr>
</table>
</center>
</label>
</center>
</div>
</body>
</html>
<script>
Morris.Area({
element : 'chart_users',
data:[<?php echo $chart_users_data; ?>],
xkey:'date',
ykeys:['verified', 'notverified'],
labels:['Verified', 'In progress'],
hideHover:'auto',
stacked:true,
behaveLikeLine:false,
resize:true,
xLabelAngle:45
});
</script>
<script>
Morris.Line({
element : 'chart_views',
data:[<?php echo $chart_views_data; ?>],
xkey:'date',
ykeys:['views'],
labels:['Views'],
hideHover:'auto',
stacked:true,
behaveLikeLine:false,
resize:true,
xLabelAngle:45
});
</script>

340
verified.php 100644
Wyświetl plik

@ -0,0 +1,340 @@
<?php
header('Content-Type: text/html; charset=utf-8');
require("/*mysql config file*/");
$mysqli = mysqli_connect($host, $user, $pass, $nazwa_bazy) or die('ERROR TD01');
mysqli_set_charset($mysqli, "utf8mb4");
$query = "SELECT * FROM connections WHERE twitter_verified='1' AND mastodon_verified='1'";
$result = mysqli_query($mysqli, $query) or die('ERROR TD02');
mysqli_close($mysqli);
//Change language
$full_url = "https://pl.twittodon.com".$_SERVER['REQUEST_URI'];
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<meta name="Author" content="Tomasz Dunia">
<meta name="Description" content="Twittodon.com - Connect your Twitter and Mastodon accounts and verify it to let you followers be sure that those are your official accounts!" />
<meta name="Keywords" content="twitter, mastodon, fediverse, connect, verify" />
<meta name="viewport" content="width=device-width, initial-scale=0.5">
<title>Verified - Twittodon.com - Connect your Twitter and Mastodon accounts and verify it!</title>
<link rel="icon" href="favicon.ico" type="image/x-icon"/>
<link rel="shortcut icon" href="favicon.ico" type="image/x-icon"/>
<link rel="stylesheet" type="text/css" href="/dist/jstable.css">
<script type="text/javascript" src="/dist/jstable.min.js"></script>
<script type="text/javascript" src="/dist/jstable.es5.min.js"></script>
<script type="text/javascript" src="/dist/polyfill-fetch.min.js"></script>
<style>
body {
font-family: Verdana;
font-size: 14px;
margin: 40px;
background: #333333;
display: flex;
align-items: center;
text-align: center;
justify-content: center;
place-items: center;
}
.container {
position: relative;
width: 900px;
border-radius: 20px;
padding: 40px;
box-sizing: border-box;
background: #333333;
box-shadow: 10px 10px 20px 10px #000000, -10px -10px 20px 10px #666666;
}
.home {
font-family: Verdana;
font-size: 12px;
color: #ffffff;
text-shadow: 0 0 0.5em #000000, 0 0 0.5em #000000, 0 0 0.5em #000000;
height: 100px;
width: 100px;
background: url("/img/twittodon_logo_800x800_white_transparent.png");
background-size: cover;
margin: auto;
border-radius: 50%;
box-sizing: border-box;
box-shadow: 7px 7px 10px #000000, -7px -7px 10px #666666;
cursor: pointer;
transition: 0.5s;
}
home:hover {
box-shadow: none;
}
.inputs {
text-align: center;
margin-top: 30px;
}
label, label_red, label_green, input, textarea, button {
display: block;
width: 100%;
padding: 0;
border: none;
outline: none;
box-sizing: border-box;
}
label {
margin-bottom: 10px;
text-align: center;
color: #ffffff;
}
label_red {
margin-bottom: 10px;
text-align: center;
color: #ff0000;
}
label_green {
margin-bottom: 10px;
text-align: center;
color: #0ffff0;
}
header {
margin-bottom: 10px;
text-align: center;
color: #ffffff;
font-size: 20px;
font-weight: bold;
}
label:nth-of-type(2) {
margin-top: 12px;
}
label_red:nth-of-type(2) {
margin-top: 12px;
}
label_green:nth-of-type(2) {
margin-top: 12px;
}
message-green {
margin-bottom: 4px;
color: green;
font-size:12px;
}
message-green:nth-of-type(2) {
margin-top: 12px;
}
message-red {
margin-bottom: 4px;
color: red;
font-size:12px;
}
message-red:nth-of-type(2) {
margin-top: 12px;
}
input::placeholder {
color: #ffffff;
opacity: 0.5;
}
input {
font-family: Verdana;
font-size: 12px;
background: #333333;
color: #ffffff;
padding: 10px;
padding-left: 20px;
height: 50px;
text-align: center;
border-radius: 25px;
box-shadow: inset 5px 5px 5px #000000, inset -5px -5px 5px #666666;
-webkit-appearance: none;
-webkit-text-fill-color: #ffffff;
opacity: 1;
}
textarea {
font-family: Verdana;
font-size: 12px;
background: #333333;
color: #ffffff;
padding: 10px;
padding-left: 20px;
height: 25px;
text-align: center;
border-radius: 25px;
box-shadow: inset 5px 5px 5px #000000, inset -5px -5px 5px #666666;
-webkit-appearance: none;
-webkit-text-fill-color: #ffffff;
opacity: 1;
resize: none;
}
button {
font-family: Verdana;
font-size: 14px;
color: #ffffff;
margin-top: 20px;
background: none;
height: 40px;
border-radius: 20px;
cursor: pointer;
font-weight: 900;
box-shadow: 5px 5px 5px #000000, -5px -5px 5px #666666;
transition: 0.5s;
}
button:hover {
box-shadow: none;
}
a, a:hover, a:active, a:visited { color: white; }
highlight_blue {
color: #1DA1F2;
}
highlight_purple {
color: #6364ff;
}
.lang {
font-family: Verdana;
font-size: 12px;
color: #ffffff;
text-shadow: 0 0 0.5em #000000, 0 0 0.5em #000000, 0 0 0.5em #000000;
height: 30px;
width: 30px;
margin: auto;
border-radius: 50%;
box-sizing: border-box;
box-shadow: 7px 7px 10px #000000, -7px -7px 10px #666666;
cursor: pointer;
transition: 0.5s;
position: absolute;
top: 15px;
right: 15px;
}
.plflag {
background: url("/img/pl_flag.png");
background-size: cover;
}
.ukflag {
background: url("/img/uk_flag.png");
background-size: cover;
}
</style>
</head>
<body>
<div class="container">
<button type="button" class="lang plflag" onClick="location.href='<?php echo "$full_url"; ?>';"></button>
<button type="button" class="home" onClick="location.href='https://twittodon.com';"></button>
<div class="inputs">
<header>VERIFIED LIST</header>
<label>&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;&bull;</label>
<br>
<table id="verified_table">
<thead>
<tr>
<th width="40%"><highlight_blue>Twitter</highlight_blue></th>
<th width="40%"><highlight_purple>Mastodon</highlight_purple></th>
<th width="20%" data-sort="desc">Added</th>
</tr>
</thead>
<tbody>
<?php
while($fromdb = mysqli_fetch_row($result))
{
//$fromdb[0] - id
//$fromdb[1] - twitter_login
//$fromdb[2] - twitter_verified
//$fromdb[3] - mastodon_login
//$fromdb[4] - mastodon_verified
//$fromdb[5] - twitter_name
//$fromdb[6] - twitter_img
//$fromdb[7] - mastodon_name
//$fromdb[8] - mastodon_img
//$fromdb[9] - date
echo "<tr>";
echo "<td style=\"white-space: normal\"><a href=\"https://twitter.com/".$fromdb[1]."\" target=\"_blank\">@".$fromdb[1]."</a><br>".$fromdb[5]."</td>";
$explode = explode("@", $fromdb[3]);
$mastodon_user = $explode[0];
$mastodon_server = $explode[1];
$mastodon_link = "https://".$explode[1]."/@".$explode[0];
echo "<td style=\"white-space: normal\"><a href=\"".$mastodon_link."\" target=\"_blank\">".$fromdb[3]."</a><br>".$fromdb[7]."</highlight_purple></td>";
echo "<td style=\"white-space: nowrap\">".$fromdb[9]."</td>";
echo "</tr>";
}
?>
</tbody>
</table>
<br><br>
<label>
<center>
<table style="font-size: 12px;">
<tr>
<td style="text-align: center; padding-right: 15px; border-right: solid 1px white;">
<a href="https://tomaszdunia.pl" target="_blank"><img src="/img/author.gif" style="border-radius: 50%; height: 80px;" /></a><br>
Author:<br>
Tomasz Dunia<br>
<i>to3k</i>
</td>
<td style="vertical-align: top; padding-left: 15px; border-left: solid 1px white;">
<img src="/img/website_icon.png" height="10px" /> Website: <a href="https://tomaszdunia.pl" target="_blank">tomaszdunia.pl</a><br>
<img src="/img/twitter_icon.png" height="10px" /> Twitter: <a href="https://twitter.com/theto3k" target="_blank">@theto3k</a><br>
<img src="/img/mastodon_icon.png" height="10px" /> Mastodon: <a href="https://mstdn.social/@to3k" target="_blank">to3k@mstdn.social</a><br>
<img src="/img/email_icon.png" height="10px" /> Write to me using <a href="contact.php">contact form</a> (🇬🇧/🇵🇱).<br>
<img src="/img/no_icon.png" height="10px" /> <img src="/img/cookies_icon.png" height="10px" /> This site is not using cookies.<br>
<img src="/img/no_icon.png" height="10px" /> <img src="/img/eye_icon.png" height="10px" /> This site is free of any tracking scripts.<br>
This site is transparent so:<br>
<img src="/img/stats_icon.png" height="10px" /> <a href="stats.php">You have an access to it's statistics!</a><br>
</td>
</tr>
</table>
</center>
</label>
</div>
<script>
new JSTable("#verified_table", {
perPage: 10,
perPageSelect: [10, 50, 100, 500, 1000, 5000, 10000],
nextPrev: true,
firstLast: false,
prevText: "&lsaquo;",
nextText: "&rsaquo;",
firstText: "&laquo;",
lastText: "&raquo;",
ellipsisText: "&hellip;",
truncatePager: true,
pagerDelta: 2,
searchable: true,
sortable: true,
labels:
{
placeholder: "Search...",
perPage: "{select} entries per page",
noRows: "No entries found",
info: "From {start} to {end} of {rows} entries",
loading: "Loading...",
infoFiltered: "From {start} to {end} of {rows} entries<br>(filtered from {rowsTotal} entries)"
},
layout:
{
top: "{select}{search}",
bottom: "{info}{pager}"
}
});
</script>
</body>
</html>