![]() |
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:
<? how hard would this be? |
Interesting... I will hit up a dude and see what he can do.
|
Quote:
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 |
Sorry I can not help you good luck
|
Quote:
You know Steve in NY (aka Hudson) right? |
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> 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. |
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.
|
Quote:
|
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"); And yes, like mr.K mentioned... Code:
<lyrics><![CDATA[' . $mysql_array['lyric_text']) . ']]></lyrics> 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 :) |
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)
|
Quote:
I want to use it to update blogs, and if the songs never rotate then the blog will pull the same songs every day |
Quote:
can I hit you up tomorrow to do this? |
Quote:
now I just need to figure out how to get the lyrics to show up too |
Paste column name for full lyrics text, date, and sample date.. I'll get this cooked up for you before heading to bed :)
|
lyric_text is the sql column that holds all the lyrics data
|
there is also
temp_date submit_date |
what format is submit_date in? 2008-01-31 ?
|
this is weird though, all the dates are showing up as
0000-00-00 00:00:00 |
Quote:
Good luck |
Lot's of help here it seems, I suck at programming anyway lol
|
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 |
Not sure why your dates are screwy, assuming they worked this code ought to do the trick:
Code:
<? |
Quote:
btw, anyone that helps me will be paid something, and get some free hard links |
Quote:
http://lyrics.gamesandlyrics.com/rss.php |
Quote:
Run this SQL query: UPDATE lyrics set submit_date = '2008-01-30' where 0=0; To set all dates to yesterday |
Quote:
|
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 |
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 |
add this after the first <link></link> set:
<lyrics>full lyrics</lyrics> |
nope i lied... one sec
|
Change:
Code:
<lyrics><![CDATA['.htmlspecialchars($mysql_array['lryic_text']).']]></lyrics> Code:
<description><![CDATA['.htmlspecialchars($mysql_array['lryic_text']).']]></description> |
and change my typo of lryic_text to lyric_text :)
|
Quote:
http://lyrics.gamesandlyrics.com/rss.php now, how do I get it to keep the html formatting? |
Can you paste the PHP back? There's an error in there somewhere that needs correcting, view source you'll see the PHP warning.
|
Quote:
Code:
<? |
somewhere on this line
$date_chk= mysql_query("select date from lyrics where approved='1' limit 1"); |
Code:
<? |
Yeah it's because 'date' isn't the column name, 'submit_date' is.. thought I changed that but obviously not :)
|
now how do I get the html to show up?
|
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/"> |
i'm a moron. change this line:
Code:
<description><![CDATA['.htmlspecialchars($mysql_array['lyric_text']).']]></description> Code:
<description><![CDATA['.$mysql_array['lyric_text'].']]></description> |
|
what is your epass?
|
PWMOORE@ Appreciate it, although it's not necessary.. just enjoy a mid-night challenge ;)
|
Quote:
and no worries, I believe that everyone should get paid for the work they do :thumbsup |
Quote:
|
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 :) |
seems hard dude! Going to ask a friend for you!
|
All times are GMT -7. The time now is 02:24 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123