Jump to content
XboxLeaders

Need help for installing


Recommended Posts

Hello, I'm asking for your help as this one afternoon when I try to use the API xboxl eaders. So I downloaded the API and then uploaded to my FTP. I looked at the examples and I started to write code. I cant receive any data. I tried to make links directly from the examples, but it is similar, it does not work.

I then decided to get links in another tutorial and I managed to get a list of games and profile information. Except for achievements, it does not review anything. So I really do not understand anything anymore. Here is my code:

<?php


	$gamertag = 'gatsusan';
	
	$search = json_decode(file_get_contents('http://www.xboxleaders.com/api/games.json?gamertag='.$gamertag));
	$search = $search->Data;
	
	$count = count($search->PlayedGames);
	$title = 'Fable III';
	while($count > $counter) {
		
		foreach($search->PlayedGames as $current) {
			//echo $current->Title.'<br>';
	
			if($title == $current->Title) {
				$gameid = $current->Id;
				$counter == $count;
			}
			$counter++;	
		}
		
		
	}
	
$success = json_decode(file_get_contents('http://www.xboxleaders.com/api/achievements.json?gamertag='.$gamertag.'&gameid='.$gameid));
	
	$success = $success->Data;
	echo $success->Game;


	// Get profile information
  $profile = json_decode(file_get_contents('http://www.xboxleaders.com/api/profile.json?gamertag='.$gamertag));
  $profile = $profile->Data;
  echo $profile->Gamertag;
	
	
	
	
	$count = count($success->Achievements);
	echo $count.'<br>';
	echo $gameid;
	$counter = 0;
	
	while($count > $counter) {
		
		foreach($success->Achievements as $achievement) {
			echo $achievement->Title;
			$counter++;
		}
		
		
	}
	
?>

Thank you

Link to post
Share on other sites

Everything works now. I reviewed my code, and "while" loop does not need to be called. It was extra work for nothing.

I am still asking for your help / advice, because at the moment I use the API from the server Xbox Leaders. I want to use the API directly from my FTP, but it only works partially. When I want to do a query with "games.php", I get this error:

 

Warning: SimpleXMLElement :: addChild (): unterminated entity reference Knuckles in / public_html / api / includes / classes / base.class.php on line 530
^

 

I look at the source code, it seems that the problem comes from the variable $value. It certainly contains an error. this is what gives the echo it returns:

 

:success2.0gatsusan23875588151169261474441431504955Assassin's Creed IIhttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d8025553083b/1033/boxartsm.jpghttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d8025553083b/1033/boxartlg.jpg270100014502813744414161480659542Spartacus Legendshttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d80258411256/1033/boxartsm.jpghttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d80258411256/1033/boxartlg.jpg604003122513744391331480657415Sonic 4 Episode Ihttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d80258410a07/1033/boxartsm.jpghttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d80258410a07/1033/boxartlg.jpg2520041233.3137431278214811157761Internet Explorerhttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d80258480880/1033/boxartsm.jpghttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d80258480880/1033/boxartlg.jpg0000013741467171297287382Fable IIIhttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d8024d5308d6/1033/boxartsm.jpghttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d8024d5308d6/1033/boxartlg.jpg4351250226036.713739087001480657060SuperStreetFighter2THDhttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d802584108a4/1033/boxartsm.jpghttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d802584108a4/1033/boxartlg.jpg1502009127513722407251480657762Mortal Kombat Arcadehttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d80258410b62/1033/boxartsm.jpghttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d80258410b62/1033/boxartlg.jpg2020021216.713722386191480656996Sonic The Hedgehoghttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d80258410864/1033/boxartsm.jpghttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d80258410864/1033/boxartlg.jpg170200111291.713715665731464993789Mortal Kombathttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d802575207fd/1033/boxartsm.jpghttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d802575207fd/1033/boxartlg.jpg201000250413714605661480656995Sonic The Hedgehog 2http://download.xbox.com/content/images/66acd000-77fe-1000-9115-d80258410863/1033/boxartsm.jpghttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d80258410863/1033/boxartlg.jpg7520051241.713712508961297287440Forza Motorsport 4http://download.xbox.com/content/images/66acd000-77fe-1000-9115-d8024d530910/1033/boxartsm.jpghttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d8024d530910/1033/boxartlg.jpg5401250305851.7137103387012972877071Live Event Playerhttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d8024d530a1b/1033/boxartsm.jpghttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d8024d530a1b/1033/boxartlg.jpg0000013708901511480657641Happy Warshttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d80258410ae9/1033/boxartsm.jpghttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d80258410ae9/1033/boxartlg.jpg105001283.613691454741414793324L.A. Noirehttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d8025454086c/1033/boxartsm.jpghttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d8025454086c/1033/boxartlg.jpg180140012602013634580061128466388RESIDENT EVIL 5http://download.xbox.com/content/images/66acd000-77fe-1000-9115-d802434307d4/1033/boxartsm.jpghttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d802434307d4/1033/boxartlg.jpg6551400397055.7136282532114811157391Xbox Music and Videohttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d8025848085b/1033/boxartsm.jpghttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d8025848085b/1033/boxartlg.jpg0000013605748051480659512The Cavehttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d80258411238/1033/boxartsm.jpghttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d80258411238/1033/boxartlg.jpg180400122744.413585257501297287245Forza Motorsport 3http://download.xbox.com/content/images/66acd000-77fe-1000-9115-d8024d53084d/1033/boxartsm.jpghttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d8024d53084d/1033/boxartlg.jpg725100041508213573193368104201771VEVOhttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d802304e07d1/1033/boxartsm.jpghttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d802304e07d1/1033/boxartlg.jpg0000013561730061480659527Jet Set Radiohttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d80258411247/1033/boxartsm.jpghttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d80258411247/1033/boxartlg.jpg454006302013547862101297549266Strangleholdhttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d8024d5707d2/1033/boxartsm.jpghttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d8024d5707d2/1033/boxartlg.jpg6901250315556.413438898471313671164TEKKEN 6http://download.xbox.com/content/images/66acd000-77fe-1000-9115-d8024e4d07fc/1033/boxartsm.jpghttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d8024e4d07fc/1033/boxartlg.jpg615100036507213438225621413679057DEAD OR ALIVE 4http://download.xbox.com/content/images/66acd000-77fe-1000-9115-d802544307d1/1033/boxartsm.jpghttp://download.xbox.com/content/images/66acd000-77fe-1000-9115-d802544307d1/1033/boxartlg.jpg505100027456013429700241414793338NBA 2K11http://download.xbox.com/content/images/66acd000-77fe-1000-9115-d8025454087a/1033/b

 

 

Through the server Xbox Leaders, I often falls by this error:
 

{
    "status": "error",
    "version": "2.0",
    "data": {
        "code": 501,
        "message": "The gamertag supplied does not exist on Xbox Live."
    },
    "runtime": 0
}

 

The rest work properly. I have another question, do I need to chmod 775 the folder and sub folders API? Otherwise, I can not access the API. Is it dangerous for my safety?

 

Thank You !

Link to post
Share on other sites
  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...