Hi, I'm trying to write a script which will fetch emails from vbulletin forums. In general, the script has to go through the forums, then go through the topics and scrape the emails address from all the topic's pages which match the following regex: [^\@]+\@[^a-z0-9\-]+\.[\.a-z]+ ** The vbulletin forum does NOT require to be logged in in order to view the forums/topics/comments/etc *** Any help would be highly appreciated (I'm using PHP of course!!!)
glad I don't use vbulletin my visitors would hate me if they got blasted with emails from 3rd parties. I assume you mean your own vbulletins?
Each forum has its own url rewrite method, so first of all you need to find out how its url rewrite works and archive url. Then use for() and file_get_contents() to get content of each thread. You need to use for() twice to go to each thread and to each page in thread. For example with digitalpoint, the archive url is: $url="http://forums.digitalpoint.com/archive/index.php/t-".$i.".html"; Now you use for($i=0;$i<=$n;$i++) {...} to rotate i from 0 to "n" (the number of the latest thread today). And use $content = file_get_content($url) to take out the content of the thread. Now you know what to do next.
I'm talking about my own vbulletin of course, I have a couple of forums in which people reply with their email so that others would be able to email them. I would like to attach each of these emails to it's respective owner so that it would be listed in their user profile. inanobot - some more code would be highly appreciated but thank you for your reply!!
I'm not a vbulletin expert and it would be much more simple to fetch the information directly from the forum's pages!
If you own the vbb, its very easy <?php $q = mysql_query("SELECT `pagetext` FROM `post`"); while($r=mysql_fetch_array($q)) { $text=explode(" ",$r['pagetext']); foreach($text AS $text) { if(eregi("[^\@]+\@[^a-z0-9\-]+\.[\.a-z]+",$text)) { echo $text."<br/>"; } } } ?> PHP: