Eried's Unofficial Repo :)


(Pharap) #61

Time to start aiming for 200!


By the way, would you mind if I renamed this thread to “Eried’s unofficial repo :)”?

Somehow “Eried’s unofficial repo :)” makes more sense than “New (another) unofficial repo :)” given the significance of the thread.


(Simon) #62

@Vampirics and I have two games in various states of development.

Why don’t we come out and call it the ‘Official Repo’ … IMHO its the best going around.


#63

I think it’s understood that it’s unofficial so I vote for 'Eried’s Repo ’


(Simon) #64

Do we have an official repo?


(Pharap) #65

No we don’t.
There was talk of an official one at one point, but it evaporated.

“Eried’s Repo” it is.
(It can be changed back later if need be.)


(Simon) #66

I think ‘Eried’s Repo’ sounds like his own repo. Maybe we need a title that tells everyone that it is a centralised repo of everyone’s games / utilities.

Something short and snappy like Eried’s Centralised Arduboy (and of course clones) Repository of Games and Utilities submitted by other members. Catchy hey?


(Pharap) #67

Or ECA(aocc)RoGaUSbOM for short?


(Simon) #68

That’s better … it fits on one line.


(Erwin) #69

“unofficial” was the cool part of the repo :confused:


(Pharap) #70

Changed for the last time: “Eried’s Unofficial Repo”

(Though really, it’s the de facto repo.)


(Erwin) #71

hahaha! I am kidding, I am ok with any name.

** @pharap renames thread to “any name” **


(Erwin) #72

We are soon reaching 200 games! Does anyone know a way to track the games people are downloading? (new sort by popularity maybe)

Here are some stats (server side):


(Simon) #73

Doesn’t your server have an ‘Access Log’ (think Apache) that shows what links have been clicked on? You could parse this and get some click through stats.

Alternatively, you could have the links to the games actually submit back to a controller that records the click and then dishes out the actual file or redirects to ProjectABE.


(Erwin) #74

It has an access log (that is the stats I’ve posted in the previous post) but it cannot track the games because they are hosted in github. Adding a redirection might add issues with direct links like arduboy: so I think we need something else… suggestions?


(Simon) #75

What is it hosted on?

Apache / MySQL/ PHP?
Tomcat?


(Erwin) #76

nginx / mysql / php. It’s the 1.68 EUR/mo option https://www.mochahost.com/webhosting.php

That is why having 20 GB transfer in a month from http://arduboy.ried.cl kills the service :stuck_out_tongue:


(Simon) #77

How about this little bit of PHP code. It simply writes the selection to the database and then redirects.

launcher.php

<?php

$hostname     = 'localhost';
$username     = 'name';
$password     = 'password';
$databasename = 'database';


// Connect to database ..

if (!$connection_result = mysql_connect($hostname, $username, $password)) {
	die('Error Connecting to MySQL Database: ' . mysql_error());
}

if (!$db_result = mysql_select_db($databasename, $connection_result)) {
	die('Error Selecting the MySQL Database: ' . mysql_error());
}


// Retrieve parameters ..

if ($_SERVER['REQUEST_METHOD'] == "POST") {

	$itemId = $_POST['game'];
	$action = $_POST['action'];
	$url = $_POST['url'];
	
}
else {

	$itemId = $_GET['game'];
	$action = $_GET['action'];
	$url = $_GET['url'];
	
}


//  Write to the database ..

mysql_query("insert into stuff (action, game) values ('".db_escape($action)."','".db_escape($game)."')");

Redirect($url, false);
die();

function Redirect($url, $permanent = false) {
    header('Location: ' . $url, true, $permanent ? 301 : 302);
    exit();
}

?>

… and the html to drive it.

<html>
<body>

Space Cab <a href="eried.php?action=emulator&game=SpaceCab&url=https://felipemanga.github.io/ProjectABE/?hex=https://raw.githubusercontent.com/eried/ArduboyCollection/master/https%3A%2F%2Fraw.githubusercontent.com%2Fvampirics%2FSpaceCab%2Fmaster%2Fdistributable%2FSpaceCab.hex">emulator</a>
          <a href="eried.php?action=hex&game=SpaceCab&url=https://raw.githubusercontent.com/eried/ArduboyCollection/master/https%3A%2F%2Fraw.githubusercontent.com%2Fvampirics%2FSpaceCab%2Fmaster%2Fdistributable%2FSpaceCab.hex">hex</a>
          <a href="eried.php?action=upload&game=SpaceCab&url=arduboy:https://raw.githubusercontent.com/eried/ArduboyCollection/master/https%3A%2F%2Fraw.githubusercontent.com%2Fvampirics%2FSpaceCab%2Fmaster%2Fdistributable%2FSpaceCab.hex">upload</a>
<br/>          
Juno First <a href="eried.php?action=emulator&game=JunoFirst&url=https://felipemanga.github.io/ProjectABE/?hex=https://raw.githubusercontent.com/eried/ArduboyCollection/master/Action%2FJunoFirst%2FJunoFirst.V1.00.hex">emulator</a>          
           <a href="eried.php?action=hex&game=JunoFirst&url=https://raw.githubusercontent.com/eried/ArduboyCollection/master/Action%2FJunoFirst%2FJunoFirst.V1.00.hex">hex</a>
           <a href="eried.php?action=upload&game=JunoFirst&url=arduboy://raw.githubusercontent.com/eried/ArduboyCollection/master/Action%2FJunoFirst%2FJunoFirst.V1.00.hex">upload</a>
</body>
</html>

Try it here > http://bloggingadeadhorse.com/eried.html


(Erwin) #78

Yeah, might be. Can you quickly add arduboy:<the url> (no http://) to test :open_mouth: ?


(Simon) #79

I have changed the HTML file to have the first link point to “arduboy:https://raw.githubusercontent.com/eried/Ardub…” and the second to point to “arduboy://raw.githubusercontent.com/eried/Ardub…”

Your site actually has the https:// in the url so I added one with and without it.

I have a Mac so cannot test it.


(Erwin) #80

It works! I think I am going to use your code for the popularity ranking. Thanks!


Does anyone has any argument against redirected links?