node-steam-user icon indicating copy to clipboard operation
node-steam-user copied to clipboard

Support for fetching game news

Open magne4000 opened this issue 3 years ago • 1 comments

Is your feature request related to a problem? Please describe.

I would like to be able to retrieve the news of an app, like we have on this page for instance.

Describe the solution you'd like

A request that allows me to get X news items for a specified appid. Also receiving an event when a new news is available would be really helpful.

Describe alternatives you've considered

RSS feed is cool, be it misses some metadata that I miss, like the type of the news (patch note, news, regular update)

magne4000 avatar Jun 15 '22 22:06 magne4000

I would say that this is out of scope for steam-user since it involves fetching data from the store site, but the client does have a message it sends to the CM to retrieve news listings (and other user news like friends' achievements).

I don't have time right now to work on the code for this, but here's what I've found in the client's traffic:

UserNews.GetUserNews#1 is sent with values:

  • count = 100
  • starttime = 1
  • endtime = 0
  • language = english
  • filterflags = 137094
  • filterappid = obvious

A news entry appears in the response like this:

{
	"eventtype": 1002,
	"eventtime": 1656332925,
	"steamid_actor": "103582791465104932",
	"steamid_target": "76561198864074490",
	"gameid": "1054490",
	"clan_announcementid": "3346752589091912483",
	"event_last_mod_time": 1656331461
}

Then the client makes an HTTP request to https://store.steampowered.com/events/ajaxgetpartnerevent?clan_accountid=35583524&announcement_gid=3346752589091912483&lang_list=0&last_modified_time=1656331461&origin=https:%2F%2Fsteamloopback.host&for_edit=false

For completeness, here's what an achievement entry looks like:

{
	"eventtype": 2,
	"eventtime": 1654577509,
	"steamid_actor": "redacted",
	"steamid_target": "0",
	"gameid": "1054490",
	"achievement_names": [
		"Wait_one_more_thing"
	]
}

And the corresponding entry in achievement_display_data:

{
	"name": "Wait_one_more_thing",
	"display_name": "Wait, one more thing!",
	"display_description": "Trigger three or more end of round powers in one round.",
	"icon": "3b997d22645203a3adbb7f595aea06af99efa5f5.jpg",
	"unlocked_pct": 2.9000000953674316
}

That icon corresponds to this url: https://cdn.cloudflare.steamstatic.com/steamcommunity/public/images/apps/1054490/3b997d22645203a3adbb7f595aea06af99efa5f5.jpg

DoctorMcKay avatar Jul 14 '22 06:07 DoctorMcKay