Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <html>
- <head>
- <title> Uploader Jodel </title>
- <style>
- input[type=text] {
- padding:5px;
- border:2px solid #ccc;
- -webkit-border-radius: 5px;
- border-radius: 5px;
- }
- input[type=text]:focus {
- border-color:#333;
- }
- input[type=submit] {
- padding:5px 15px;
- background:#ccc;
- border:0 none;
- cursor:pointer;
- -webkit-border-radius: 5px;
- border-radius: 5px;
- }
- </style>
- </head>
- <body>
- <center>
- <form method="POST" action="">
- <font color="blue">City : </font><input name="city" type="text"><br>
- <br><br>
- <input type="submit" name="upload" value="Upload">
- </form>
- <?
- if($_POST['upload']){
- ///////////////////////////////////////////////////////////////////////////////////////////
- $uuid = "21321786-db46d573-9cf39077-d4e5-4987-b475-bd62a47258d3"; # Your UUID
- ///////////////////////////////////////////////////////////////////////////////////////////
- # Setup
- $city = $_POST['city'];=
- $encoded_data = base64_encode(file_get_contents('zzzz.jpg'));
- echo $encoded_data ;
- $co = file_get_contents("http://maps.google.com/maps/api/geocode/json?sensor=false&address=$city");
- $startlat = explode('"lat" : ' , $co );
- $endlat = explode(',' , $startlat[1] );
- $lat = $endlat[0];
- $startlng = explode('"lng" : ' , $co );
- $endlng = explode(' }' , $startlng[1] );
- $lng = $endlng[0];
- echo "LAT: $lat<br><br>LNG: $lng";
- $postdata ='{"color":"9EC41C","image":"'.$encoded_data.'","location":{"city":"'.$city.'","loc_coordinates":{"lat":'.$lat.',"lng":'.$lng.'},"country":"SA","name":"'.$city.'","loc_accuracy":0.0},"message":"","has_drawing":false,"has_hashtag":false,"mention":false,"to_home":false}';
- ///////////////////////////////////////////////////////////////////////////////////////////////
- $request = curl_init();
- curl_setopt($request, CURLOPT_URL, "https://api.go-tellm.com/api/v3/posts/");
- curl_setopt($request, CURLOPT_RETURNTRANSFER, 1);
- curl_setopt($request, CURLOPT_FOLLOWLOCATION, 1);
- curl_setopt($request, CURLOPT_HTTPHEADER, array(
- "Authorization: Bearer $uuid",
- 'X-Client-Type: android_4.53.1',
- 'X-Api-Version: 0.2',
- 'Content-Type: application/json; charset=UTF-8',
- 'Connection: Keep-Alive'
- ));
- curl_setopt($request, CURLOPT_POSTFIELDS, $postdata);
- echo $response = curl_exec($request);
- }
- else
- {
- echo "<font color='green'>Welcome :)</font>";
- }
- ?>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement