Welcome to the GoFuckYourself.com - Adult Webmaster Forum forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact us.

Post New Thread Reply

Register GFY Rules Calendar
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >
Discuss what's fucking going on, and which programs are best and worst. One-time "program" announcements from "established" webmasters are allowed.

 
Thread Tools
Old 01-31-2008, 12:34 AM   #1
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
Programmers, how hard would this be?

I have a Lyrics script running on a site of mine, and it allows me to have an rss feed...the issue is that the rss only publishes the title of the lyric with a link to that lyric, plus it only lists the last 20 lyric posts

I want the feed to publish all the lyrics to that song, and also when the site hasn't been updated that day to publish a random lyric from the database...it has over 500,000 songs in it, so even if we set it to do any random song, the probability of it being a duplicate that the rss has seen recently is minimum

the script is Lyricing, you can see it in action here: http://www.lyricing.com/

the feed is http://www.lyricing.com/rss.php and the code to rss.php is

Code:
<?

include_once "config.php";

header("Content-type: text/xml");

echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";

echo '<rss version="2.0">';

echo '<channel>

<title>lyrics</title>

<description>music lyrics</description>

<link>http://www.domain.com/</link>';

$ex_sql = mysql_query( "select lyric_id, lyric_artist, lyric_title from lyrics where approved='1' order by lyric_id desc limit 20");

$num_rows = mysql_num_rows($ex_sql);

if ( $num_rows >= 1) {

while ($mysql_array = mysql_fetch_array($ex_sql)) {

echo '<item>

<link>http://www.domain.com/'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist']).'/'.$mysql_array['lyric_id'].'-'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']).'.html'.'</link>

<title>'.htmlspecialchars($mysql_array['lyric_artist']).' - '.htmlspecialchars($mysql_array['lyric_title']).'</title>
<guid>http://www.domain.com/'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist']).'/'.$mysql_array['lyric_id'].'-'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']).'.html'.'</guid>
</item>';

}

} else {

echo 'No latest lyrics available.';

}

echo '</channel></rss>';

?>
lyric_text is the field that stores the lyrics for each song

how hard would this be?

Last edited by Jace; 01-31-2008 at 12:35 AM..
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 12:43 AM   #2
fr0gman
Confirmed User
 
Join Date: Feb 2005
Posts: 2,093
Interesting... I will hit up a dude and see what he can do.
__________________
Earn up to $.03 per Visitor -> No Click Monetization!
"Because the World Wide Web is all about two things: horrifyingly stupid psychodrama, and naked chicks."
Wild College Videos | ICQ: 7746696
fr0gman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 12:45 AM   #3
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
Quote:
Originally Posted by fr0gman View Post
Interesting... I will hit up a dude and see what he can do.
if he needs to contact me he can icq me 3 9 9 6 0 8 4 8 2

I would be willing to pay for it, I have this script installed on like 10 domains and it would be sweet to have this available on them all
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 12:46 AM   #4
LOOPNAME Se Vende!
Registered User
 
Join Date: Jan 2008
Location: Mexico Se Vende!
Posts: 64
Sorry I can not help you good luck
__________________
Domains For Sale
Email: LoopName@gmail★com
LOOPNAME Se Vende! is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 12:49 AM   #5
fr0gman
Confirmed User
 
Join Date: Feb 2005
Posts: 2,093
Quote:
Originally Posted by Jace View Post
if he needs to contact me he can icq me 3 9 9 6 0 8 4 8 2

I would be willing to pay for it, I have this script installed on like 10 domains and it would be sweet to have this available on them all

You know Steve in NY (aka Hudson) right?
__________________
Earn up to $.03 per Visitor -> No Click Monetization!
"Because the World Wide Web is all about two things: horrifyingly stupid psychodrama, and naked chicks."
Wild College Videos | ICQ: 7746696
fr0gman is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 12:52 AM   #6
wpkings
Registered User
 
wpkings's Avatar
 
Join Date: Jan 2008
Posts: 98
Hey Jace,
It's not hard at all...unfortunately I'm very tired right now and may not be completely understanding you correctly, but it sounds like you would just need to add 'lyric_text' to the SELECT query, and loop that into an element, for example:

Code:
<lyrics>' . $mysql_array['lyric_text']) . '</lyrics>
Of course with the appropriate strip if necessary..
Like I said I'm tired but if you want to shoot an email to wpkings at gmail then I can take a look at it tomorrow. From the sound of it, it's like a 10 min job that wouldn't really cost anything.
wpkings is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:05 AM   #7
mr.K©
Confirmed User
 
mr.K©'s Avatar
 
Join Date: Dec 2006
Location: Near AMS
Posts: 201
Yeah, that's right. and you might want to put a cdata block around the lyric text else your rss would break in case of any special chars.
mr.K© is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:18 AM   #8
Dynamix
G F Y not
 
Industry Role:
Join Date: Jan 2004
Location: MN
Posts: 2,910
Quote:
Originally Posted by Jace View Post
and also when the site hasn't been updated that day to publish a random lyric from the database...it has over 500,000 songs in it, so even if we set it to do any random song, the probability of it being a duplicate that the rss has seen recently is minimum
The SQL query isn't pulling by date, it's just pulling the most recent 20 songs, meaning there will never be an empty results set so there's no need to randomize.
__________________

TGPFactory Full TGP Design & Installation Services
ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
See who I am at AdultWhosWho.com!
Dynamix is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:18 AM   #9
wpkings
Registered User
 
wpkings's Avatar
 
Join Date: Jan 2008
Posts: 98
And obviously the result limit is set with LIMIT:
Code:
$ex_sql = mysql_query( "select lyric_id, lyric_artist, lyric_title from lyrics where approved='1' order by lyric_id desc limit 20");
So you could just change that LIMIT 20 to LIMIT 40 etc

And yes, like mr.K mentioned...
Code:
<lyrics><![CDATA[' . $mysql_array['lyric_text']) . ']]></lyrics>
But there might be a better way.

The other part with the random lyrics isn't hard but I'd probably give you the wrong code if I tried now, so that can wait until tomorrow
wpkings is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:20 AM   #10
Dynamix
G F Y not
 
Industry Role:
Join Date: Jan 2004
Location: MN
Posts: 2,910
Nevermind I think I realize what you mean.. can you paste the column name in the SQL database for date added, and also the format (likely YYYY-MM-DD but want to be sure)
__________________

TGPFactory Full TGP Design & Installation Services
ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
See who I am at AdultWhosWho.com!
Dynamix is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:20 AM   #11
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
Quote:
Originally Posted by Dynamix View Post
The SQL query isn't pulling by date, it's just pulling the most recent 20 songs, meaning there will never be an empty results set so there's no need to randomize.
but what if I don't update new lyrics for a month, will the same lyrics be sitting in the rss feed for a month?

I want to use it to update blogs, and if the songs never rotate then the blog will pull the same songs every day
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:21 AM   #12
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
Quote:
Originally Posted by wpkings View Post
Hey Jace,
It's not hard at all...unfortunately I'm very tired right now and may not be completely understanding you correctly, but it sounds like you would just need to add 'lyric_text' to the SELECT query, and loop that into an element, for example:

Code:
<lyrics>' . $mysql_array['lyric_text']) . '</lyrics>
Of course with the appropriate strip if necessary..
Like I said I'm tired but if you want to shoot an email to wpkings at gmail then I can take a look at it tomorrow. From the sound of it, it's like a 10 min job that wouldn't really cost anything.
quite simply, I want the song lyrics in the rss feed, not just the title

can I hit you up tomorrow to do this?
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:22 AM   #13
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
Quote:
Originally Posted by wpkings View Post
And obviously the result limit is set with LIMIT:
Code:
$ex_sql = mysql_query( "select lyric_id, lyric_artist, lyric_title from lyrics where approved='1' order by lyric_id desc limit 20");
So you could just change that LIMIT 20 to LIMIT 40 etc

And yes, like mr.K mentioned...
Code:
<lyrics><![CDATA[' . $mysql_array['lyric_text']) . ']]></lyrics>
But there might be a better way.

The other part with the random lyrics isn't hard but I'd probably give you the wrong code if I tried now, so that can wait until tomorrow
yeah, i figured out the amount of articles pulled, that was easy

now I just need to figure out how to get the lyrics to show up too
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:23 AM   #14
Dynamix
G F Y not
 
Industry Role:
Join Date: Jan 2004
Location: MN
Posts: 2,910
Paste column name for full lyrics text, date, and sample date.. I'll get this cooked up for you before heading to bed
__________________

TGPFactory Full TGP Design & Installation Services
ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
See who I am at AdultWhosWho.com!
Dynamix is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:25 AM   #15
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
lyric_text is the sql column that holds all the lyrics data
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:27 AM   #16
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
there is also
temp_date
submit_date
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:27 AM   #17
Dynamix
G F Y not
 
Industry Role:
Join Date: Jan 2004
Location: MN
Posts: 2,910
what format is submit_date in? 2008-01-31 ?
__________________

TGPFactory Full TGP Design & Installation Services
ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
See who I am at AdultWhosWho.com!
Dynamix is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:28 AM   #18
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
this is weird though, all the dates are showing up as
0000-00-00 00:00:00
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:28 AM   #19
wpkings
Registered User
 
wpkings's Avatar
 
Join Date: Jan 2008
Posts: 98
Quote:
Originally Posted by Jace View Post
quite simply, I want the song lyrics in the rss feed, not just the title

can I hit you up tomorrow to do this?
Sure if you don't get it figured out tonight, email wpkings at gmail or icq 442150682
Good luck
wpkings is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:29 AM   #20
Nicky
Confirmed User
 
Nicky's Avatar
 
Industry Role:
Join Date: Mar 2003
Location: Sweden
Posts: 30,069
Lot's of help here it seems, I suck at programming anyway lol
__________________

gfynicky @ gmail.com
Nicky is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:30 AM   #21
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
there is a lyric_id field though, you could randomize with that

but I only want the random thing when I don't add lyrics, if I add lyrics for the day there would be no random lyric
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:30 AM   #22
Dynamix
G F Y not
 
Industry Role:
Join Date: Jan 2004
Location: MN
Posts: 2,910
Not sure why your dates are screwy, assuming they worked this code ought to do the trick:

Code:
<?

include_once "config.php";

header("Content-type: text/xml");

echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";

echo '<rss version="2.0">';

echo '<channel>

<title>lyrics</title>

<description>music lyrics</description>

<link>http://www.domain.com/</link>';

$sql_query = "select lyric_id, lyric_artist, lyric_title, lyric_text from lyrics where approved='1' order by lyric_id desc limit 20";

// Analyze date of latest entry
$date_chk= mysql_query("select submit_date from lyrics where approved='1' order by lyric_id desc limit 1");
$latest= mysql_fetch_array($date_chk);
$latest_date= split(" ",$latest['submit_date']);
if ($latest_date[0]!=date("Y-m-d")) $sql_query = "select lyric_id, lyric_artist, lyric_title, lyric_text from lyrics where approved='1' order by rand() limit 20";


$ex_sql = mysql_query( $sql_query );

$num_rows = mysql_num_rows($ex_sql);

if ( $num_rows >= 1) {

while ($mysql_array = mysql_fetch_array($ex_sql)) {

echo '<item>

<link>http://www.domain.com/'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist']).'/'.$mysql_array['lyric_id'].'-'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']).'.html'.'</link>

<title>'.htmlspecialchars($mysql_array['lyric_artist']).' - '.htmlspecialchars($mysql_array['lyric_title']).'</title>
<lyrics><![CDATA['.htmlspecialchars($mysql_array['lryic_text']).']]></lyrics>
<guid>http://www.domain.com/'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist']).'/'.$mysql_array['lyric_id'].'-'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']).'.html'.'</guid>
</item>';

}

} else {

echo 'No latest lyrics available.';

}

echo '</channel></rss>';

?>
__________________

TGPFactory Full TGP Design & Installation Services
ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
See who I am at AdultWhosWho.com!
Dynamix is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:31 AM   #23
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
Quote:
Originally Posted by Nicky View Post
Lot's of help here it seems, I suck at programming anyway lol
gfy really actually does have some nice folks on here, usually late night though

btw, anyone that helps me will be paid something, and get some free hard links
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:35 AM   #24
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
Quote:
Originally Posted by Dynamix View Post
Not sure why your dates are screwy, assuming they worked this code ought to do the trick:

Code:
<?

include_once "config.php";

header("Content-type: text/xml");

echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";

echo '<rss version="2.0">';

echo '<channel>

<title>lyrics</title>

<description>music lyrics</description>

<link>http://www.domain.com/</link>';

$sql_query = "select lyric_id, lyric_artist, lyric_title, lyric_text from lyrics where approved='1' order by lyric_id desc limit 20";

// Analyze date of latest entry
$date_chk= mysql_query("select submit_date from lyrics where approved='1' order by lyric_id desc limit 1");
$latest= mysql_fetch_array($date_chk);
$latest_date= split(" ",$latest['submit_date']);
if ($latest_date[0]!=date("Y-m-d")) $sql_query = "select lyric_id, lyric_artist, lyric_title, lyric_text from lyrics where approved='1' order by rand() limit 20";


$ex_sql = mysql_query( $sql_query );

$num_rows = mysql_num_rows($ex_sql);

if ( $num_rows >= 1) {

while ($mysql_array = mysql_fetch_array($ex_sql)) {

echo '<item>

<link>http://www.domain.com/'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist']).'/'.$mysql_array['lyric_id'].'-'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']).'.html'.'</link>

<title>'.htmlspecialchars($mysql_array['lyric_artist']).' - '.htmlspecialchars($mysql_array['lyric_title']).'</title>
<lyrics><![CDATA['.htmlspecialchars($mysql_array['lryic_text']).']]></lyrics>
<guid>http://www.domain.com/'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist']).'/'.$mysql_array['lyric_id'].'-'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']).'.html'.'</guid>
</item>';

}

} else {

echo 'No latest lyrics available.';

}

echo '</channel></rss>';

?>
that is randomizing them every time it pulls the rss page up

http://lyrics.gamesandlyrics.com/rss.php
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:37 AM   #25
Dynamix
G F Y not
 
Industry Role:
Join Date: Jan 2004
Location: MN
Posts: 2,910
Quote:
Originally Posted by Jace View Post
that is randomizing them every time it pulls the rss page up

http://lyrics.gamesandlyrics.com/rss.php
Right, because your date column is fucked up :/

Run this SQL query:

UPDATE lyrics set submit_date = '2008-01-30' where 0=0;

To set all dates to yesterday
__________________

TGPFactory Full TGP Design & Installation Services
ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
See who I am at AdultWhosWho.com!
Dynamix is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:37 AM   #26
Dynamix
G F Y not
 
Industry Role:
Join Date: Jan 2004
Location: MN
Posts: 2,910
Quote:
Originally Posted by Dynamix View Post
Right, because your date column is fucked up :/

Run this SQL query:

UPDATE lyrics set submit_date = '2008-01-30' where 0=0;

To set all dates to yesterday
May want to set to today '2008-01-31' so it stops randomizing
__________________

TGPFactory Full TGP Design & Installation Services
ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
See who I am at AdultWhosWho.com!
Dynamix is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:42 AM   #27
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
now there is nothing there, haha

http://lyrics.gamesandlyrics.com/rss.php

i guess because it technically hasn't been entered yet

I know why all the dates are that way though, the sql dump I got was all set to have no submission dates, so when I start enterring them manually they will start having normal datwes
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:43 AM   #28
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
i set it back to 2008-01-30 so I can see what I am working with

thanks!!!!

now...to get the full lyrics text in there
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:48 AM   #29
Dynamix
G F Y not
 
Industry Role:
Join Date: Jan 2004
Location: MN
Posts: 2,910
add this after the first <link></link> set:

<lyrics>full lyrics</lyrics>
__________________

TGPFactory Full TGP Design & Installation Services
ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
See who I am at AdultWhosWho.com!
Dynamix is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:49 AM   #30
Dynamix
G F Y not
 
Industry Role:
Join Date: Jan 2004
Location: MN
Posts: 2,910
nope i lied... one sec
__________________

TGPFactory Full TGP Design & Installation Services
ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
See who I am at AdultWhosWho.com!
Dynamix is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:56 AM   #31
Dynamix
G F Y not
 
Industry Role:
Join Date: Jan 2004
Location: MN
Posts: 2,910
Change:
Code:
<lyrics><![CDATA['.htmlspecialchars($mysql_array['lryic_text']).']]></lyrics>
to:
Code:
<description><![CDATA['.htmlspecialchars($mysql_array['lryic_text']).']]></description>
__________________

TGPFactory Full TGP Design & Installation Services
ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
See who I am at AdultWhosWho.com!
Dynamix is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 01:57 AM   #32
Dynamix
G F Y not
 
Industry Role:
Join Date: Jan 2004
Location: MN
Posts: 2,910
and change my typo of lryic_text to lyric_text
__________________

TGPFactory Full TGP Design & Installation Services
ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
See who I am at AdultWhosWho.com!
Dynamix is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 02:01 AM   #33
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
Quote:
Originally Posted by Dynamix View Post
and change my typo of lryic_text to lyric_text
oh shit, there it is!

http://lyrics.gamesandlyrics.com/rss.php

now, how do I get it to keep the html formatting?
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 02:05 AM   #34
Dynamix
G F Y not
 
Industry Role:
Join Date: Jan 2004
Location: MN
Posts: 2,910
Can you paste the PHP back? There's an error in there somewhere that needs correcting, view source you'll see the PHP warning.
__________________

TGPFactory Full TGP Design & Installation Services
ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
See who I am at AdultWhosWho.com!
Dynamix is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 02:06 AM   #35
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
Quote:
Originally Posted by Dynamix View Post
Can you paste the PHP back? There's an error in there somewhere that needs correcting, view source you'll see the PHP warning.
yup, i see it

Code:
<?

include_once "config.php";

header("Content-type: text/xml");

echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";

echo '<rss version="2.0">';

echo '<channel>

<title>lyrics</title>

<description>music lyrics</description>

<link>http://lyrics.gamesandlyrics.com/</link>';

$sql_query = "select lyric_id, lyric_artist, lyric_title, lyric_text from lyrics where approved='1' order by lyric_id desc limit 20";

// Analyze date of latest entry
$date_chk= mysql_query("select date from lyrics where approved='1' limit 1");
$latest= mysql_fetch_array($date_chk);
$latest_date= split(" ",$latest['date']);
if ($latest_date[0]!=date("Y-m-d")) $sql_query = "select lyric_id, lyric_artist, lyric_title, lyric_text from lyrics where approved='1' order by rand() limit 20";


$ex_sql = mysql_query( $sql_query );

$num_rows = mysql_num_rows($ex_sql);

if ( $num_rows >= 1) {

while ($mysql_array = mysql_fetch_array($ex_sql)) {

echo '<item>

<link>http://lyrics.gamesandlyrics.com/'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist']).'/'.$mysql_array['lyric_id'].'-'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']).'.html'.'</link>

<title>'.htmlspecialchars($mysql_array['lyric_artist']).' - '.htmlspecialchars($mysql_array['lyric_title']).'</title>
<description><![CDATA['.htmlspecialchars($mysql_array['lyric_text']).']]></description>
<guid>http://lyrics.gamesandlyrics.com/'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist']).'/'.$mysql_array['lyric_id'].'-'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']).'.html'.'</guid>
</item>';

}

} else {

echo 'No latest lyrics available.';

}

echo '</channel></rss>';

?>
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 02:07 AM   #36
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
somewhere on this line

$date_chk= mysql_query("select date from lyrics where approved='1' limit 1");
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 02:08 AM   #37
Dynamix
G F Y not
 
Industry Role:
Join Date: Jan 2004
Location: MN
Posts: 2,910
Code:
<?

include_once "config.php";

header("Content-type: text/xml");

echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";

echo '<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">';

echo '<channel>

<title>lyrics</title>

<description>music lyrics</description>

<link>http://lyrics.gamesandlyrics.com/</link>';

$sql_query = "select lyric_id, lyric_artist, lyric_title, lyric_text from lyrics where approved='1' order by lyric_id desc limit 20";

// Analyze date of latest entry
$date_chk= mysql_query("select submit_date from lyrics where approved='1' limit 1");
$latest= @mysql_fetch_array($date_chk);
if ($latest){
	$latest_date= split(" ",$latest['submit_date']);
	if ($latest_date[0]!=date("Y-m-d")) $sql_query = "select lyric_id, lyric_artist, lyric_title, lyric_text from lyrics where approved='1' order by rand() limit 20";
}


$ex_sql = mysql_query( $sql_query );

$num_rows = mysql_num_rows($ex_sql);

if ( $num_rows >= 1) {

while ($mysql_array = mysql_fetch_array($ex_sql)) {

echo '<item>

<link>http://lyrics.gamesandlyrics.com/'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist']).'/'.$mysql_array['lyric_id'].'-'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']).'.html'.'</link>

<title>'.htmlspecialchars($mysql_array['lyric_artist']).' - '.htmlspecialchars($mysql_array['lyric_title']).'</title>
<description><![CDATA['.htmlspecialchars($mysql_array['lyric_text']).']]></description>
<guid>http://lyrics.gamesandlyrics.com/'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist']).'/'.$mysql_array['lyric_id'].'-'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']).'.html'.'</guid>
</item>';

}

} else {

echo 'No latest lyrics available.';

}

echo '</channel></rss>';

?>
__________________

TGPFactory Full TGP Design & Installation Services
ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
See who I am at AdultWhosWho.com!
Dynamix is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 02:08 AM   #38
Dynamix
G F Y not
 
Industry Role:
Join Date: Jan 2004
Location: MN
Posts: 2,910
Yeah it's because 'date' isn't the column name, 'submit_date' is.. thought I changed that but obviously not
__________________

TGPFactory Full TGP Design & Installation Services
ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
See who I am at AdultWhosWho.com!
Dynamix is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 02:10 AM   #39
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
now how do I get the html to show up?
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 02:13 AM   #40
Dynamix
G F Y not
 
Industry Role:
Join Date: Jan 2004
Location: MN
Posts: 2,910
That's what I'm looking at.. comparing yours to MSNBC, the only difference is this line:

Code:
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
But I thought that was only used to display media (video, photo, etc.)
__________________

TGPFactory Full TGP Design & Installation Services
ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
See who I am at AdultWhosWho.com!
Dynamix is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 02:15 AM   #41
Dynamix
G F Y not
 
Industry Role:
Join Date: Jan 2004
Location: MN
Posts: 2,910
i'm a moron. change this line:

Code:
<description><![CDATA['.htmlspecialchars($mysql_array['lyric_text']).']]></description>
to:

Code:
<description><![CDATA['.$mysql_array['lyric_text'].']]></description>
__________________

TGPFactory Full TGP Design & Installation Services
ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
See who I am at AdultWhosWho.com!
Dynamix is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 02:29 AM   #42
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
YOU FUCKING ROCK

http://lyrics.gamesandlyrics.com/rss.php
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 02:29 AM   #43
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
what is your epass?
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 02:32 AM   #44
Dynamix
G F Y not
 
Industry Role:
Join Date: Jan 2004
Location: MN
Posts: 2,910
PWMOORE@ Appreciate it, although it's not necessary.. just enjoy a mid-night challenge ;)
__________________

TGPFactory Full TGP Design & Installation Services
ICQ 250 142 484 · AIM TGPDynamix · Email: patrick (at) tgpfactory (dot) com
See who I am at AdultWhosWho.com!
Dynamix is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 01-31-2008, 02:39 AM   #45
Jace
FBOP Class Of 2013
 
Industry Role:
Join Date: Jan 2004
Location: bumfuck, ky
Posts: 35,562
Quote:
Originally Posted by Dynamix View Post
PWMOORE@ Appreciate it, although it's not necessary.. just enjoy a mid-night challenge ;)
sent

and no worries, I believe that everyone should get paid for the work they do
Jace is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2008, 01:19 AM   #46
POed-poster
Confirmed User
 
POed-poster's Avatar
 
Join Date: Feb 2005
Posts: 1,588
Quote:
Originally Posted by Jace View Post
I have a Lyrics script running on a site of mine, and it allows me to have an rss feed...the issue is that the rss only publishes the title of the lyric with a link to that lyric, plus it only lists the last 20 lyric posts

I want the feed to publish all the lyrics to that song, and also when the site hasn't been updated that day to publish a random lyric from the database...it has over 500,000 songs in it, so even if we set it to do any random song, the probability of it being a duplicate that the rss has seen recently is minimum

the script is Lyricing, you can see it in action here: http://www.lyricing.com/

the feed is http://www.lyricing.com/rss.php and the code to rss.php is

Code:
<?

include_once "config.php";

header("Content-type: text/xml");

echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";

echo '<rss version="2.0">';

echo '<channel>

<title>lyrics</title>

<description>music lyrics</description>

<link>http://www.domain.com/</link>';

$ex_sql = mysql_query( "select lyric_id, lyric_artist, lyric_title from lyrics where approved='1' order by lyric_id desc limit 20");

$num_rows = mysql_num_rows($ex_sql);

if ( $num_rows >= 1) {

while ($mysql_array = mysql_fetch_array($ex_sql)) {

echo '<item>

<link>http://www.domain.com/'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist']).'/'.$mysql_array['lyric_id'].'-'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']).'.html'.'</link>

<title>'.htmlspecialchars($mysql_array['lyric_artist']).' - '.htmlspecialchars($mysql_array['lyric_title']).'</title>
<guid>http://www.domain.com/'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_artist']).'/'.$mysql_array['lyric_id'].'-'.preg_replace('/([^a-zA-Z0-9]+)/', '-', $mysql_array['lyric_title']).'.html'.'</guid>
</item>';

}

} else {

echo 'No latest lyrics available.';

}

echo '</channel></rss>';

?>
lyric_text is the field that stores the lyrics for each song

how hard would this be?
How well are you doing with this site?
POed-poster is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2008, 02:29 AM   #47
polle54
Confirmed User
 
Join Date: Jul 2004
Location: The Beach
Posts: 4,626
LOL I just read this old thread Dynamix is the only one who seemed to understand that you can't just put a <randomtext> tag in an rss feed
I thought every programmer and his mother understood rss from xml by now
__________________
ICQ# 143561781
polle54 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Old 08-04-2008, 02:30 AM   #48
raven1083
Confirmed User
 
raven1083's Avatar
 
Join Date: Jul 2007
Posts: 7,687
seems hard dude! Going to ask a friend for you!
raven1083 is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote
Post New Thread Reply
Go Back   GoFuckYourself.com - Adult Webmaster Forum > >

Bookmarks



Advertising inquiries - marketing at gfy dot com

Contact Admin - Advertise - GFY Rules - Top

©2000-, AI Media Network Inc



Powered by vBulletin
Copyright © 2000- Jelsoft Enterprises Limited.