Get Steam games of a certain genre - steam-web-api

I know about the Steam API call: http://api.steampowered.com/ISteamApps/GetAppList/v0002
That returns all apps on Steam. But what GET call must I make to return only games of a specified genre?

You are almost there.
You just need to append your API call with query parameters.
Like so:
http://api.steampowered.com/ISteamApps/GetAppList/v0002/?tag=RPG
Test: http://api.steampowered.com/ISteamApps/GetAppList/v0002/?tag=RPG
or return multiple with:
http://api.steampowered.com/ISteamApps/GetAppList/v0002/?tag=Casual&tag=Simulation
Test:
http://api.steampowered.com/ISteamApps/GetAppList/v0002/?tag=Casual&tag=Simulation
Here are the list of Genre tags:
https://partner.steamgames.com/doc/store/tags
References:
https://partner.steamgames.com/doc/api
https://developer.valvesoftware.com/wiki/Steam_Web_API
https://partner.steamgames.com/doc/store/tags

Related

Microsoft Graoph API - Get corresponding Group ID from Team

I get all teams using the following API call:
GET https://graph.microsoft.com/beta/teams
How do I get the associated Group ID out of this call?
With the Teams Powershell module it is quite easy:
$GroupId = (Get-Team -DisplayName $NewTeamName).GroupId
Many thanks!
You cannot list teams using /teams, only get a specific team using /teams/{group-id}.
You can however list teams in an org. using this:
GET https://graph.microsoft.com/v1.0/groups?$filter=resourceProvisioningOptions/Any(x:x eq 'Team')
docs
this returns the id amoung others
Certain unused old teams will not have resourceProvisioningOptions set. For details, see known issues.
If you want to get ids from the users own joined teams, you can do this:
GET https://graph.microsoft.com/v1.0/me/joinedTeams
docs

How to work with multiple variables in Cypress?

tl;dr: can cypress variables be stored in some accesible place (like this or something similar) or do I have to get into an endless callback cycle if I want to access all of them for a single usage?
Long story:
the app I'm trying to cover with cypress tests runs on many different datasets so in order to prepare the test data before the test, I usually make few API calls and I'd like to work with their results:
Example:
The test should cover a "delete task" functionality. As test data, I want to create a task beforehand over our API. To do this, I need to make these calls:
Call ".../users/me" to get my userId (one of required params)
Call ".../users" to get a list of all users for particular dataset (first id is used to filter another, that is then used for assigneeId, another required param)
Call ".../tasks" with previous id's as required parameters
I currently have custom commands that handle those specific api calls while returning the result. I then call those commands and save their return as cypress variable. Should I want to do the third api call, I have to do something like this:
cy.getUserID().then((userId) => {
cy.wrap(userId).as('userId')
})
cy.getAllUsersForTenant().then((users) => {
cy.get('#userId').then((userId) => {
const result = users.find((escalationUserId) => escalationUserId !== userId)
cy.wrap(result.id).as('assigneeId')
})
})
cy.get('#assigneeId').then((assigneeId) => {
cy.get('#userId').then((userId) => {
// do the POST call with both assigneeId and userId available
})
})
Right now it's not really a big deal but I can imagine that I'l need more than 2 variables, will I have to add more nested callbacks or is there a way to store those variables at one accessible place?
I sort of figured it out by looking at other tickets - if I use function() instead of arrow functions, it is possible to share this context.

Cant get facebook date range working for events in ruby/koala

I am using ruby koala facebook graph API gem to retrieve events but cant restrict the events using a date range. I seem to be getting all events (even ones which have happened). What I am trying to do is get events is the next 200 days. I am using the following (ruby) code:
Koala.config.api_version = 'v2.10'
oauth = Koala::Facebook::OAuth.new app_id, app_secret
graph = Koala::Facebook::API.new oauth.get_app_access_token
from_date = Date.today
to_date = from_date + 200
fb_events = graph.get_object( fb_venue["url_listings"] + "?time_range={\"since\":#{from_date}, \"until\":#{to_date}" )
I am then getting the events 25 at once (the facebook default limit) using 'fb_events.next_page' to get them all.
I seem to get getting all events, including ones is the past.
Are you sure that the #get_object method wants a query string like that? Based on the docs[1], it seems that you should pass your object ID (which I assume is in fb_venue['url_listings'] for you as a first arg, and then metadata in a subsequent arg as a Hash. So I'd try something like:
fb_events = graph.get_object(fb_venue['url_listings'],
{since: from_date, until: to_date})
...according to the key/nesting structure FB expects.
Edit: forgot link to docs.
[1] -
http://www.rubydoc.info/github/arsduo/koala/Koala%2FFacebook%2FGraphAPIMethods%3Aget_object
According to the doc I don't think that you can request all the events, You can only select an event by using /{event-id} like this example or you can get user's events but you will need to ask him for the permission according to
permissions.
add user_events to the list of scope that you are permitting from user.
By this when user sign up using Facebook to your application it will take a permission for his events.
After that by using graph.get_object({facebook-user-id} + '/events') you will get 25 of his events as a default value and you can add {limit: 5} as a second parameter to the get_object function, You can use until and since but they should be in A Unix timestamp look at this to see the needed date format, hope this would help.

Get ARAM match history with League of Legends API

Using the League of Legends API, how can I list of all recent games, including ARAM?
This method says it will return match history:
https://developer.riotgames.com/api/methods#!/873/3054
But when I test it with my summoner ID (32984235), I get an empty result since I only play ARAM.
I'm assuming it's possible since LoLKing does it - http://www.lolking.net/summoner/na/32984235#matches
For now, you can fetch your most recent 10 games of any type using the recent game endpoint:
(/api/lol/{region}/v1.3/game/by-summoner/{summonerId}/recent)
However, that endpoint is going to be deprecated at some point in favor of the match history endpoints, which include
/api/lol/{region}/v2.2/matchlist/by-summoner/{summonerId}
and
/api/lol/{region}/v2.2/match/{matchId}
For now, the match endpoints will only return ranked games. Ultimately though we want to add OAuth support to Riot's public APIs. Once we do that, the idea is that you will be able to fetch all game data for the authenticated user and his friends, which is the same behavior as the in-game match history and the match history website (http://matchhistory.na.leagueoflegends.com).

Twitter Ruby Gem - get friends names and ids, nothing more

Is it possible to simply get the people you are following with just an id and full name? I do not need any of the additional data, it's a waste of bandwidth.
Currently the only solution I have is:
twitter_client = Twitter::Client.new
friend_ids = twitter_client.friend_ids['ids']
friends = twitter_client.users(friend_ids).map { |f| {:twitter_id => f.id, :name => f.name} }
is there anyway to just have users returned be an array of ids and full names? better way of doing it than the way depicted above? preferably a way to not filter on the client side.
The users method uses the users/lookup API call. As you can see on the page, the only param available is include_entities. The only other method which helps you find users has the same limitation. So you cannot download only the needed attributes.
The only other thing I'd like to say is that you could directly use the friends variable, I don't see any benefit of running the map on it.

Resources