City proximity search drupal - search

I need to implement a proximity search in Romania for articles based on the city name that has been inserted in a form field in a Drupal project. After browsing a lot of articles I see there are a lot of suggestions and solutions for zip codes and streets , but I only need the city geocodes ( lets say the center of that city ).
Where can I find such a database to insert into my project? Or is there another solution for this problem?

I would use the Geofield module to store the coordinates and then the Geocoder module to populate the geofield from the city field that you already have.
With Geocoder you can choose which service you want to use Google Geocoder, Yahoo, Bing etc
You can the use Gmap module or Open layers and Views to display your results.

Related

Tweepy-Twitter Python : Get trends where no WOEID available

I've reading docs about twitter api's and I know how to get the trends for available countrys with Woeid (where on the world id).
Twitter has a list of countrys for which they can show the trends. When you list the availables places for trends you may notice that not all cities are supported.
My problem is that I need the trends for a country that has not support for its API. The country I need is El Salvador. This country has no support on the API, neither Woeid. But you can go to homepage and you will see the local trends to the right of window.
There is an option: get the latitude, longitude of El salvador and search trough twitter geo API for trends, but it will return you the trends for other country (Guatemala).
So, as far as I searched, using the api is not an option. Is there another way to get the twitter trends from El Salvador?
Ok, I’ve been doing what you need today.
Without being able to do an api call, which yahoo don’t support, go here;
https://www.yahoo.com/news/weather/el-salvador/apopa/apopa-76867
When you search a city, the woeid is added to the address bar.
Eg Apopa, El Salvador is 76867
Type in city names in yahoo weather and get the ones you need.
Not the best solution but should work for what you need.

Sphinx "reverse" search

We have a website where users put up ads for stuff they want to sell, with parameters such as price, location, title and description. These can then be searched for using sphinx and allowing users to specify min- and maxprice, a location with a searchradius (using google maps) etc. Users can choose to save these searches and get emails when new ads appear that fit their search. Herein lies the problem: We want to perform a reverse search every time an ad is posted. With the price, location, title and description as parameters we want to search through all the saved "searches" and get the ones that would have found the ad. The min- and maxprice should just be performed in a query i suppose, and some Quorom syntax to get all ads with at least 2 or mby just 1 occurance in the title/description. Our problem lies mostly in the geo-search. How do we find all searches where the "search-circles" would include our newly posted location without performing a search for every saved search?
That is the main-question, any comment on our suggested solution to the other problems is also very welcome. Thank you in advance / Jenny
The standard 'geo-search' support on sphinx should work just as well on a Prospective Index, as a normal retrospective search.
Having built a sphinx 'index' of all the saved searches...
And you run a query using the 'ad' as the search query:- rather than the 'filter' using a fixed radius, you just use the radius from the attribute (ie the radius stored on the particular query) - if using the API cant use setFilterRange directly, need to use setSelect, to make a new virtual attribute.
$cl->setSelect("*,IF(#geodist<radius,1,0) as myfilter");
$cl->setFilter('myfilter',array(1));
(and yes, the min/maxprice can just be done with normal filters too - just inverting the logic to that you would use in a retrospective search)
... the complication is in the 'full-text' query, if the saved search is anything more than a single keyword, but you appear to have already figured out that part.

Quick search by related entity field - CRM 2011

Is there possible to do quick search by related entity fields?
In example, if we have Contact lookup field on Lead entity. Can we search Leads by Contact's email address or address name?
Can you refer me to some tutorials.
I know that this is possible by using 'Advance find' option.
Thanks in advance.
Sadly, it's not possible to natively configure quick search to set attributes on related entities as "find columns".
As you might be aware, the native solution would be to find contacts by email address then open their record to look at their Leads.
The only other solution I can imagine would be to embed a custom Silverlight or ASPX page behind a navigation or ribbon button. In this case you could execute your own logic for searching but would not get the rich functionality of the native CRM grid without a lot of work.

Selenium conundrum! Store links/text in links if certain text is present in element

I'm VERY new to Selenium and only came across it when trying to find a way to do the following:
I am a member of website which has forum groups. The website does not have a search function where you can search for all users within a group who are, say, from the UK.
What I want to do is navigate to the user list within a certain group and have a script that looks on the page for the text "United Kingdom" (the country of origin is written next to each username) and then either stores the username or (more preferable) the link which the username points to.
I have managed to write bits that do things like, highlight the term "United Kingdom" etc. But I can't seem to figure out how you search for one piece of text, but store the link which sits in the same element.
Any help would be greatly appreciated!
This should work if you use java bindings, although the basic principle stays the same with other languages
String foo = driver.findElement(By.Id("xxx")).getAttribute("href");

Foursquare get venue details

We are planning to use foursquare api to get venue in a particular city. I want data of all the food outlets in a particular city. I have managed to get the categories list but not sure how to get venues from that particular category in a particular city or area.
Please share some tutorials or document which i can check out.
One way of doing what you want will be using the Venues Platform for browsing according to a category ID.
Look at venue search API reference.
Example of using it:
I know that 4bf58dd8d48988d11f941735 is nightlife (just picked the first one I saw)
So I will call the API (the ll is someplace in New York):
https://api.foursquare.com/v2/venues/search?ll=40.7268,-73.9972&categoryId=4bf58dd8d48988d11f941735&limit=50&intent=browse&radius=1500&your ids/oauth
Or use the explorer to see results right away.
Important, read the search API and the parameters used here to alter behavior to your needs.
Another very important thing, the API parameters are case sensitive!! (so if they want categoryId, categoryid will not work :) )

Resources