Importing Content

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
fender967
Forum Newbie
Posts: 3
Joined: Wed Nov 12, 2008 12:39 am

Importing Content

Post by fender967 »

I am not too experienced with php but I was hoping someone could tell me if this is possible.. I would like to be able to import content from other websites to link to them in my blog. I have a wordpress plugin that imports the feed's text headlines, but what I am really after is being able to also import any images associated with them. Can anyone tell me if it is possible to do this or if it is possible to import content from certain parts of another website in any other way?

I am looking to build a resource site which is updated on its own and links to a variety of different websites' blog posts.

Any help would be greatly appreciated, thanks
User avatar
novice4eva
Forum Contributor
Posts: 327
Joined: Thu Mar 29, 2007 3:48 am
Location: Nepal

Re: Importing Content

Post by novice4eva »

you might want to look into fopen and fread also curl does the same thing but the problem is it takes the whole page while you want to just fetch portion of the site!! You can only pray that the site you want to get content from provides RSS feed.
fender967
Forum Newbie
Posts: 3
Joined: Wed Nov 12, 2008 12:39 am

Re: Importing Content

Post by fender967 »

Yeah, they do have an rss feed. I just don't know how to do it, to take part of the feed, including and image.
User avatar
chopsmith
Forum Commoner
Posts: 56
Joined: Thu Nov 13, 2008 10:40 am
Location: Red Bank, NJ, USA

Re: Importing Content

Post by chopsmith »

This is called screen scraping, if I'm not mistaken. We would have to analyze the source of the document you are looking to "import", but it is definitely possible. I hope you're not trying to co-opt the work of another for your own pecuniary gain . . .
fender967
Forum Newbie
Posts: 3
Joined: Wed Nov 12, 2008 12:39 am

Re: Importing Content

Post by fender967 »

No, not at all. What i'm trying to do is build a website that imports updates based on their headline and image and links them to the post on each respective website. Basically, building a site that has/links to useful content but doesn't need to be maintained.
User avatar
chopsmith
Forum Commoner
Posts: 56
Joined: Thu Nov 13, 2008 10:40 am
Location: Red Bank, NJ, USA

Re: Importing Content

Post by chopsmith »

I still don't think that's perfectly kosher without the consent of the owners of the other site(s). Anyway, to be able to figure this out, we'd have to, at the very least, see the "view source" of the page(s) you're trying to scrape, and we'd have to know exactly what content from that page you wanted.
Post Reply