Steam Web API:我不确定如何处理这个看起来像哈希的 url 来生成图像 [英] Steam Web API: I'm not sure what to do with this hash looking url to generate an image with it

查看:46
本文介绍了Steam Web API:我不确定如何处理这个看起来像哈希的 url 来生成图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Steam Web API 加载我的贸易伙伴库存,它返回一个填充有如下对象的数组:

Using the Steam Web API I load my trade partners inventory which returns an array filled with objects like this:

{ id: '2063512233',
  classid: '520025252',
  instanceid: '0',
  amount: '1',
  pos: 2,
  appid: '730',
  icon_url: 'fWFc82js0fmoRAP-qOIPu5THSWqfSmTELLqcUywGkijVjZYMUrsm1j-9xgEObwgfEgznuShMhvflDOGJG68Didsh4K9W1jtmhA9yIPqKZHlhIgCQUvgKBKBoowq7CyJi7pZlV47jou0EeFrs4dGQYbEtOdsZSsTQRLbYMa0PH-14',
  icon_drag_url: '',
  name: 'Operation Breakout Weapon Case',
  market_hash_name: 'Operation Breakout Weapon Case',
  market_name: 'Operation Breakout Weapon Case',
  name_color: 'D2D2D2',
  background_color: '',
  type: 'Base Grade Container',
  tradable: 1,
  marketable: 1,
  commodity: 1,
  descriptions:
   [ { type: 'html', value: ' ' },
     { type: 'html', value: 'Container Series #18', color: '99ccff' },
     { type: 'html', value: ' ' },
     { type: 'html', value: 'Contains one of the following:' },
     { type: 'html', value: 'MP7 | Urban Hazard', color: '4b69ff' },
     { type: 'html', value: 'Negev | Desert-Strike', color: '4b69ff' },
     { type: 'html', value: 'P2000 | Ivory', color: '4b69ff' },
     { type: 'html', value: 'SSG 08 | Abyss', color: '4b69ff' },
     { type: 'html', value: 'UMP-45 | Labyrinth', color: '4b69ff' },
     { type: 'html', value: 'PP-Bizon | Osiris', color: '8847ff' },
     { type: 'html', value: 'CZ75-Auto | Tigris', color: '8847ff' },
     { type: 'html', value: 'Nova | Koi', color: '8847ff' },
     { type: 'html', value: 'P250 | Supernova', color: '8847ff' },
     { type: 'html',
       value: 'Desert Eagle | Conspiracy',
       color: 'd32ce6' },
     { type: 'html',
       value: 'Five-SeveN | Fowl Play',
       color: 'd32ce6' },
     { type: 'html',
       value: 'Glock-18 | Water Elemental',
       color: 'd32ce6' },
     { type: 'html', value: 'P90 | Asiimov', color: 'eb4b4b' },
     { type: 'html', value: 'M4A1-S | Cyrex', color: 'eb4b4b' },
     { type: 'html',
       value: 'or an Exceedingly Rare Butterfly Knife!',
       color: 'ffd700' },
     { type: 'html', value: ' ' },
     { type: 'html', value: '', color: '00a000', app_data: [Object] } ],
  tags:
   [ { internal_name: 'CSGO_Type_WeaponCase',
       name: 'Container',
       category: 'Type',
       category_name: 'Type' },
     { internal_name: 'set_community_4',
       name: 'The Breakout Collection',
       category: 'ItemSet',
       category_name: 'Collection' },
     { internal_name: 'normal',
       name: 'Normal',
       category: 'Quality',
       category_name: 'Category' },
     { internal_name: 'Rarity_Common',
       name: 'Base Grade',
       category: 'Rarity',
       color: 'b0c3d9',
       category_name: 'Quality' } ],
  contextid: 2 
}

这很好,效果很好,我唯一的问题是当我想在网站上呈现项目的图标时,我不确定链接到 icon_url 的前缀类型.在多次阅读 Web API 之后,我真的找不到关于完整 URL 应该是什么样子的任何信息.如果有人可以提供帮助,那就太好了.谢谢!

Which is fine and works great, my only problem is when I want to render the icon of the item on the site, I'm not sure what kind of prefix to link to the icon_url. After reading through the Web API a few more times I can't really find anything on what the full URL is supposed to look like. If anybody can help that'd be grrrreeaatt. Thanks!

推荐答案

http://cdn.steamcommunity.com/economy/image/放在前面.

来源:谷歌

这篇关于Steam Web API:我不确定如何处理这个看起来像哈希的 url 来生成图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆