Jump to content

phpBB bot

- - - - -

  • Please log in to reply
1 reply to this topic

#1
Hajjel

Hajjel

    Newbie

  • Members
  • PipPip
  • 22 posts
I'm working with a bot to a phpBB forum. ATM my bot can login, reply in threads and create treads. Now I want my bot to go to a thread and analyse the source to save data I want to save. We this as an exmaple:
I have a thread. In this thread people are repporting their first and lastname like this:
firstname:Martin;
lastname:Martinson;

In the source the post will look like this:
<div class="postbody">firstname:Martin;<br />lastname:Martinson;</div>

In the source we can also find total pages and total posts, so we don't need to count that.

[TABLE]
[TR]
[TD="class: webkit-line-content"]<td class="nav" valign="middle" nowrap="nowrap"> Page <strong>1</strong> of <strong>2</strong><br /></td>[/TD]
[/TR]
[TR]
[TD="class: webkit-line-number"][/TD]
[TD="class: webkit-line-content"]            <td class="gensmall" nowrap="nowrap"> [ 11 posts ] </td>[/TD]
[/TR]
[/TABLE]


I can just get posts and pages by using preg_match.

So to my problem... for each class="postbody" I'd like to save firstname and lastname in a variable. Then, when my bot is finish with that page, it move to the next page a do the same thing...

#2
BlackRook

BlackRook

    Newbie

  • Members
  • Pip
  • 2 posts
Could you not use a foreach loop for every post in the thread or page in the thread using your preg_match function?




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users