Help in a code only experts know this

Started on the old forum in February 2012 · view the original in the archive · old links redirect here

#separate #separateb

4 replies · 406 views · started 14 years ago · 1 min read

3 participants
Lue_chin Developer · 107 posts #1

good morning experts i need your help i want to create a grraber of a site so i want to make my grraber coding like this 1. in page the all files in file info..... this tag so after every file so i want to pick all tag and set according to my css so any one please help me to post a code to create its graaber

in hindi ek page hai jis me page info and img and download link hai nam ke sare tags ko pick kar ke apne according kar sakkkun

something else Fellow · 2,296 posts #2

isnt it easier just to change the css ?

.file {
height = 90px; 
}

if answer is no just do a simple string replacement on the

softwarefreak Senior · 349 posts #3

Try this 😀

$match = preg_match('/<div class="file">(.*)<\/div>/i', $file, $matches);
if($match)
{
print_r($matches);
}

Added after 3 minutes:

lol,just saw the title of the thread, "only experts", sorry I'm noob

I need some facebook likes, can you please help me 🤝 http://facebook.com/softwarefreakin I noticed social media is really powerful 🧙 Well DONE is better than well SAID

Lue_chin Developer · 107 posts #4

Not working bro i explain it

<div class="file">
<img src="prev.php?id=22651" alt="thumb" /><br /><a href="Download.php?id=22651">video 651</a> 8.38 MB
</div>
<div class="file">
<img src="prev.php?id=22651" alt="thumb" /><br /><a href="Download.php?id=22651">video 651</a> 8.38 MB
</div>
<div class="file">
<img src="prev.php?id=22651" alt="thumb" /><br /><a href="Download.php?id=22651">video 651</a> 8.38 MB
</div>

this type 5 files in a page so i want that no any another line is preview i want that i paste code External image (may be gone) $name Download now!! so i paste this code just one time and its graab all the files which is in the page under tag please help me

softwarefreak Senior · 349 posts #5

hi, try this

<?php
$file = '<div class="file">
<img src="prev.php?id=22651" alt="thumb" /><br /><a href="Download.php?id=22651">video 651</a> 8.38 MB
</div>
<div class="file">
<img src="prev.php?id=22651" alt="thumb" /><br /><a href="Download.php?id=22651">video 651</a> 8.38 MB
</div>
<div class="file">
<img src="prev.php?id=22651" alt="thumb" /><br /><a href="Download.php?id=22651">video 651</a> 8.38 MB
</div>';
$chunk = explode('<div class="file">', $file);
//print_r($chunk);
$count = count($chunk);
for ($i=1; $i < $count; $i++) 
{
	$match_name = preg_match('/">(.*)<\/a>/i', $chunk[$i], $w);
	$match_thumb = preg_match('/<img src="(.*)" alt="/i', $chunk[$i], $x);
	$match_link = preg_match('/<a href="(.*)">/i', $chunk[$i], $y);
$match_size = preg_match('/<\/a>(.*\n)<\/div>/i', $chunk[$i], $z);

echo "<div class='my_css'>Filename:$w[1]<br />
filesize:".trim($z[1])."<br />
Download link: $y[1]<br />
preview: $x[1]</div>";
}
?>

I need some facebook likes, can you please help me 🤝 http://facebook.com/softwarefreakin I noticed social media is really powerful 🧙 Well DONE is better than well SAID

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