

local api_key = "08136FE4C8A5790CE1868A4CA4AEE80B"

local function check(steamid)

	if (!steamid) then MsgN("noob") return end

	MsgN("owo whats this ... " .. steamid .. " ...")

	if (api_key) then

		http.Fetch(
			string.format("http://api.steampowered.com/IPlayerService/IsPlayingSharedGame/v0001/?key=%s&format=json&steamid=%s&appid_playing=4000",
				api_key,
				util.SteamIDTo64( steamid )
			),
			
			function(body)
			
				data = util.JSONToTable(body)
				local lender = data.response.lender_steamid
				if lender ~= "0" then
				
					MsgN("lender of " .. steamid .. ": " .. util.SteamIDFrom64(lender))
					MsgN("lender profile: http://steamcommunity.com/profiles/" .. lender)
										
				end
			end,
			
			function(err)
			
				MsgN("error: api server timed out")
				
				return
				
			end
		
		)
	end
	
end


concommand.Add("menu_altcheck", function(p,c,a,r)
	check(r)
end)