Saturday, December 13, 2008

FeedMe News is ready(ish)


I really enjoyed working on this project. It was great to imagine something and finally have the ability bring it to life.

Here's the link.... FeedMe News.

It's an RSS Feed news aggregator that's supposed to be easy to use for non-internet savvy people. You navigate by clicking on the section headings and then going page by page. You can also search for a subject. For each news item, there is a discussion area. Viewing the site and the discussions is open to anyone, but posting is limited to those who login.

I built it using Simplepie. The Simplepie loads about 30 or so feeds into a mySQL database. When you click on a section heading or run a search, it runs a query to pull the correct news items. There is a short delay when you click because the section gets updated before the items are pulled. A better way would be for the feeds to load constantly in the background, but that was a bit out of my ability.

I had planned to incorporate more Javascript and use it to create a "reading list" feature to the site, but I ran out of time. :( Currently, the only Javascript exists in the search and text boxes which get altered when you click on them.

I am planning to continue working on this and would love any feedback you guys might have!


And for nostalgia's sake, here is my petshop again. :) I sure learned a lot! Thanks!

Thursday, December 11, 2008

MySQL - help needed please!

Hi everyone,

I'm running into a brick wall when it comes to joining two tables together in mysql. Can anyone help?

Here's the situation: I have two tables. One table contains a list of news items from a bunch of different RSS feeds (feeditem table). The other table contains a list of all the feed titles and the category for each feed (feeds table). Both tables contain a field with the feed title.

I would like to construct a query that takes a category as input and then pulls the relevant news items. I've been trying various forms of join queries, but I don't seem to be getting anywhere. My latest attempt at a function is below.

Some of my questions:
Is it ok to have a query broken up on different lines for easier readability? Will it still run?

If the array is made successfully, am I correct in assuming that the variables will all have new names? What used to be "id" will now be "table_name.id"?

Should I be using something other than a left join?

I would appreciate any help!
- Sharon


function getSectionFeedItems($section) {

$myQuery = "SELECT snikfarjam_feeditem.id, snikfarjam_feeditem.feedid, snikfarjam_feeditem.feedurl, snikfarjam_feeditem.hash, snikfarjam_feeditem.guid, snikfarjam_feeditem.linkurl snikfarjam_feeditem.enclosureurl, snikfarjam_feeditem.title, snikfarjam_feeditem.content, snikfarjam_feeditem.pubdate, snikfarjam_feeditem.created, snikfarjam_feeds.category
FROM snikfarjam_feeds
LEFT JOIN snikfarjam_feeditem
ON snikfarjam_feeditem.feedid = snikfarjam_feeds.feed_name
WHERE snikfarjam_feeds.category={$section}
ORDER BY pubdate desc";

//run the query
$result = mysql_query($myQuery);


if ($result) {
//create an array that will store the results
$arrSectionItems = array();

//loop through the results returned from the database here
while($row = mysql_fetch_array($result)) {
$arrSectionItems[] = $row;
}
} //end if results

return $arrSectionItems;
}

Friday, December 5, 2008

Final Project Progress

Update: Perhaps it would be helpful if I actually included a link!



My project is coming along! I have to say it's looking better than I imagined it. It's supposed to be a news aggregator where you can see article summaries at a glance (similar to the layout of a newspaper). I still need to fix the article formatting and the selection of which news feeds to share. Currently, I'm only using Yahoo news feeds because they look the best. I intend to add a lot more bells and whistles including:
  • user login & registration (mySql)
  • sectional navigation
  • pagination (maybe using Javascript)
  • search
  • comments and favoriting - I wanted to do this by connecting the Simplepie feeds to a mySql database. The problem is that Simplepie will be adding support for this into it's next version. This is something I am still trying to figure out, so far it's not working.
By the way, I would love for some help naming the site. FeedMe News sounded really great a few days ago. Now it just sounds silly. :)