Suche Einbinden

riedlchamp

Mitglied
Hallo,

Wurde gerade von einem HTML Forum hier her gesichkt. Hoffe ich hin richtig.

Und zwar Würde ich gerne von einer anderen Hompage eine suche auf meiner seite einbauen.

Bei mir soll da nur das suche feld sein und daneben das ergebniss.
Es soll machbar sein aber ich weiß leider nicht wie.

Und zwar ginge es um diese suche.

GGC-Stream / GUID Search
Das wäre die suche. Die geht anscheinen aber nicht da ich die API nicht habe.

Hier wäre die Liste wo ich die suche brauchen würde. Es werden aber leider immer nur ein paar angezeigt dursucht sollen alle ca 90.000 werden.
GGC-Stream / Banlist details / Call of Duty 4



Per Iframe geht es nicht da ich ja nicht ihre seite haben Will.
Ich habe den admin schon gefrat ob ich es einbinden darf. Es sei kein problem nur ein werbe banner muss darunter aber das ist ja kein Problem.

Hoffe das ist irgenwie möglich würde mir sehr viel helfen. Danke jetzt schon mal allen die versuchen mir zu helfen :applaus:

Lg Philipp
 

eRaaaa

Top Contributor
GGC-Stream / GUID Search
Das wäre die suche. Die geht anscheinen aber nicht da ich die API nicht habe.
Wäre aber deutlich einfacher und schöner!

Ich habe den admin schon gefrat ob ich es einbinden darf. Es sei kein problem nur ein werbe banner muss darunter aber das ist ja kein Problem.
Schon mal nicht schlecht, aber wieso stellt er dir dann nicht ne API/Schnittstelle? :)

Hoffe das ist irgenwie möglich würde mir sehr viel helfen. Danke jetzt schon mal allen die versuchen mir zu helfen :applaus:

Möglich ist das irgendwie, die Frage wäre aber auch, was für Informationen du benötigst aus dem Suchergebnis?

Und ein paar mehr Infos zu deiner Seite braucht man auch, ist da nur ein billiger Webspace, ein Server oder was hast du da bisher?
ich befürchte das wird hier ein langer Thread werden :)
 

riedlchamp

Mitglied
Hi.

Ich möchte die durch die eingabe der GUID Nummer volgedes erhalten


23.07.12 13:02
a397f21630053a2a6f5dac76fcc9a29a
DiESEL78.1.*.*
MD5TOOL #9002

Es würde reichen wen da steht ob sie sie wirklich gibt. Wen ja Name Datum Und die letzte Spalte sprich warum er da drinne steht.

Meine Hompage ist Ein Server keine free version :)
Ich dachte mir auch das das mit dem API leichter wäre aber es hiese es geht auch so :=)

Hoffe die info reicht dir.

Lg
 
Zuletzt bearbeitet:

riedlchamp

Mitglied
<?php
// ************************************
// Name: banlist_export.txt
// Version: 1.0.0
// Date: 2011-07-21
// ************************************

// Enter the game handle:
$game = 'bfp4f';

// Enter the output format (json / xml / text):
// Info: For large banlists (e.g. bf2) you should use the text format due to memory limitations
$format = 'json';

// Enter your given API ID:
$apiId = 123456;

// Enter your given API Key:
$apiKey = '';


// ************************************
// * DON'T CHANGE THE FOLLOWING LINES *
// * IF YOU DON'T KNOW WHAT YOU DO *
// ************************************
// create an unique ID
$uniqueId = uniqid();

// create key (example of result: 123456_883d3cfe271401436f31891108ca7d12e44ad5ce_4e25cb77c99ce)
$key = $apiId.'_'.sha1($apiKey.$uniqueId).'_'.$uniqueId;

// convert ip to datatype "long"
$serverIp = ip2long($serverIp);

// use CURL to get the content
$url = "http://api.ggc-stream.com/banlist/export/index/game/{$game}/format/{$format}/key/{$key}";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
$outputRaw = curl_exec($ch);
curl_close($ch);

// switch for the right format
switch($format)
{
case 'json':
header('Content-type: application/json');
$output = json_decode($outputRaw, true);

// check for errors
if(!is_array($output))
{
echo $outputRaw;
die();
}

echo json_encode($output);
break;

case 'text':
header('Content-type: text/plain');
echo $outputRaw;
break;

case 'xml':
header('Content-type: text/xml');
echo $outputRaw;
break;
}

?>
 

Evil-Devil

Top Contributor
Naja, das Script holt wenn ich das richtig verstehe die vollständige Bann-Liste für jenes angegebene Spiel.
Ist das wonach du suchen willst? Oder willst du die Bann-Liste durchsuchen?

//edit: Interessant wäre die Frage wo im Skript die ID des Benutzer hin kommt. Nach meinem Verständnis wäre das die uniqueID.

Das als Formular zu verpacken ist kein Problem, nur du wirst imho nicht alle 90k Einträge auf einmal zurückgeliefert bekommen sofern es dafür keine explizite Abfrage gibt.
 
Zuletzt bearbeitet:

riedlchamp

Mitglied
Hallo,

Will das immer jr das angegeben spiel dursuchen im dem fall steht noch das falsche drinnen aber das soll ja nicht das problem werden :)


ja genau ich will mit der GUID nummer das archive dursuchen.

Habe auch noch eine 2te API evtl geht es mit der besser

<?php
// ************************************
// Name: guid.txt
// Version: 1.0.1
// Date: 2012-07-16
// ************************************

// Enter the game handle:
$game = 'bf3';

// Enter the full guid (32 chars):
$guid = '1234567890123456789012345678901';

// Enter the output format (xml / json / text):
$format = 'xml';

// Enter your given API ID:
$apiId = 123456;

// Enter your given API Key:
$apiKey = '';


// ************************************
// * DON'T CHANGE THE FOLLOWING LINES *
// * IF YOU DON'T KNOW WHAT YOU DO *
// ************************************
// create an unique ID
$uniqueId = uniqid();

// create key (example of result: 123456_883d3cfe271401436f31891108ca7d12e44ad5ce_4e25cb77c99ce)
$key = $apiId.'_'.sha1($apiKey.$uniqueId).'_'.$uniqueId;

// use CURL to get the content
$url = "http://api.ggc-stream.com/banlist/search/guid/game/{$game}/gid/{$guid}/format/{$format}/key/{$key}";
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
$outputRaw = curl_exec($ch);
curl_close($ch);

// switch for the right format
switch($format)
{
case 'json':
header('Content-type: application/json');
$output = json_decode($outputRaw, true);

// check for errors
if(!is_array($output))
{
echo $outputRaw;
die();
}

echo json_encode($output);
break;

case 'text':
header('Content-type: text/plain');
echo $outputRaw;
break;

case 'xml':
header('Content-type: text/xml');
echo $outputRaw;
break;
}


?>



Hoffe dir hilft das.

Danke Dir

Lg Philipp
 

Evil-Devil

Top Contributor
Ok, das zweite Skript wird dir für die jeweilige GUID die Daten zurückliefern.

Kannst du denn PHP bzw. HTML um ein Formular auf deiner Seite einzubinden?

Und hat dein Webspace cURL im PhP aktiv? (ist meine ich Standard)
 

riedlchamp

Mitglied
Ein bisschen kenne ich mich aus allso nur ein wenig.

Was ich nun mit dem Api anfagen soll weiß ich nicht wirklich :=)


Also cURL im PhP ist aktiv ja.

Lg
 

Evil-Devil

Top Contributor
Ungetestet...einfach mal ausprobieren und sonst schreiben. Kann ohne die API Schlüssel ja schlecht testen ;)

PHP:
<?php
// Enter the game handle:
$game = 'bf3';

// Enter the full guid (32 chars):
$guid = '1234567890123456789012345678901';

// Enter the output format (xml / json / text):
$format = 'xml';

// Enter your given API ID:
$apiId = 123456;

// Enter your given API Key:
$apiKey = '';

// ************************************
// * DON'T CHANGE THE FOLLOWING LINES *
// * IF YOU DON'T KNOW WHAT YOU DO *
// ************************************
// create an unique ID
$uniqueId = uniqid();

// create key (example of result: 123456_883d3cfe271401436f31891108ca7d12e44ad5ce_4e25cb77c99ce)
$key = $apiId.'_'.sha1($apiKey.$uniqueId).'_'.$uniqueId;

function queryGUID($game, $guid, $format, $key) {
	// use CURL to get the content
	$url = "http://api.ggc-stream.com/banlist/search/guid/game/{$game}/gid/{$guid}/format/{$format}/key/{$key}";
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
	$outputRaw = curl_exec($ch);
	curl_close($ch);
	return $outputRaw;
}

function queryBanlist($game, $format, $key) {
	// use CURL to get the content
	$url = "http://api.ggc-stream.com/banlist/export/index/game/{$game}/format/{$format}/key/{$key}";
	$ch = curl_init();
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
	curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10);
	$outputRaw = curl_exec($ch);
	curl_close($ch);
	return $outputRaw;
}

function outputData($outputRaw, $format) {
	switch($format) {
		case 'json': {
			//header('Content-type: application/json');
			$output = json_decode($outputRaw, true);

			// check for errors
			if(!is_array($output)) {
				echo $outputRaw;
				break;
			}


			echo json_encode($output);
			break;
		}
		case 'text': {
			//header('Content-type: text/plain');
			echo $outputRaw;
			break;
		}
		case 'xml': {
			//header('Content-type: text/xml');
			echo $outputRaw;
			break;
		}
	}
}


$output = null;

// banlist
if ($output == null && isset($_POST['banlist'])) {
	$output = queryBanlist($game, $format, $key)
}

// guid
if ($output == null && isset($_POST['search']) && isset($_POST['guid']) && trim($_POST['guid']) != '') {
	$guid = trim($_POST['guid']);
	$output = queryBanlist($game, $guid, $format, $key);
}

?>

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
	<title>Abfrage Test</title>
</head>
<body>
	<strong>GUID SUCHE:</strong><br />
	<form method="post" style="border: 1px solid #000000;">
		<label>GUID</label> <input type="text" name="guid" value="<?php echo $guid ?>" />
		<input type="submit" name="search" value="nach GUID suchen" />
	</form>
	<br /><br />
	<strong>BANLIST:</strong><br />
	<form method="post" style="border: 1px solid #000000;">
			<input type="submit" name="banlist" value="Banlist holen" />
	</form>
	<h1>Ausgabe</h1>
	<div>
	<?php if ($output !== null): ?>
	<?php outputData($output); ?>
	<?php endif; ?>
	</div>
</body>
</html>
 
Ähnliche Java Themen
  Titel Forum Antworten Datum
OnDemand Suche Ideen zu Verteilung von Updates Softwareentwicklung 7
M Pseudocode der Exponentiellen Suche Softwareentwicklung 0
S Suche: (Versionierungs)Tool für Klassenaustausch mit Kollegen, die auch an dem Projekt arbeiten Softwareentwicklung 5
J Suche noch eine Loesung fuer Kommunikation zwischen Webserver und ein Programm Softwareentwicklung 0
Gossi Ruby: Suche durch Datein Softwareentwicklung 4
M Rekursive Suche in einem Baum Softwareentwicklung 3
M Suche Task-Software (Groupware mit Anpassungsmöglichkeiten) Softwareentwicklung 3
M Suche das "optimale" Web-Framework... Softwareentwicklung 6
O [Suche] sinnvolle BadWord-Liste Softwareentwicklung 8
Quaxli Suche Tutorial für Jasper Report - speziell iReport Softwareentwicklung 8
K Suche freies UML Tool um aus .java dateien Diagramme zu. Softwareentwicklung 8
S binaere Suche Verstaendnisproblem Softwareentwicklung 3
G Suche Ajax Javascript library Softwareentwicklung 10
G Suche Programm für Masken Design für Pflichtenheft Softwareentwicklung 5
G Suche UML Aufgaben mit Lösungen zum Übem Softwareentwicklung 2
K Suche nach regulärem Ausdruck Softwareentwicklung 5
T Suche: Informationen über Online Ticketing Softwareentwicklung 4
T Suche A Star Java Beispielprogramm Softwareentwicklung 2
B Suche Latex-Editor Softwareentwicklung 15
M DE-Mail einbinden Softwareentwicklung 10
S Dynamisches Einbinden von Klassen Softwareentwicklung 3

Ähnliche Java Themen

Neue Themen


Oben