0

Hey Guys,

Before I start working on this I figured I would see if any of you knew the best place for information on building a Digg style function. I am not talking about the Digg button, I am talking about the "Submit a New Link" function that diggs through the URL and gets the Title, Body and ties the title to the URL.

Does anyone know any good tutorials? I was going to use pligg, but I want more customization so I code it myself. : )

Any help appreciated!

2
Contributors
4
Replies
5
Views
7 Years
Discussion Span
Last Post by drewpark88
0

Hmm, you could use the file_get_contents() function on the URL that is submitted to your website, then use a regular expression (you can obviously use other functions too) to find the things you want.

Shouldn't be that difficult, since you're only searching for a <title> and <body> tag

0

Ok well that kinda makes sense...I will look into this. If anyone has an example or tutorial url it would be appreciated : )

1

A simple script like this might already work:

$url="http://www.something.com";
$source=file_get_contents($url);
preg_match("<title>[a-zA-Z0-9<>/]{1,}</title>",$source,$value);
$title=$value[0];

Obviously you might need to tweak things a bit but this should give you something to start with.

Votes + Comments
Great Help : )
0

Thank you sooo much that helped : )

A simple script like this might already work:

$url="http://www.something.com";
$source=file_get_contents($url);
preg_match("<title>[a-zA-Z0-9<>/]{1,}</title>",$source,$value);
$title=$value[0];

Obviously you might need to tweak things a bit but this should give you something to start with.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.