Chack number from contacts is mobile or fixed line(landline) number - ios

I wanted to have a check whether the phone number getting from the contacts is a Mobile number or a fixed line(landline) number. I have tried using the regrex but all is in vain..any help will be highly appreciable

For filtering contact by mobile number and landline you need have list of std code in database and then you can check if immediate digits after country code match std code then it's landline. You can search for such api as well.
Try : http://www.searchbug.com/api/

Related

Tweepy: Find all tweets in a specific language

I'd like to extract all tweets in the Arabic language in all countries.
I modified the code in this tutorial.
This is my search query.
api.search(q="*", count=tweetsPerQry, lang ['ar'],tweet_mode='extended'). I expect to find a very large number of tweets, but I only collected about 7000 tweets.
I checked the content of some of them and I noticed that they are posted in my country even I did not specify the location/Country (Can anyone explain why this happen??).
I tried to know the reason for finding a limited number of tweets, so I modified the query by replacing the lang parameter by geocode to find tweets in a city. I fetched more than 65,000 Arabic tweets. After that, I used the lang parameter with the geocode and I found a very limited number of tweets.
Can anyone help me to know why I'm not able to get a large number of tweets when I used lang parameter?
The free twitter API's are good for small projects, but keep in mind that they don't display all of the tweets. Twitter has paid API's that are much more powerful, though what you are trying to achieve should be possible. I ran the query attached bellow, it seemed to work I was able to find a considerable amount of tweets. This method also seemed to work for #ebt_dev too I think it was just the structure of your request was set out like the stream listener version not the cursor search.
# Search Query change the X of .items(X) to the amount of tweets you are looking for
for tweet in tweepy.Cursor(api.search, q='*',tweet_mode='extended', lang='de').items(9999999):
# Defining Tweets Creators Name
tweettext = str( tweet.full_text.lower().encode('ascii',errors='ignore')) #encoding to get rid of characters that may not be able to be displayed
# Defining Tweets Id
tweetid = tweet.id
# printing the text of the tweet
print('\ntweet text: '+str(tweettext))
# printing the id of the tweet
print('tweet id: '+str(tweetid))

Find Country Code from Phone Number

In my app , I am using phone numbers like +17896786788,+322657579849.
I would like to retrieve only the country code i.e, +1 or +322 by passing any phone number, that is I will send phone number and it will return the country code of that number.
Is there any API or anything available to get the country code from the phone number?
How can I find that?
I dont know about an API for splitting country code from a phone number,
But you can use this link to get all countries and their corresponding codes. Its a json file. You first parse all codes to an array from this json and then compare each element wth your phone number by using "range" funtion along with + symbol
Try it. U will get it.

How to only get places having phone numbers via Foursquare api?

i am trying to implement forsquare api in my project to get nearby places, but i want the places with phone numbers only.
The following url is created when searching for some places:
https://api.foursquare.com/v2/venues/search?client_id=NUAAA4QFSP...MEW5QYULV&client_secret=FIGD...X0LQBAB&v=20131109&locale=en&categoryId=4d4b7105d754a06374d81259,4d4b7105d754a06376d81259&ll=33.85982057734948,35.55264679015678&radius=2000
The problem is the result will contains all the places corresponding to the categories I checked and within the radius 2000.
I tried to add "query", but this will only search in the result name
So how to get only the places with phone numbers?
Thank you

GET request in Rails with big count of params

I want to make some Rails API for a mobile app, and there is the following situation: my app will authorize using a phone number (like Viber / WhatsApp); also it can automatically detect which contacts from a phone book also have my app installed. If I understand right I should create some GET method to take array of numbers and return numbers of users which have been in my system already. There are no problem with GET method for me and arrays in GET params, but phone book of users can be very big, and sending all numbers in GET params is not good solution. How can I do it right? Should I divide numbers in parts and send first 10 numbers, then next 10 numbers etc? Thanks in advance.
Just use a POST request instead. You don't have to always use GET when you're searching for stuff.
You could also optimize your query string:
?ph=5551112222,5552223333...
This at least minimizes the request size. I think Rails should give you params[:ph] as an array. If not then splitting the string on a comma is just one extra line of code.

iOS formatting phone numbers from address book

My app uses the user's phone number as unique username, and it also sync all of his contacts so he can send them messages.
So, I need a way to format all the phone numbers I'm getting from the phone's address book.
I need to know for a given number:
Country code (if exists).
The number itself.
And if the number includes some international call prefix, it should be remove from the number.
So for example if I have a contact with the number
014 1 3728834122
The format should tell me that the country code is 1 and that the number is 3728834122 (I don't care about the 014 prefix)
What interesting is that the native phone address book seems to know how to format the number, I can see it while typing a new number, it added () or spaces when needed.
So my question is:
Can I query the native address book for a given number, what's his country code & number?
Does anyone knows a good library that do this kind of formatting?

Resources