Well it took me a bit to find out how to do that but here it is:
I am doing a all check-in client for Foursquare and Gowalla and this is problematic:
first get all venues from Foursquare (obviously more populated than Gowalla) and list them, then get the name from the selected one and compare it with the Gowalla names in the array.
And the rest is history.
The hard part is comparing 2 strings but i found a function that can do that, well found 2:
similar_text("This is a text", "A text this is", $percent); // yoda stile :')
echo $percent; // 42.8571428571
This is quite good because it results are ok for 2-3 word names comparison.
Else there is the Levenshein argorithm
$lev = levenshtein("This is a text", "A text this is");
echo $lev; // 14
The result is quite disappointing for me but maybe someone else needs it.
PS: This class may be useful some day or for some one.
And yes, i am remaking the Foursquare Mobile Client aka 4sqr
By the way, anyone got a better idea for comparing 2 strings?
Back to coding now.
If this has been useful you should give me a beer


2 responses
Do you want to comment?
Comments RSS and TrackBack Identifier URI ?
Trackbacks