

file_put_contents("where you want the file to be", file_get_contents("url of the file on mochiads"));
$pubID = "Here put your Publisher ID"; $gt=$_POST['game_tag']; $extrag=$_POST['extrag']; $typeGame="featured_games"; // Change it to 'all' if you want to import all the games. if($gt!=""||$extrag!=""){ if($gt!=""){ $json=file_get_contents("http://www.mochiads.com/feeds/games/".$pubID."/".$gt."/?format=json"); $n=1; } if($extrag!=""){ $json=file_get_contents("http://www.mochiads.com/feeds/games/".$pubID."/".$typeGame."/all?format=json&limit=".$extrag); $n=$extrag; } $jsonArr=json_decode($json,true); $g=0; while($g<$n){ $gameArr=$jsonArr["games"][$g]; $name=$gameArr["name"]; $description=$gameArr["description"]; $instructions=$gameArr["instructions"]; $swfUrl=$gameArr["swf_url"]; $imgUrl=$gameArr["thumbnail_url"]; $category=$gameArr["categories"][0]; // This is an Array [0] will take the first catgeory choosen. $keywords=""; $nTags=count($gameArr['tags']); for($i=0;$i<$nTags;$i++){ $keywords=$keywords.$gameArr['tags'][$i].' '; } $width=$gameArr["width"]; $height=$gameArr["height"]; $g++; echo "<a target='_blank' rel='nofollow' href=".$swfUrl." target="_blank"><img style='margin:10px 0px 10px 0px; border: solid 2px #FFFFFF;' src=".$imgUrl."> ".$name."</a><br>"; } }
<br><input name="extrag" value="5" size="5" type="text"><br>MochiAds Games <input value="Download" name="Submit" type="submit"><br>
Login to write a comment...