Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is it possible to send Twitter auto-reply without GPS tracking?

I want to send an auto reply to the user's tweets from his iOS application, I am able to do that if the user has allowed the iOS application to access his location, but when the access to location is denied by the user, tweeter is not allowing sending the auto reply to tweets.

I'm wondering whether it is mandatory to have access to the user's location to send an auto reply to his tweets. Or, do we have some reliable way to accomplish the specified functionality without accessing user's location?

like image 570
iShwar Avatar asked Aug 20 '15 11:08

iShwar


2 Answers

OP, from what I understood, you want to find out a given user's location without consented access to the user's phone's location services.

A way to do this, not super reliable I'd add, is to reverse geolocate their IP Address using a server side geocode API.

Mind you, it is not super reliable but might do the trick. You might encounter problems on mobiles, especially due to the erratic nature of their IP Addresses.

Twitter themselves have an API to help on that. For example you could use GET geo/search to find out a place ID closest to a given IP Address using this:

https://dev.twitter.com/rest/reference/get/geo/search

and then you could use that place ID to find out the approximate Lat / Long of the user, using GET geo/id/:place_id:

https://dev.twitter.com/rest/reference/get/geo/id/%3Aplace_id

(there are probably straighter ways of doing this in other APIs aswell but I'm assuming you are already authenticated on twitter's API so I'm trying to give you something easier to integrate into your code)

Let me know if that helps.

like image 92
Usernumbernine Avatar answered Nov 20 '22 09:11

Usernumbernine


I haven't implemented it yet but can guess that Twitter does so to avoid the spam or robotics tweets. So if Twitter gets multiple auto Tweets from same place so he would consider them as spam.

What you can do is after every 8-10 Tweets make new latitude longitude and send this location to Twitter while using auto tweeting.

How ?

Take a default location (lat, long) and you can find add 500m-1km in that location every 8-10 Tweets and use this new location for next time. This method is not reliable but can work in your case.

Note: Use this way only in case when you're not able to get device location.

like image 21
TheTiger Avatar answered Nov 20 '22 09:11

TheTiger