Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1037637
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T14:52:31+00:00 2026-05-16T14:52:31+00:00

I am used to post my ideas on one forum and started to worry

  • 0

I am used to post my ideas on one forum and started to worry that I will loose them if it gets closed. Do you know a good way to download entire (ideas of other guys are also nice!) phpBB3 forum to a database? Is there software already available, or I have to write it myself?

UPDATE1:

Well, I can write it myself – this is not that hard problem, isn’t it? I just don’t want to waste time on inventing bicycle.

UPDATE2:

There is an answer at SuperUser: How can I download an entire (active) phpbb forum?

But I preferred to make a Ruby script for backuping the forum. It is not a complete solution, but it is enough for me. And yes, it doesn’t violates any TOS if you are so worried.

require :rubygems
require :hpricot
require 'open-uri'
require :uri
require :cgi
#require 'sqlite3-ruby'

class PHPBB
  def initialize base_url
    @base_url = base_url
    @forums, @topics = Array.new(4) { {} }
    self.parse_main_page 'main', 'index.php'
    @forums.keys.each do |f|
      self.parse_forum "forum.#{f}", "viewforum.php?f=#{f}"
    end
    @topics.keys.each do |t|
      self.parse_topic "topic.#{t}", "viewtopic.php?t=#{t}"
    end
  end


  def read_file cached, remote
    local = "%s.%s.html" % [__FILE__, cached]
    if File.exists? local
      return IO.read local
    else # download and save
      puts "load #{remote}"
      File.new(local, "w+") << (content = open(@base_url + remote).read)
      return content
    end
  end


  def parse_main_page local, remote
    doc = Hpricot(self.read_file(local,remote))
    doc.search('ul.forums/li.row').each do |li|
      fa = li.search('a.forumtitle').first # forum anchor
      f = self.parse_anchor(fa)['f']
      @forums[f] = {
        forum_id: f,
        title: fa.inner_html,
        description: li.search('dl/dt').first.inner_html.split('<br />').last.strip
      }
      ua, pa = li.search('dd.lastpost/span/a') # user anchor, post anchor
      q = self.parse_anchor(pa)
      self.last_post f, q['p'] unless q.nil?
    end
  end

  def last_post f,p
    @last_post = {forum_id: f, post_id: p} if @last_post.nil? or p.to_i > @last_post[:post_id].to_i
  end

  def last_topic f,t
  end


  def parse_forum local, remote, start=nil
    doc = Hpricot(self.read_file(local,remote))
    doc.search('ul.topics/li.row').each do |li|
      ta = li.search('a.topictitle').first # topic anchor
      q = self.parse_anchor(ta)
      f = q['f']
      t = q['t']
      u = self.parse_anchor(li.search('dl/dt/a').last)['u']
      @topics[t] = {
        forum_id: f,
        topic_id: t,
        user_id: u,
        title: ta.inner_html
      }
    end
  end


  def parse_topic local, remote, start=nil
    doc = Hpricot(self.read_file(local,remote))
    if start.nil?
      doc.search('div.pagination/span/a').collect{ |p| self.parse_anchor(p)['start'] }.uniq.each do |p|
        self.parse_topic "#{local}.start.#{p}", "#{remote}&start=#{p}", true
      end
    end
    doc.search('div.postbody').each do |li|
      # do something
    end
  end


  def parse_url href
    r = CGI.parse URI.parse(href).query
    r.each_pair { |k,v| r[k] = v.last }
  end


  def parse_anchor hp
    self.parse_url hp.attributes['href'] unless hp.nil?
  end
end
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T14:52:32+00:00Added an answer on May 16, 2026 at 2:52 pm

    This will be a violation of Terms of Service and may be illegal too.

    Secondly, if StackOverflow community starts solving these kind of web-scraping problems, then you know …

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a dynamic list of items that will be used to POST information
I've created a form application in .NET which will be used in the post-commit
I'm developing a feature on a forum site that will allow to include a
I have a bit of javascript that I have used successfully on one page,
I have a bit of javascript that I have used successfully on one page,
I want to use this function: http://www.frankmacdonald.co.uk/php/post-to-wordpress-with-php.html Its used to post to Wordpress using
I have used the excellent post How to create trapezoid tabs in WPF tab
I used the following code to post a search value via an html button.
I used cURL to authenticate first then login via POST to a cms. Then
This activity is used for login. It post the username and password to a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.