Scrape Emails From Vbulletin Forums

Discussion in 'PHP' started by nitsanbn, Nov 27, 2009.

  1. #1
    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!!!)

    :)
     
    nitsanbn, Nov 27, 2009 IP
  2. donluttrull

    donluttrull Peon

    Messages:
    359
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    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?
     
    donluttrull, Nov 27, 2009 IP
  3. inanobot

    inanobot Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    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.
     
    Last edited: Nov 27, 2009
    inanobot, Nov 27, 2009 IP
  4. nitsanbn

    nitsanbn Active Member

    Messages:
    382
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #4
    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!!
     
    nitsanbn, Nov 28, 2009 IP
  5. chandan123

    chandan123 Prominent Member

    Messages:
    11,586
    Likes Received:
    578
    Best Answers:
    0
    Trophy Points:
    360
    #5
    can't u use db lookup for such users in your forums db
     
    chandan123, Nov 28, 2009 IP
  6. nitsanbn

    nitsanbn Active Member

    Messages:
    382
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #6
    I'm not a vbulletin expert and it would be much more simple to fetch the information directly from the forum's pages!
    :(
     
    nitsanbn, Nov 28, 2009 IP
  7. inanobot

    inanobot Peon

    Messages:
    46
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    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:
     
    inanobot, Nov 28, 2009 IP