How to returns all public tweets regarding for specific location using tweeter api - tweets

Is there an API call which will returns all recent public tweets regarding for specific location?
I tried GET trends/place but it's WOEID not worked for Sri Lanka and Cities.
(Sri Lanka WOEID is 23424778)
I don't want to use tweeter GET search/tweets.json endpoint because search based on certain key words.
Is there any solution for this?

Finally, I got the answer. We could not get trends on each and every location using tweeter API 1.1.
you have to check our closest trending place using this API call. For Austalia
https://api.twitter.com/1.1/trends/closest.json?lat=37.781157&long=-122.400612831116
the response like be this.
[
{
"country": "Australia",
"countryCode": "AU",
"name": "Australia",
"parentid": 1,
"placeType": {
"code": 12,
"name": "Country"
},
"url": "http://where.yahooapis.com/v1/place/23424748",
"woeid": 23424748
}
]
after that, you can use GET trends/place.
even though you cannot use GET trends/place for geo-based filtering you can use tweeter search endpoint. if you do not want to filter it by keyword ignore the q parameter and use geocodeparameter. for example,
https://api.twitter.com/1.1/search/tweets.json?result_type=recent&geocode=5.954920,80.554956,12mi
In here mi is miles.

Related

Is there a way to write an Expression in Power Automate to retrieve item from SurveyMonkey?

There is no dynamic content you can get from the SurveyMonkey trigger in Power Automate except for the Analyze URL, Created Date, and Link. Is it possible I could retrieve the data with an expression so I could add fields to SharePoint or send emails based on answers to questions?
For instance, here is some JSON data for a county multiple choice field, that I would like to know the county so I can have the email sent to the correct person:
{
"id": "753498214",
"answers": [
{
"choice_id": "4963767255",
"simple_text": "Williamson"
}
],
"family": "single_choice",
"subtype": "menu",
"heading": "County where the problem is occurring:"
}
And basically, a way to create dynamic fields from the content so it would be more usable?
I am a novice so your answer will have to assume I know nothing!
Thanks for considering the question.
Overall, anything I have tried is unsuccessful!
I was able to get an answer on Microsoft Power Users support.
Put this data in compose action:
{
"id": "753498214",
"answers": [
{
"choice_id": "4963767255",
"simple_text": "Williamson"
}
],
"family": "single_choice",
"subtype": "menu",
"heading": "County where the problem is occurring:"
}
Then these expressions in additional compose actions:
To get choice_id:
outputs('Compose')?['answers']?[0]?['choice_id']
To get simple_text:
outputs('Compose')?['answers']?[0]?['simple_text']
Reference link here where I retrieved the answer is here.
https://powerusers.microsoft.com/t5/General-Power-Automate/How-to-write-an-expression-to-retrieve-answer/m-p/1960784#M114215

How i can get list of popular youtube channels per each country?

How i can get list of popular youtube channels per each country?
this service find solution
https://www.channelcrawler.com/eng/results2/281574
I tried youtube api but i didn't find, anyone know solution?
As mentioned, is not possible to get this information using the YouTube API directly, even in the FAQ of the page you shared says:
The Channel Crawler was made to discover new YouTube channels, based on your search criteria.
and:
The Channel Crawler uses advanced data collection methods in order to collect channel information from YouTube and store it in the database. Basically, it just checks the liked videos and comment sections of channels that are already in the database, in order to add more channels to it. You can also manually add a channel.
Following the highlighted information, I have this idea and you can try it too:
Use the search endpoint for search channels in a specific country and in a specific videoCategory, then, with the channelId returned in the results of the search, use the channel endpoint for get their country1.
1 take into account that some channels doesn't have the country value; in this case, you have to set another criteria(s) for determine whether the channel matches with your requirements.
Example:
Use the search endpoint for search channels in country/region Pakistan and in the videoCategory Sports - test it here:
URL:
https://youtube.googleapis.com/youtube/v3/search?part=id%2Csnippet&order=videoCount&q=Sports&regionCode=PK&key=[YOUR_API_KEY]
The results of this request are as follows:
{
"kind": "youtube#searchListResponse",
"etag": "0C7hSI3oNXJt66PsERuviVQcLCo",
"nextPageToken": "CAUQAA", // Remember the nextPageToken for get the next results.
"regionCode": "PK", // Region queried.
"pageInfo": {
"totalResults": 1000000, // Look the amount of data you have to check, filter and debug.
"resultsPerPage": 5 // Set "maxResults" parameter to "50" for get more results per page.
},
"items": [
{
"kind": "youtube#searchResult",
"etag": "iSwEnBs_yV6lOIBubmRXVwjjujQ",
"id": {
"kind": "youtube#channel", // Make sure that this item is actually an channel.
"channelId": "UCo2TvjBHS1BtyIkeGGTMe6w"
},
"snippet": {
"publishedAt": "2018-07-28T18:34:04Z",
"channelId": "UCo2TvjBHS1BtyIkeGGTMe6w", // Use this value for the "channel" endpoint.
"title": "ONTime Sports",
"description": "قناة اون تايم سبورت واحدة من مجم...",
"thumbnails": { [thumbnails here...] },
"channelTitle": "ONTime Sports",
"liveBroadcastContent": "upcoming",
"publishTime": "2018-07-28T18:34:04Z"
}
},
[other results here...]
]
}
Use channel endpoint for get the channel detailed information - in this case, their country - test it here:
URL - using the channelId UCo2TvjBHS1BtyIkeGGTMe6w - obtained from the previous search results:
https://youtube.googleapis.com/youtube/v3/channels?part=id%2Csnippet&id=UCo2TvjBHS1BtyIkeGGTMe6w&key=[YOUR_API_KEY]
The results of this request are as follows:
{
"kind": "youtube#channelListResponse",
"etag": "8BfUXxlAEBLe7lBmih1JXUwZ394",
"pageInfo": {
"totalResults": 1,
"resultsPerPage": 5
},
"items": [
{
"kind": "youtube#channel",
"etag": "AFk5NCl9393ui58WyRf7WljoatE",
"id": "UCo2TvjBHS1BtyIkeGGTMe6w",
"snippet": {
"title": "ONTime Sports",
"description": "large description here...",
"customUrl": "ontimesportseg",
"publishedAt": "2018-07-28T18:34:04Z",
"thumbnails": {[thumbnails here]},
"localized": {
"title": "ONTime Sports",
"description": "large description here..."
},
"country": "EG" // This is the regionCode of the country this channels has provided.
}
}
]
}
Here, you can see that the value "country" for this channel is "EG" = Egypt2.
Then, repeat these steps with all countries and videoCategory for each country.
Considerations:
As I tested, the type parameter in search is not working as one might expect, in this case (for get channels only), use the order=viewCount combination of parameter=value. Even with this combination, make sure to check that the value of the kind attribute is: youtube#channel. Also, I search the videoCategory using its name, no its id - as it should be -, but, the API is not perfect, that's why I used the name of the videoCategory.
Even specifiyng the region parameter with a valid country, you might get results that are either from another countries or doesn't have the country attribute and value at all = and that's due the channel's popularity in the given country and public channel information. A simple example could be: ESPN, they probably have a YouTube channel for each country, but, their main channel is the most popular in all countries, so, in this case, you'll get the ESPN channel in english and that might differ from your expected results. You have to work with what YouTube provides.
As you notice, there are too many channels/results to debug, so, make sure to provide more filters and set your queries/search criteria and (once you get the desired results), store the valid results in a database or similar.
If you know specific channels that you know are popular in a given country, but, when you query that channel using the YouTube Data API, it doesn't bring the country value, you have to save that channel manually in your database and/or collect more information for automatically set if a channel is from a given country - this point is very related to my point # 2.

Google Places API Difference between _id and place_id

Could someone please explain me the key difference between the attributes: _id and place_id?
I know: Place IDs uniquely identify a place in the Google Places database and on Google Maps.
But what does the attribute _key representing ?
Example Response Code from the Google Api:
{
"_id": "d5bcd8db4a52088350ffb502c31c6694918d3907",
"place_id": "ChIJb3D1a2mnkUcRxop5hdAGiwY",
"lat": 27.991789,
"lng": 3.865653,
"name": "We Are here",
"rating": 0,
"user_ratings_total": 0,
"types": [
"school",
"point_of_interest",
"establishment"
],
I believe the _id field was deprecated and should disappear from responses shortly.
The Places fields reference, id, alt_id, and scope are deprecated as of September 3, 2019, and will be turned off on June 3, 2020.
The id and reference request parameters have been replaced by the place_id request parameter.
the alt_id and scope fields have no equivalent, as they were only used for the Place Add service which was turned off in July 2018.
source: https://developers.google.com/maps/deprecations#places_fields_reference_id_alt_id_scope_-
I guess Google just renamed deprecated id field as _id.

Steam API all games

I've been reading forums and trying Steam APIs, I'm searching for an API which provides all Steam Games.
I found the API providing all SteamApps, and the Steam Store API which provides information for Apps (I'm looking for the type: 'game'), but for this, I need to call the store API once for each SteamApp... And the Store API is limited to 200 calls every 5 minutes! Is it the only solution?
EDIT:
All Apps API : http://api.steampowered.com/ISteamApps/GetAppList/v0002/?key=STEAMKEY&format=json
App details API : http://store.steampowered.com/api/appdetails?appids={APP_ID}
There is no "Steam API all games and all their details in one go".
You use GetAppList to get all the steam apps. Then you have to query each app with appdetails which will take a long time.
GetAppList : http://api.steampowered.com/ISteamApps/GetAppList/v0002/?format=json
{
"applist": {
"apps": [
{"appid": 10, "name": "Counter-Strike"},
{"appid": 20, "name": "Team Fortress Classic"},
{"appid": 30, "name": "Day of Defeat"},
{"appid": 40, "name": "Deathmatch Classic"}
]
}
}
appdetails : http://store.steampowered.com/api/appdetails?appids=10
{
"10": {
"success": true,
"data": {
"type": "game",
"name": "Counter-Strike",
"steam_appid": 10,
"required_age": 0,
"is_free": false,
"detailed_description": "...",
"about_the_game": "...",
"short_description": "...",
"developers": ["Valve"],
"publishers": ["Valve"],
"EVEN_MORE_DATA": {}
}
}
}
There is a general API rate limit for each unique IP adress of 200 requests in five minutes which is one request every 1.5 seconds.
Another solution would be to use a third-party service such as SteamApis which offers more options but they are inevitably bound to what Steam offers in their API.
A common method here is to cache the results.
So for example, if your using something like PHP to query the results, you would do something like json_encode and json_decode with an array / object to hold the last results.
You can get fancy depending on what you want, but basically you'll need to cache and then perform an update of the oldest.

Pull public event data from Google Calendar

I may be over thinking this a bit. On my web site, I would like to user certain data from my public google calendar. My plan is to pull it on the server side so I can do things like process it, cache it and format it the way I want.
I've been looking at using the Google Api libraries, but I can't get past any of the authorization hurdles. A service account sounds like what I really want, but I'm having trouble wrapping my head around how that works in this situation.
The old GDATA apis would be ok, but I'm not very keen on using them because they look fairly deprecated at this point by the newer libraries.
Since it is all public data, I'm hoping there is a simpler way to get to the event data that I'm looking for.
In case it matters, my site is Asp.Net (MVC).
Update
Ok, I was definitely way over thinking it. See my answer.
Now that RSS has been removed from Google Calendar, I've been in search of an easy replacement. I dug around and found the following in the Google Calendar API that seems to do the trick: calendar.events.list
Calendar Events List in Google API Explorer is a good place to get started with the different parameters and options - and it'll build you an example request string. You can see that I specified a minimum time of 2/5/2016, sort it by the start time, and show deleted events.
GET https://www.googleapis.com/calendar/v3/calendars/[CALENDAR ID HERE]/events?
orderBy=startTime&showDeleted=true&singleEvents=true&
timeMin=2016-02-05T00%3A00%3A00Z&key={YOUR_API_KEY}
Results are in JSON so you can parse it in your favorite programming language, ASP.NET or whatever. Result looks like:
{
"kind": "calendar#events",
"etag": "\"123456789123456\"",
"summary": "My Public Calendar",
"updated": "2016-01-29T14:38:29.392Z",
"timeZone": "America/New_York",
"accessRole": "reader",
"defaultReminders": [ ],
"items": [ {
"kind": "calendar#event",
"etag": "\"9876543210987654\"",
"id": "sfdljgsdkjgheakrht4sfdjfscd",
"status": "confirmed",
"htmlLink": "https://www.google.com/calendar/event?eid=sdgtukhysrih489759sdkjfhwseihty7934hyt94hdorujt3q95uy689u9yhfdgnbiwe5hy",
"created": "2015-07-06T16:21:59.000Z",
"updated": "2015-07-06T16:21:59.329Z",
"summary": "In-Service Day",
"location": "Maui, HI",
"creator": {
"email": "abra#cadabra.com",
"displayName": "Joe Abra"
},
"organizer": {
"email": "cadabra.com_sejhrgtuiwerghwi4hruh#group.calendar.google.com",
"displayName": "My Public Calendar",
"self": true
},
"start": {
"date": "2016-02-08"
},
"end": {
"date": "2016-02-09"
},
"transparency": "transparent",
"iCalUID": "isdt56y784g78ty86tgsfdgh#google.com",
"sequence": 0
},
{
...
}]
}
One good answer to this (the one I'm going with) is to simply use the calendar's public address to get the data. This is an option that I had forgotten about and it works fine for this particular situation.
You can find the url for the data if you go to the settings for a particular calendar and pick the format you want (I went with xml for this situation.)
The data that you get out of this service is very human-reader optimized, but I can make it work for what I'm doing.

Resources