How to get a BLOCK to GRAB headlines and link to its story?

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
drujr
Forum Newbie
Posts: 17
Joined: Thu May 13, 2004 1:59 pm

How to get a BLOCK to GRAB headlines and link to its story?

Post by drujr »

Hey all

I need some help. I was wondering how I could make either a block or a module that would grab headlines from http://www.townhall.com/columnists/ and display them in the block/module, linking the user who clicks the link to the original website of the story.

How can i do this? any help would be appreciated.
kettle_drum
DevNet Resident
Posts: 1150
Joined: Sun Jul 20, 2003 9:25 pm
Location: West Yorkshire, England

Post by kettle_drum »

You just need to grab the page using fopen() and fgets() and then parse away the data until you are left with the headlines and the little story intro. You know roughly where the headlines start as there is the "todays featured articles" bit in bold that you can look for, once you find that you can ignore everything before that, and then find where the headlines finish, and ignore everything after that.
Post Reply