使用Steam Web API我加载了我的贸易伙伴库存,该库存返回一个填充了以下对象的数组:
{ 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应该是什么样的内容。如果有人可以提供帮助,那就是grrrreeaatt。谢谢!
答案 0 :(得分:3)
将http://cdn.steamcommunity.com/economy/image/
放在前面。
来源:谷歌