Php link exporter

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

User avatar
iankent
Forum Contributor
Posts: 333
Joined: Mon Nov 16, 2009 4:23 pm
Location: Wales, United Kingdom

Re: Php link exporter

Post by iankent »

The_L wrote:Nope,does not list anything...:/
First i added and replaced all you commented...and nope nothing listed...
And then i just copyed your code from here and again...nothing...
strange, could you post the full code (the whole page) again please, not just the search bit
The_L
Forum Commoner
Posts: 64
Joined: Sun Nov 22, 2009 6:53 pm

Re: Php link exporter

Post by The_L »

Taggrab.rar
Keep in mind that i added some of my code...simply erase it if it bothers you...
So the code starts at 68 line :P
User avatar
iankent
Forum Contributor
Posts: 333
Joined: Mon Nov 16, 2009 4:23 pm
Location: Wales, United Kingdom

Re: Php link exporter

Post by iankent »

Try adding a print_r at this bit to see whats coming back from parse_array():

Code: Select all

// Enter the tags into the parse array function
$linkarray = $tspider->parse_array();
print_r($linkarray);
The_L
Forum Commoner
Posts: 64
Joined: Sun Nov 22, 2009 6:53 pm

Re: Php link exporter

Post by The_L »

Code: Select all

Array ( [0] => http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd" [1] => http://www.w3.org/1999/xhtml" [2] => http://forum-racunara.com/forum/Themes/ ... ipt.js?rc1" [3] => http://forum-racunara.com/forum/Themes/ ... eme.js?rc1" [4] => http://www.forum-racunara.com/forum/Themes/elit_2"; [5] => http://forum-racunara.com/forum/Themes/default"; [6] => http://www.forum-racunara.com/forum/The ... t_2/images"; [7] => http://forum-racunara.com/forum/index.p ... aa996ce7a&"; [8] => http://www.forum-racunara.com/forum/The ... le.css?rc1" [9] => http://forum-racunara.com/forum/Themes/ ... nt.css?rc1" [10] => http://www.forum-racunara.com/forum/The ... t_2/png.js" [11] => http://forum-racunara.com/forum/index.p ... ction=help" [12] => http://forum-racunara.com/forum/index.p ... ion=search" [13] => http://forum-racunara.com/forum/index.p ... aa996ce7a&" [14] => http://forum-racunara.com/forum/index.p ... ction=.xml" [15] => http://forum-racunara.com/forum/index.p ... _next=prev" [16] => http://forum-racunara.com/forum/index.p ... _next=next" [17] => http://forum-racunara.com/forum/index.p ... &board=7.0" [18] => http://www.forum-racunara.com/forum/The ... /index.css" [19] => http://forum-racunara.com/forum/Themes/ ... /forum.css" [20] => http://www.forum-racunara.com/forum/The ... ootools.js" [21] => http://www.forum-racunara.com/forum/The ... _2/menu.js" [22] => http://www.forum-racunara.com/forum/The ... _2/main.js" [23] => http://forum-racunara.com/forum/Themes/default/sha1.js" [24] => http://forum-racunara.com/forum/index.p ... ion=login2" [25] => http://forum-racunara.com/forum/index.p ... tion=login" [26] => http://forum-racunara.com/forum/index.p ... n=register" [27] => http://www.forum-racunara.com/forum/The ... o/logo.png" [28] => http://forum-racunara.com/forum/index.p ... aa996ce7a&" [29] => http://forum-racunara.com/forum/index.p ... ction=help" [30] => http://forum-racunara.com/forum/index.p ... ion=search" [31] => http://forum-racunara.com/forum/index.p ... tion=login" [32] => http://forum-racunara.com/forum/index.p ... n=register" [33] => http://forum-racunara.com/meny.swf" [34] => http://forum-racunara.com/forum/index.p ... aa996ce7a&" [35] => http://forum-racunara.com/forum/index.p ... 96ce7a&#c3" [36] => http://forum-racunara.com/forum/index.p ... board=42.0" [37] => http://forum-racunara.com/forum/index.p ... &board=7.0" [38] => http://forum-racunara.com/forum/index.p ... opic=673.0" [39] => http://www.fr-grow-up.tk/ [40] => http://forum-racunara.com/forum/index.p ... t=prev#new" [41] => http://forum-racunara.com/forum/index.p ... t=next#new" [42] => http://forum-racunara.com/forum/index.p ... opic=673.0" [43] => http://www.forum-racunara.com/forum/The ... l_post.gif" [44] => http://forum-racunara.com/forum/index.p ... opic=673.0" [45] => http://forum-racunara.com/forum/index.p ... rofile;u=3" [46] => http://www.forum-racunara.com/forum/The ... /admin.png" [47] => http://www.forum-racunara.com/forum/The ... seroff.gif" [48] => http://www.forum-racunara.com/forum/The ... s/Male.gif" [49] => http://forum-racunara.com/forum/index.p ... ype=avatar" [50] => http://www.forum-racunara.com/" [51] => http://www.forum-racunara.com/forum/The ... www_sm.gif" [52] => http://www.forum-racunara.com/forum/The ... ost/xx.gif" [53] => http://forum-racunara.com/forum/index.p ... 53#msg2153" [54] => http://i40.tinypic.com/4fvmyv.jpg" [55] => http://c2.api.ning.com/files/oPQkRsdwKc ... aim_02.jpg" [56] => http://content.playwhat.com/files/491/9dragons_6.jpg" [57] => http://img.qj.net/uploads/articles_modu ... viewth.jpg" [58] => http://img.qj.net/uploads/articles_modu ... viewth.jpg" [59] => http://www.gameogre.com/9dragons2.jpg" [60] => http://img.qj.net/uploads/articles_modu ... viewth.jpg" [61] => http://forum-racunara.com/forum/Themes/ ... /down1.gif" [62] => http://forum-racunara.com/forum/Themes/ ... /down2.gif" [63] => http://forum-racunara.com/forum/Themes/ ... /down3.gif" [64] => http://rapidshare.com/files/177751243/9 ... 1.rar.html" [65] => http://rapidshare.com/files/177751587/9 ... 2.rar.html" [66] => http://rapidshare.com/files/177751799/9 ... 3.rar.html" [67] => http://rapidshare.com/files/177752097/9 ... 4.rar.html" [68] => http://rapidshare.com/files/177752094/9 ... 5.rar.html" [69] => http://rapidshare.com/files/177752096/9 ... 6.rar.html" [70] => http://rapidshare.com/files/177752356/9 ... 7.rar.html" [71] => http://rapidshare.com/files/177752811/9 ... 8.rar.html" [72] => http://rapidshare.com/files/177752919/9 ... 9.rar.html" [73] => http://forum-racunara.com/forum/Themes/ ... /down4.gif" [74] => http://forum-racunara.com/forum/Themes/ ... /space.gif" [75] => sharedownload.org [76] => http://forum-racunara.com/forum/Themes/ ... /space.gif" [77] => http://forum-racunara.com/forum/Themes/ ... /down5.gif" [78] => http://forum-racunara.com/forum/Themes/ ... /space.gif" [79] => http://www.forum-racunara.com/forum/The ... ges/ip.gif" [80] => http://forum-racunara.com/stuff/xD.swf" [81] => http://forum-racunara.com/stuff/xD.swf" [82] => http://forum-racunara.com/stuff/slicice/sign.png" [83] => http://forum-racunara.com/stuff/slicice/1.jpg" [84] => http://forum-racunara.com/stuff/slicice/2.jpg" [85] => http://forum-racunara.com/stuff/slicice/3.jpg" [86] => http://forum-racunara.com/forum/index.p ... file;u=132" [87] => http://www.forum-racunara.com/forum/The ... rbars/Clan [88] => http://www.forum-racunara.com/forum/The ... seroff.gif" [89] => http://www.forum-racunara.com/forum/The ... s/Male.gif" [90] => http://forum-racunara.com/forum/index.p ... ype=avatar" [91] => http://www.forum-racunara.com/forum/The ... ost/xx.gif" [92] => http://forum-racunara.com/forum/index.p ... 93#msg3293" [93] => http://forum-racunara.com/forum/Smileys/default/huh.gif" [94] => http://www.forum-racunara.com/forum/The ... ges/ip.gif" [95] => http://img13.imageshack.us/img13/2503/skullsig.png" [96] => http://forum-racunara.com/forum/index.p ... rofile;u=3" [97] => http://www.forum-racunara.com/forum/The ... /admin.png" [98] => http://www.forum-racunara.com/forum/The ... seroff.gif" [99] => http://www.forum-racunara.com/forum/The ... s/Male.gif" [100] => http://forum-racunara.com/forum/index.p ... ype=avatar" [101] => http://www.forum-racunara.com/" [102] => http://www.forum-racunara.com/forum/The ... www_sm.gif" [103] => http://www.forum-racunara.com/forum/The ... ost/xx.gif" [104] => http://forum-racunara.com/forum/index.p ... 94#msg3294" [105] => http://www.forum-racunara.com/forum/The ... ges/ip.gif" [106] => http://forum-racunara.com/stuff/xD.swf" [107] => http://forum-racunara.com/stuff/xD.swf" [108] => http://forum-racunara.com/stuff/slicice/sign.png" [109] => http://forum-racunara.com/stuff/slicice/1.jpg" [110] => http://forum-racunara.com/stuff/slicice/2.jpg" [111] => http://forum-racunara.com/stuff/slicice/3.jpg" [112] => http://forum-racunara.com/forum/index.p ... file;u=132" [113] => http://www.forum-racunara.com/forum/The ... rbars/Clan [114] => http://www.forum-racunara.com/forum/The ... seroff.gif" [115] => http://www.forum-racunara.com/forum/The ... s/Male.gif" [116] => http://forum-racunara.com/forum/index.p ... ype=avatar" [117] => http://www.forum-racunara.com/forum/The ... ost/xx.gif" [118] => http://forum-racunara.com/forum/index.p ... 75#msg3375" [119] => http://forum-racunara.com/forum/Smileys/default/cry.gif" [120] => http://forum-racunara.com/forum/Smileys ... /angry.gif" [121] => http://www.forum-racunara.com/forum/The ... ges/ip.gif" [122] => http://img13.imageshack.us/img13/2503/skullsig.png" [123] => http://forum-racunara.com/forum/index.p ... opic=673.0" [124] => http://forum-racunara.com/forum/index.p ... t=prev#new" [125] => http://forum-racunara.com/forum/index.p ... t=next#new" [126] => http://forum-racunara.com/forum/Themes/ ... l_topic.js" [127] => http://forum-racunara.com/forum/index.php' [128] => http://forum-racunara.com/forum/index.p ... a996ce7a&' [129] => http://forum-racunara.com/forum/index.p ... aa996ce7a&" [130] => http://www.smfyoo.com [131] => http://www.forum-racunara.com/forum/The ... am/yoo.png" [132] => http://www.smfgrup.com [133] => http://www.forum-racunara.com/forum/The ... am/grp.png" [134] => http://www.smftema.com [135] => http://www.forum-racunara.com/forum/The ... m/tema.png" [136] => http://www.smfgrup.com [137] => http://www.forum-racunara.com/forum/The ... am/sgt.png" [138] => http://www.simplemachines.org/" [139] => http://www.simplemachines.org/about/copyright.php" [140] => http://www.smftema.com [141] => http://www.smfgrup.com )
So it lists them...:?
User avatar
iankent
Forum Contributor
Posts: 333
Joined: Mon Nov 16, 2009 4:23 pm
Location: Wales, United Kingdom

Re: Php link exporter

Post by iankent »

well thats a good start :)

remove that line and change the search array - remove the .'s before the domain name, thats probably causing it because the rapidshare domains are all http://rapidshare.com/. I thought you'd already removed them at some point?
The_L
Forum Commoner
Posts: 64
Joined: Sun Nov 22, 2009 6:53 pm

Re: Php link exporter

Post by The_L »

Hmm this is strange...
It gets all links perfectly from this page but not from this one...both has rapidshare links...:/
User avatar
iankent
Forum Contributor
Posts: 333
Joined: Mon Nov 16, 2009 4:23 pm
Location: Wales, United Kingdom

Re: Php link exporter

Post by iankent »

try using the print_r on the result of parse_array and run it against both URLs. manually check that both sets of results include rapidshare.com. let me know what you get!
The_L
Forum Commoner
Posts: 64
Joined: Sun Nov 22, 2009 6:53 pm

Re: Php link exporter

Post by The_L »

O.o
This is s t r a n g e...
This page works just fine...and it prints all rapidshare.com links:
But when it comes to this page it doesnot link any rapidshare links. The pages are SAME..(just text is different) also this page doesnot export any rapidshare links :/

These are the parts of source code from these 3 pages:
This one works very well...

Code: Select all

<a href="http://rapidshare.com/files/177751587/9Dragons_EPIDEM.RU.part02.rar.html" class="bbc_link new_win" target="_blank">9Dragons 2. deo</a><br />
This one no...:/

Code: Select all

<a href="http://rapidshare.com/files/123784394/CSS_full_v17.1_Velocity.part01.rar" class="bbc_link new_win" target="_blank">Counter Strike: Source 1. deo</a><br /
As i see the only difference is that first one is .rar.html and other one .rar :/
User avatar
iankent
Forum Contributor
Posts: 333
Joined: Mon Nov 16, 2009 4:23 pm
Location: Wales, United Kingdom

Re: Php link exporter

Post by iankent »

The_L wrote:O.o
This is s t r a n g e...
This page works just fine...and it prints all rapidshare.com links:
But when it comes to this page it doesnot link any rapidshare links. The pages are SAME..(just text is different) also this page doesnot export any rapidshare links :/

These are the parts of source code from these 3 pages:
This one works very well...

Code: Select all

<a href="http://rapidshare.com/files/177751587/9Dragons_EPIDEM.RU.part02.rar.html" class="bbc_link new_win" target="_blank">9Dragons 2. deo</a><br />
This one no...:/

Code: Select all

<a href="http://rapidshare.com/files/123784394/CSS_full_v17.1_Velocity.part01.rar" class="bbc_link new_win" target="_blank">Counter Strike: Source 1. deo</a><br /
As i see the only difference is that first one is .rar.html and other one .rar :/
the file extension shouldn't make a difference, but chances are its a regex problem! the rest of the code seems to be working, its just the regex isn't returning some links for some reason (possibly due to the .rar bit, i'm not sure).

i'm no regex expert so if its not working i'm not sure what to suggest - you could post a question in the regex forum to see if anyone has any ideas?
The_L
Forum Commoner
Posts: 64
Joined: Sun Nov 22, 2009 6:53 pm

Re: Php link exporter

Post by The_L »

Yep that is about it...this page is working too..it has .rar.html url...

So what now?? :/
User avatar
iankent
Forum Contributor
Posts: 333
Joined: Mon Nov 16, 2009 4:23 pm
Location: Wales, United Kingdom

Re: Php link exporter

Post by iankent »

The_L wrote:So what now?? :/
As I said, for some reason the regex is ignoring those links. I'm no regex expert so you'll need to ask in the regex forum. You could also try replacing the existing $regex (the one from status.net) with the one that phpBB uses, it might pick up the extra links.
The_L
Forum Commoner
Posts: 64
Joined: Sun Nov 22, 2009 6:53 pm

Re: Php link exporter

Post by The_L »

Witch forum?
And where to get phpBB regex??
User avatar
iankent
Forum Contributor
Posts: 333
Joined: Mon Nov 16, 2009 4:23 pm
Location: Wales, United Kingdom

Re: Php link exporter

Post by iankent »

This forum: viewforum.php?f=38
You may find some useful stuff in one of the topics near the top!

And you can get the phpBB source code from http://www.phpbb.com/downloads/olympus.php. Having just had a quick look (the code is in functions_content.php around line 650), its actually pretty horrible code and may be way over the top for what you want. Asking in the regex forum will probably be the better choice :)
Post Reply