waptrick music search

Started on the old forum in April 2013 · view the original in the archive · old links redirect here

5 replies · 1,428 views · started 13 years ago · 1 min read

2 participants
s3nzo Developer · 156 posts #1

Here's a waptrick/zamob music search script. I'm sure someone can make it better, please share back on upgrades/improvements MP3 search

<?php
if(isset($_GET['buffer'])){
	header('Content-Type:file; application/octet-stream; application/force-download');
	header('Content-Disposition:attachment; filename='.basename($_GET['buffer']));
	readfile('http://zamob.com/load-file'.$_GET['buffer']);
}
$page	= isset($_GET['pageid']) ? abs((int)$_GET['pageid']) : 1;
echo	<<<HEAD
<!DOCTYPE html>
<html>
<head><title>MP3 search</title>
<style type="text/css">
body{
	color:#FFF;
	background:#000;
	margin:auto;
}
#logo{
	background:#030;
	text-align:left;
	padding:5px;
}
a{
	color:#FFFF00;
	text-decoration:none;
	font-weight:bold;
}
</style>
</head><body><div id="logo"><img src="{$_SERVER['HTTP_HOST']}" /></div>
<form action="?c" method="get">

Keyword: <br/><input class="search_sect" type="text" name="c" value=""/>

<input type="hidden" name="check" value="0"/>  

<input class="submit"  type="submit" value="Search" />      
</form>
HEAD;

if(isset($_GET['c'])){
	$url	= 'http://zamob.com/_common/search/search.jsp';
	$ch	= curl_init();
	curl_setopt($ch, CURLOPT_URL, $url.'?c='.urlencode($_GET['c']).'&check=0&type=full_mp3&pageid='.$page);
	curl_setopt($ch, CURLOPT_USERAGENT, 'BlackBerry');
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	$data	= curl_exec($ch);
	curl_close($ch);
	
	preg_match_all('/\/download\/(.*)">(.*)<\/a>/i', $data, $matches);
	if(count($matches[1])){
		for($x = 0; count($matches[1]) > $x; $x++) printf("<div>- <a href=\"?copy=%s\">%s</a></div>\n", $matches[1][$x], $matches[2][$x]);
	}else echo	'<br /><div style="color:#F00;font-weight:bold;">No results found for your search</div>';
	
	preg_match_all('/" title="(.*)"/i', $data, $matches);
	if(count($matches[1])){
		echo	'<div style="background:#202020;padding:5px;">';
		for($x = 1; count($matches[1]) > $x; $x++){
			$s	= preg_replace('/&pageid=([0-9]+)/i', '', $_SERVER['QUERY_STRING']);
			printf("<a href=\"?%s&pageid=%d\">%d</a> ", $s, $matches[1][$x], $matches[1][$x]);
		}echo	'</div>';
	}
}

else if(isset($_GET['copy'])){
	$url	= 'http://zamob.com/download/'.str_replace('copy=', '', $_SERVER['QUERY_STRING']);
	$ch		= curl_init();
	curl_setopt($ch, CURLOPT_URL, $url);
	curl_setopt($ch, CURLOPT_USERAGENT, 'BlackBerry');
	curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
	$data	= curl_exec($ch);
	curl_close($ch);
	preg_match_all('/load-file(.*)">(.*)<\/a>/i', $data, $matches);
	if(count($matches[1])){
		for($x = 0; count($matches[1]) > $x; $x++) printf("<div><a href=\"?buffer=%s\">%s</a></div>\n", $matches[1][$x], $matches[2][$x]);
	}
}

echo	<<<FOOT
</body>
</html>
FOOT;
?>
brentg Developer · 95 posts #2

Parse error: syntax error, unexpected T_STRING in /home//public_html/34.php on line 7

$page    = isset($_GET['pageid']) ? abs((int)$_GET['pageid']) : 1)

Getting this error

Free Mobile Downloads: http://playwap.mobi

brentg Developer · 95 posts #3

Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home//public_html/asd.php on line 40

This is what is on line 40

Line40: else if(isset($_GET['c'])){ { $url = 'http://zamob.com/_common/search/search.jsp'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url.'?c='.urlencode($_GET['c']).'&check=0&type=full_mp3&pageid='.$page); curl_setopt($ch, CURLOPT_USERAGENT, 'BlackBerry'); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $data = curl_exec($ch); curl_close($ch);

preg_match_all('/\/download\/(.*)">(.*)<\/a>/i', $data, $matches);
if(count($matches[1])){
    for($x = 0; count($matches[1]) > $x; $x++) printf("- <a href=\"?copy=%s\">%s</a>\n", $matches[1][$x], $matches[2][$x]);
}else echo    '

No results found for your search';

preg_match_all('/" title="(.*)"/i', $data, $matches);
if(count($matches[1])){
    echo    '';
    for($x = 1; count($matches[1]) > $x; $x++){
        $s    = preg_replace('/&pageid=([0-9]+)/i', '', $_SERVER['QUERY_STRING']);
        printf("<a href=\"?%s&amp;pageid=%d\">%d</a> ", $s, $matches[1][$x], $matches[1][$x]);
    }echo    '';
}

Free Mobile Downloads: http://playwap.mobi

s3nzo Developer · 156 posts #4

brentg wrote: Parse error: syntax error, unexpected T_STRING in /home//public_html/34.php on line 7

$page    = isset($_GET['pageid']) ? abs((int)$_GET['pageid']) : 1)

Getting this error

In my script that line isn't ended with a brace

Added after 2 minutes:

brentg wrote: Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING in /home//public_html/asd.php on line 40

This is what is on line 40

It's working on my server, both PHP 5.2 and 5.4 check whatever you edited

brentg Developer · 95 posts #6

How can we include artist and genres instead of the just the search?

Free Mobile Downloads: http://playwap.mobi

Write your reply now; next you create a free account (or sign in) and it is posted right away. Sign in to reply.

Similar topics

Keyboard shortcuts

g f
Go to forums
g h
Go to your feed
g m
Go to messages
r
Reply (in a topic)
/
Search
j
Next post
k
Previous post
?
This list
Ctrl/⌘ + Enter
Send what you are writing
Ctrl/⌘ + B / I
Bold / italic while writing
Esc
Close