Tweepy-Twitter Python : Get trends where no WOEID available - python-3.x

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.

Related

How to make Google display only Country-specific search results based on user's location

My question goes like this:
I own a multinational company with the following websites
www.abc.com/us/,
www.abc.com/uk/,
www.abc.com/apac/,
I advertise my product (let's name it "device") on each of my above regional websites like
www.abc.com/us/device/
www.abc.com/uk/device/
www.abc.com/apac/device/
Content on the above webpages is almost the same albeit some minor differences.
When a user from US searches "device" using Google Search, Google Search result returns all the above three URLs
www.abc.com/us/device
www.abc.com/uk/device
www.abc.com/apac/device
I do not want this to happen as it confuses the user and would want Google to display only www.abc.com/us/device for the US user in his search results,www.abc.com/uk/ for the UK user and so on.
What changes do I need to make on my webpage source for Google to display only my United States website (www.abc.com/us/device) in the search results (for US user)

Instagram API - FACEBOOK_PLACES_ID

I wrote a mini instagram wordpress plugin for my cafe's website that shows the photos taken there on our homepage. You can see it in action here: dem-istanbul.com
However, since instagram now uses facebook places instead of foursquare, the location id I'm using is outdated, plus I want to add a second place as we have opened a new branch. I've been using this code to list the photos:
$result = fetchData("https://api.instagram.com/v1/locations/83910054/media/recent/?access_token={$accessToken}&count=8");
However, when I want to add a second location, I am unable to find the location-id as it now fetches data from facebook places. This value had newly been added to the Instagram API, however I'm at a loss on using it:
https://api.instagram.com/v1/locations/search?lat=48.858844&lng=2.294351&access_token=ACCESS-TOKEN
Search for a location by geographic coordinate.
PARAMETERS:
DISTANCE Default is 1000m (distance=1000), max distance is 5000.
FACEBOOK_PLACES_ID Returns a location mapped off of a Facebook places id. If used, a Foursquare id and lat, lng are not required.
FOURSQUARE_ID Returns a location mapped off of a foursquare v1 api location id. If used, you are not required to use lat and lng. Note that this method is deprecated; you should use the new foursquare IDs with V2 of their API.
LAT Latitude of the center search coordinate. If used, lng is required.
LNG Longitude of the center search coordinate. If used, lat is required.
FOURSQUARE_V2_ID Returns a location mapped off of a foursquare v2 api location id. If used, you are not required to use lat and lng.
From what I understand, I should now be able to use facebook places id to list images, but I'm not sure where to get it.
Sorry if that sounds complicated, but I'll be very happy if anyone can help me with this. Thanks very much in advance.
You can find your location facebook place id, foursquare id or by geographic coordinate.
Your second cafe is probably dem bebek. You can get it's () id via http://graph.facebook.com/DemBebek .
By the way you can get your second cafe's medias via https://api.instagram.com/v1/locations/385502821/media/recent

City proximity search drupal

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.

How to get keyword type (Organic or Paid) from Google Analytics Reporting API

I am using Google Analytics Core Reporting API. I have a little confusion that I want to discuss.
First I want to get keyword which User has searched to reach on my site. I have used ga:keyword. I have also seen one other dimension which is ga:searchKeyword. Which one of these will give me desire result?
Second I want to get keyword type is it organic or paid? If I will use ga:medium then will it give me type of searched keyword?
BTY using following function to get results
private function getResults(&$analytics, $profileId,$data) {
$optParams = array(
'dimensions' => 'ga:visitCount,ga:browser,ga:fullReferrer,ga:keyword,ga:country,ga:campaign,ga:medium'
);
return $analytics->data_ga->get(
'ga:' . $profileId, $data['start_date'], $data['end_date'], 'ga:visits',$optParams);
}
Please guide me.
Best Regards,
ga:searchKeyword is only for keywords from your internal site search. ga:keyword and ga:medium will give the desired result.
According to the documentation, ga:keyword tracks:
When using manual campaign tracking, the value of the utm_term campaign tracking parameter. When using AdWords autotagging or if a visitor used organic search to reach your property, the keywords used by visitors to reach your property. Otherwise the value is (not set).
ga:medium can be used to tell organic search and paid clicks apart. It tracks:
The type of referrals to your property. When using manual campaign tracking, the value of the utm_medium campaign tracking parameter. When using AdWords autotagging, the value is ppc. If the user comes from a search engine detected by Google Analytics, the value is organic. If the referrer is not a search engine, the value is referral. If the visitor came directly to the property, and document.referrer is empty, the value is (none).

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