Steam web API getting CS:GO inventory - json

Alright, so I have been looking for this all over the internet, and what I have found out is that when you want to get someones steam inventory you use this:
http://api.steampowered.com/IEconItems_{appid}/GetPlayerItems/v0001/?key={apikey}&steamid={steamid}&format=json
But the problem is that when I do that for CS:GO (appid: 730), I just get an empty response back, even though the user has items in their inventory.

if you want to get the json just use one of the following links:
general steam inventory: ( 1: games, 3: coupons, 6: trading cards, 7: rewards )
http://steamcommunity.com/id/<USERURL>/inventory/json/753/1
http://steamcommunity.com/profiles/<STEAMID>/inventory/json/753/1
http://steamcommunity.com/id/<USERURL>/inventory/json/753/3
http://steamcommunity.com/profiles/<STEAMID>/inventory/json/753/3
http://steamcommunity.com/id/<USERURL>/inventory/json/753/6
http://steamcommunity.com/profiles/<STEAMID>/inventory/json/753/6
http://steamcommunity.com/id/<USERURL>/inventory/json/753/7
http://steamcommunity.com/profiles/<STEAMID>/inventory/json/753/7
games :
http://steamcommunity.com/id/<USERURL>/inventory/json/<APPID>/2
http://steamcommunity.com/profiles/<STEAMID>/inventory/json/<APPID>/2
the problem was not the counter-strike appid,
you just used an old link that only works for the general steam inventory.
I suggest you using the link using STEAMID because not every steamuser has set a customurl.

Related

Building a dashboard using streamlit

I am trying to create a user widget for the epl table that accepts both the home team and away team selection. how to I do it?
I had used
# sidebar team selection
sorted_unique_team = sorted(df.Home.unique())
selected_team = st.sidebar.selectbox("Home", sorted_unique_team)
that works so nicely. But it displays only the home results. how do I create one that can also output either the home team results or the away results of a team bearing in mind that there is a separate column for the away results within the same dataframe.

Adding live population to my Html website from worldometers.info

I have a website that shows the user the population for the country in an attractive way.
My problem is that I will need to get the data to be updated automatically.
My question is how do I get the source code of the population from this website.
https://www.worldometers.info/world-population/afghanistan-population/
You can use the following free API to get the current population of the country. Then you can use JavaScript to fetch the value and output it on your website. To always display the latest value, you could wrap the fetch method in an interval, which repeats after a given time.

Is there a way to automatically create categories from a list of items?

I want to add some recipes to a part of my Mediawiki site and have each ingredient create a relevant category.
This is easy to do by hand, but subject to human error - each ingredient has to be entered twice.
for example
* [[category:apples]] apples
* [[category:bananas]] bananas
* [[category:cherries]] cherries
This works, but I feel there should be a way to automate it however I'm not really sure of what the best way forward would be. Is there already an extension to do this (I've searched on all the terms I can think of), should I be writing a script ? Is there some other method to solve this that I should be looking at ?
You could use a template, lets call it Template:Ingredient,
<includeonly>* [[Category:{{{1}}}]] {{{1}}}</includeonly>
Then call it in your page with:
{{Ingredient|apples}}
This will both display the ingredient name and add the page to the category.

Telegram api. Get all uploaded photos by media_group_id

I send to my telegram bot a few photos as group. How I can get the file_id all of my uploaded photos?
I use webhooks, but response is not contain any data about all photos, just some data about last uploaded photo and media_group_id. How I can get all file_id's of my uploaded group photos
response:
The Telegram Bot API does not give to your web-hook any reliable information about the order of each item in a media group. https://core.telegram.org/bots/api#message
Suggestions:
If bot is in a private chat, save the incoming file_id against their media_group_id. Whenever media_group_id changes you would have all you need to use. Engage the user in some other way so that you can quickly determine the media_group_id change and respond quickly from that processing.
If bot is in a group chat, save incoming file_id against the users id as well as media_group_id and similarly monitor changes to media_group_id and user id to take action.
When a solution starts getting too complex for my liking, I prefer to go back to the basic reason for my need and perhaps find out that I do not need to do something an API doesn't afford like "Get all uploaded photos by media_group_id". Maybe I can just process them individually as the updates stream in.
Tip: If the media group has a caption and you only care about the first media item in the group, then monitoring the media_group_id and caption of an incoming message should be sufficient.
if(message.caption != null && message.media_group_id != null){
// first item in new group received
}
Okay, this way is not simple and not elegant but it's working.
We need to see in webhook response media_group_id element - this means that this is a group of media.
If the first point is true - save the data about this media on own server (data must be contain media_group_id)
example: ["media_group_id" => [[some data about photo]]]
When next webhook is come, we need to see his media_group_id, if it's the same - ok, add him to array...
example: ["media_group_id" => [[some data about photo],[some data about photo]]]
if not - ok, make a new element of array:
example: ["media_group_id" => [[some data about photo]], "media_group_id2" =>
[[some data about photo]]]
So we got an array that contains all data about the photos of the one(or more) group.
hmmm... I don't like this way, but how make better?
In Pyrogram, we can use the get_media_group function, https://docs.pyrogram.org/api/methods/get_media_group.html#pyrogram.Client.get_media_group. in my opinion, it is much better than using BOT API.

Retrieving id from database displayed and passing onto other page

I'm displaying the contents of a database on a particular page(recipe names).
I'd like each recipe to be a link which opens to another page. I understand I would have to obtain the recipe id for that particular recipe, pass the id to another page and print the recipe contents onto that page. I would like to know how to retrieve the unique recipe id of a particular recipe ON BEING CLICKED upon mainly.
If you are displaying the contents of a database on a particular page, then definitely you are using a server side scripting like like ASP or PHP or some JavaScript + AJAX. I am quite unclear about that. But for your question, I can tell you one thing that, if, suppose you are using PHP, then you may display the link as;
echo ''.$recipiename.'';
where $recipeid is the variable carrying recipe id and $recipiename is the name of your recipe. In your PHP file (yourpage.php), you may catch this data like $_GET["recipeid"]
You may try a Google search for tutorials.
Use;
$strLink = ''.$strName.'';
echo "<li>".$strLink."</li>";
Don't use spaces.
You just make the id part auf the URL the recipe link points to.
Iced Water
Would be a link pointing to the recipe with ID 23. Since the url is available on the server side you are all set.