Facebook Bookmark Bookmark Bookmark Bookmark Bookmark Bookmark Bookmark Bookmark My Bookmark

LorenzGames, All about Flash Games!

Follow me on Twitter!

How to import games to your site from MochiAds

June 27th, 2009 - Category: MochiAds, PHP, Publishers
MochiAds gives you the possibility to directly download the games to your site through JSON.
The problem is that many people has no clue how this thing works, that's why i have created a script that not only allows you to Download how many games you want from theire site, but gives you the possibility to use the button "Post to my site" that is on the page of every game on MochiAds for manuale downloading.

Mochiads Logo

This script will only unpack the JSON, then you will have to put everything in your own Database and downloading the files the way you want wherever you want. For example you can use the method:
file_put_contents("where you want the file to be", file_get_contents("url of the file on mochiads"));

The only thing you have to change in the code is the Publisher ID, you can find your own here.
If you are going to use the manual submission from MochiAds dont forget to add the link to the file where you put this script in "Auto POST URL".
I set the type of games to download to only featured games, if you want to download all just change "featured_games" to "all".
Please enjoy and share. Emoticon

PHP
$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>";
	}
}


HTML
 <br><input name="extrag" value="5" size="5" type="text"><br>MochiAds Games <input value="Download" name="Submit" type="submit"><br> 


Write a comment

The power of Digg in the Flash Games industry

March 27th, 2009 - Category: Publishers
The site Digg.Com can really help us to improve the visibility of our games or our game site.
This is something that probably everybody knew, but many people are still trying to make it without any success.

On MochiAds Forum there is a thread that contains all the active developers.
I am sure if you help them to digg their games, they will help you to digg your things.

I am going to create a list here of active Digger interested in Flash Games that you can add to your friends.
The idea is to be friend with all on this list.. which is going to grow every day. When you will have all this people in your list, you will have to use it with etiquette, meaning you can not shout spamming stuff all day long, but only if you have something very very cool, or you just released a new very cool game. This way we can allow everybody to receive real Diggs and Comments and probably end up on the front page.

lorenz82 - npgames - theadory - FullerGames - cccpingu - kaolin - onlinegames - jgames - lolwaffle - rhuaridhclark - gamebittk - Vartagh - Dalshiner - RJGames - eternalsyndrome - quezada - somenick - PlayCow - SidWoo - Grendelio - AllFlashNow - KannushiLink - gws34 - frederik77 - stupidflashgames101 - rei1974 - Musenik - onemangs - ninjagames - kimcuddles - mikemx7f - grimdayz - Gaz - Hamumu - aegamers - puppygames - gummikana - UnknownGuy - jebso - Polycount - PoVRAZOR - ajschatz - cliffski - jankoM2 - theoretical - pyabo - BantamCityGames - terin - Indiepath - Genimo - chanon - BortQ - cyrus_zero - indiepath - rinkuhero - clilian - samnova - sillytuna - winterwolves - badsectoracula - yellowhut - Sodaware - bazdigger - agent4125 - tafty - crispiness - PiEyeGames - JKaercher - jonaswills - bignobody - MrPhilGames - chillypacman - tfowers - parsap - Red27Studios - dbestandy - theblackmask - JForceGames - ducridah750 - kneehat - jasonriggs - HybridMindGames - JoUBG - Mexsillus - oscardog1991

If you are interested please send me a message and I will add your Digg Page in the list.


Write a comment