NerdDinner Web Slice

Mar 23, 2009 at 4:45 PM
I'm interested in putting together a web slice for NerdDinner. I think it makes the most sense to tie it to the search functionality on the site right now. Here are my thoughts:

Design:
- Show the Web Slice icon next to the Popular Dinners title
- The content for the Web slice is a simple list of the matches for your current search.

Implementation:
- The URL for the slice would be /webslice/{encoded_search_term}
- To reduce bandwidth, the resultant view could be an RSS feed: (http://msdn.microsoft.com/en-us/library/cc956165(VS.85).aspx).
    - Downside to this: all styling is inline.
- We can build a simplified XHTML view with linked CSS just for the slice.
- For the time-to-live (TTL), do you think the default of 15 minutes is fine? Better to increase the time between refreshes to 60 minutes or more?

A web slice may be useful for a single dinner, too. That way you could be alerted to any changes in the dinner location, start time or attendees.

Jordan
Coordinator
Mar 23, 2009 at 6:43 PM
Cool idea. I think an hour TTL is cool.
Mar 23, 2009 at 8:36 PM
Shall I just pass in lat/long to the webslice URL, to use the existing DinnerRepository.FindByLocation()? Or are we adding a DinnerRepository.FindByLocation() which accepts a textual search string? I like the idea of /webslice/Redmond+WA, but geocoding is all in the JS right now.
Coordinator
Mar 23, 2009 at 8:50 PM
I'll be checking in a FindByPlaceName this week...

--
Scott Hanselman - Tiny Phone, tiny email

On Mar 23, 2009, at 1:36 PM, JMatthiesen <notifications@codeplex.com> wrote:

From: JMatthiesen

Shall I just pass in lat/long to the webslice URL, to use the existing DinnerRepository.FindByLocation()? Or are we adding a DinnerRepository.FindByLocation() which accepts a textual search string? I like the idea of /webslice/Redmond+WA, but geocoding is all in the JS right now.
Mar 23, 2009 at 8:57 PM
Awesome. I'll focus on other details for now, then.
Mar 25, 2009 at 9:00 PM
I decided to start with a simple web slice for a single dinner. Turned out to be a good idea, for a simple starting point. Looks to me that the most control for styling is to have the web slice content come from a separate URL, instead of trying to use the content already output on the /Dinners/Details/{id} page.

For the slice I'd like to re-use the Dinners controller Details action, but do you think that's overcomplicating things? Maybe better to add a DetailsWebSlice action that can be selected when accessing a URL like /Dinners/Details/{id}/webslice?

Jordan
Coordinator
Mar 26, 2009 at 10:26 PM
That's a good question. It would be nice if it could be incorporated into the existing action. However, details is simple, so you're just talking about a new View?
Mar 26, 2009 at 10:43 PM
Yes, going for a new view. I need a way to differentiate a web slice request from a regular page request via URL. I was thinking I could use /Dinners/Details/{id}#webslice or /Dinners/Details/{id}/webslice. Here's what I have for testing purposes right now:

            routes.MapRoute(
                "DetailsWebSlice",
                "Dinners/Details/{id}/webslice",
                new { controller = "Dinners", action = "DetailsWebSlice", id = "" }
            );

This uses a new DetailsWebSlice action on the Dinners controller which is identical to the Details action, with the exception of the view name. I couldn't get the anchor tag approach working with routing.

In the Details action, I could instead look at the current request URL and choose my view as appropriate.
Coordinator
Mar 26, 2009 at 10:59 PM
Ya, I like the route better. I'll be added a check in soon that will allow /{id} so the URLs will be nicer.
Mar 26, 2009 at 11:15 PM
Cool.

While on the subject of URLs, what do you think would be best for a dinner list url? One thought:

/Dinners/List/Redmond-WA

This would give me a base URL for searches, which I can use for the web slice. Added bonus: deep-link URLs for SEO and for use by site visitors to link straight to search results. Could keep using the Index view, since that's used for Upcoming Dinners right now, but I don't like how this reads as much: /Dinners/Index/Redmond-WA.

Jordan
Coordinator
Mar 26, 2009 at 11:28 PM
Agreed, but I'm still working on this, as each placename like that requires a reverse lookup against a geolocation service. I need to start caching them or find a nice placename TO lat-long database that works for international places also.
Mar 26, 2009 at 11:38 PM
The backend search logic is most definitely the hard part of the puzzle. I've done this on at least two different projects, but always for US searches only and using data that came from MapPoint geocoding. Since it's unrelated to getting a simple web slice going, I'll start another thread regarding this geolocation work if I find anything that may help you.
Coordinator
Mar 26, 2009 at 11:43 PM
Cool. Give me a day or two to commit what I've got, then work from there.