Today I was able to put some nifty url validation into my feed reader. Almost as nifty are the tests I wrote to validate them.
I also created a Rake task to update all the feeds in the database. Rake tasks are also nifty, its very easy to access and modify models within them. I found a helpful intro to rake tasks here.
A final note: Rails Guides is a newly found resource for me. It was apparently updated to a new visual format this week and it looks great right now. There's some great, current documentation there that I would recommend to anyone looking to learn more about rails.
Showing posts with label outblogger. Show all posts
Showing posts with label outblogger. Show all posts
Wednesday, February 4, 2009
Wednesday, January 28, 2009
Forms and Links
Tonight I was able to put some solid time into OutBlogger, users can now add watches to feeds they are interested in.
So I've gotten a decent handle on Rails by now but I still struggle in two main areas: Forms and Links in views. It's simply a matter of not knowing which tool to apply where (form_for, link_to, button_to, etc.). Rails has a number of helper methods and it seems like every example I look at implements them differently... Which leads to frustration and me trying a number of different things. I usually know WHAT I need to do (ex. tonight I needed to send a POST containing a new watch to the watches controller) but I struggle with HOW to do build inside a view.
Head colds suck.
So I've gotten a decent handle on Rails by now but I still struggle in two main areas: Forms and Links in views. It's simply a matter of not knowing which tool to apply where (form_for, link_to, button_to, etc.). Rails has a number of helper methods and it seems like every example I look at implements them differently... Which leads to frustration and me trying a number of different things. I usually know WHAT I need to do (ex. tonight I needed to send a POST containing a new watch to the watches controller) but I struggle with HOW to do build inside a view.
Head colds suck.
Saturday, January 24, 2009
OutBlogger and TDD
My RSS reader is working in a fairly simple form. I've tried to engage in test driven development while creating OutBlogger.
Starting from scratch, I've tried following the mantra "write no code unless a test fails." This left me writing tests such as this one:
Starting from scratch, I've tried following the mantra "write no code unless a test fails." This left me writing tests such as this one:
def test_create_duplicate_feedThis test allowed me to write one line of code in the model:
feed_a = Feed.new(:url => "http://feeds.joystiq.com/weblogsinc/joystiq")
feed_b = Feed.new(:url => "http://feeds.joystiq.com/weblogsinc/joystiq")
feed_a.save
assert !feed_b.save
end
validates_uniqueness_of :urlNeedless to say it was a little slow and frustrating at the start. Since then I've adjusted the mantra and am now just coding the easy, boring stuff and using intermittent TDD for interesting stuff. I do keep away from generating generic scaffolds inside the project, as that creates tons of unnecessary code. This mix of quasi-TDD and avoiding the generate command has tidied up my code a great deal and made iterative development much easier.
Monday, January 19, 2009
Outblogger and Users
So Outblogger is taking the form of an RSS/Atom reader, initially.. This makes sense: the ability to read and track feeds is central to what I'm trying to accomplish.
The book I read and wrote about previously mentioned a plugin called restful_authentication, which provides a basic user model and authentication in a RESTful way. It's working out great for my simple application! The restful_authentication plugin is available here.
The book I read and wrote about previously mentioned a plugin called restful_authentication, which provides a basic user model and authentication in a RESTful way. It's working out great for my simple application! The restful_authentication plugin is available here.
Wednesday, January 14, 2009
Restful Design of Outblogger
So I've been playing around with my feed reader, outblogger, for the last couple days. Over Christmas vacation I re-thought the application restfully and have been slowly making those design changes. There's an amazing difference between a restful application on rails and a PB-designed state machine machine on rails. With the former I feel like the conductor of an orchestra; with the latter I feel like a person working the old telephone switchboards...
Wednesday, December 17, 2008
Basic Atom Reader
Tonight I was able to get a basic atom reader going. The major issue that held me up was importing atom libraries in the header:
require 'rss/atom'
Also, Atom and RSS (being a different standards) are parsed differently. Luckily they contain the same basic information that I'm after: title, link, "post date" (updated tag under Atom).
require 'rss/atom'
Also, Atom and RSS (being a different standards) are parsed differently. Luckily they contain the same basic information that I'm after: title, link, "post date" (updated tag under Atom).
Tuesday, December 16, 2008
Basic RSS Reader
Tonight I implemented a very basic RSS parser, which was cobbled together using RSS::Parser functionality. Currently I can read a feed and commit all items in that feed to my db. Downhill from here, right?
Thursday, December 11, 2008
Twerking
Did some design and research on the outblogger idea. Mostly learning about RSS standards....
I found two options for importing an external RSS feed using Ruby:
My favored solution:
RSS::Parser
An additional gem:
feedtools
I found two options for importing an external RSS feed using Ruby:
My favored solution:
RSS::Parser
An additional gem:
feedtools
Wednesday, December 10, 2008
Out Bloggering Blogger
Tonight I had a discussion with a number of people in a project group. We would like to start blogging to keep track of problems solved, ideas, etc. Everyone will have an individual blog and we would also share an overarching blog.
What is the best way to do this? The current, simple option is to each create an individual blog (wordpress, blogger, etc.) and link to each other's blogs. This is incredibly static and un-interactive.
I want to use Rails to create a more interesting front-page to OUR blogs. Blog post of the week, most read articles, most commented on, yadda yadda. COMMENCE BRAINSTORMING AND DESIGN.
What is the best way to do this? The current, simple option is to each create an individual blog (wordpress, blogger, etc.) and link to each other's blogs. This is incredibly static and un-interactive.
I want to use Rails to create a more interesting front-page to OUR blogs. Blog post of the week, most read articles, most commented on, yadda yadda. COMMENCE BRAINSTORMING AND DESIGN.
Subscribe to:
Posts (Atom)
