Jump to content

How to download a forum thread to a txt file

- - - - -

  • Please log in to reply
4 replies to this topic

#1
Sp32

Sp32

    Newbie

  • Members
  • PipPip
  • 26 posts
Hi, I am interested in creating a fairly extensive application... One step at a time, the first step would be to download x amount of threads in a certain forum on a website to a txt file. I am mainly focusing on vBulletin forums at this current time, I plan on extending in the future but not right now.. I think I read something on RegEx which seems like that's what I need to start with?

I am pretty experienced with vBulletin but a beginner at C# (Not absolute beginner)

I'm not asking for someone to code this for me, I am more asking on what things will I need to learn to be able to accomplish this such as stuff like:

threadviewer tViewer new threadviewer();

^ I can't think of the correct name for this (Like I said I'm new lol and it's half 4 in the morning. A lot of people will think I am in over my head but I plan on doing some vital learning from this)

So if it's possible can someone push me into the right direction :thumbup:

#2
Skippy

Skippy

    Programmer

  • Members
  • PipPipPipPip
  • 146 posts
I think you are going to need experience in parsing strings. and HTML.

go to your browser's menu then go to
view-> page source (on mozilla thats how it is, i forgot where it is on EE)

now your program can ask forum.codecall.net to dump that html at you.

you would have to connect to this url in a socket: http://forum.codecal...d-txt-file.html
and use the HTML get command

then you would have one stream containing that whole source code.

now check out about half way down, look at this code:

div class="content">

					<div id="post_message_289114">

						<blockquote class="postcontent restore ">

							<!-- google_ad_section_start -->Hi, I am interested in creating a fairly extensive application... One step at a time, the first step would be to download x amount of threads in a certain forum on a website to a txt file. I am mainly focusing on vBulletin forums at this current time, I plan on extending in the future but not right now.. I think I read something on RegEx which seems like that's what I need to start with?<br />

<br />

I am pretty experienced with vBulletin but a beginner at C# (Not absolute beginner)<br />


<br />

I'm not asking for someone to code this for me, I am more asking on what things will I need to learn to be able to accomplish this such as stuff like:<br />

<br />

threadviewer tViewer new threadviewer();<br />

<br />

^ I can't think of the correct name for this (Like I said I'm new lol and it's half 4 in the morning. A lot of people will think I am in over my head but I plan on doing some vital learning from this)<br />

<br />

So if it's possible can someone push me into the right direction 

looks like the body of a post is located in the class "content" try going forum to forum and look at how it stores the information in the HTML page.

Your program is going to be required to parse all that info in there and pick out the stuff you need. its going to be all about parsing strings. Luckily for you u are using c# which has an extensive string class and great functions for it.

May I ask what this program is for? personal use?

#3
Sp32

Sp32

    Newbie

  • Members
  • PipPip
  • 26 posts
Thanks, I've spoke to someone called sam_coder and he's been helping me also, I've managed to do some coding but not a great deal using something called HTML Agility Pack but I'm happy you've posted a different route as I can experiment to which I find easier.

The program is going to be for personal use as it will make a process of tasks which I dislike doing a lot easier

#4
Skippy

Skippy

    Programmer

  • Members
  • PipPipPipPip
  • 146 posts
hmm, never heard of that. Yeah defiantly though, I wish you the best of luck on this project. It seems like a pretty difficult one, but once you figure it out it should be a cinch to do the actual coding.

Good luck.

#5
Sp32

Sp32

    Newbie

  • Members
  • PipPip
  • 26 posts
Thanks a lot mate




1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users