a thoughtful web.
Good ideas and conversation. No ads, no tracking.   Login or Take a Tour!
comment by Kaius
Kaius  ·  4050 days ago  ·  link  ·    ·  parent  ·  post: A Big Family, at the Beach

hmm, I guess the URLs are slightly different so I didn't get the 'duplicate post' message.





insomniasexx  ·  4050 days ago  ·  link  ·  

Yeah no worries. It happens a bit especially with paginated articles. I prefer to read mine as one page so I usually end up posting that link. I don't know if there is a way to include those types of ?parameters in the duplicate post search.

Kaius  ·  4050 days ago  ·  link  ·  

mk would probably need to implement URL normalization and comparison. As you say if you compare the 2 urls we submitted they only differ by the querystring parameters: http://www.newyorker.com/reporting/2013/10/28/131028fa_fact_... http://www.newyorker.com/reporting/2013/10/28/131028fa_fact_...

A piece of c# code that might be a good start would be:

  int endIndex = url.IndexOf("?");
  if(url.indexOf("#") > -1 && url.IndexOf("#") < endIndex) // catch those inpage bookmarks.
      endIndex = url.IndexOf("#");
  
  string urlToCompare = url.SubString(0,endIndex).ToLower();  //search db for this
Actually I'm pretty sure the Framework has way of comparing URI's which would work better than this.

God know what the lisp equivalent is...

mk  ·  4050 days ago  ·  link  ·  

Thanks. Yes, disregarding the query string is very doable. It's low-hanging fruit on the to-do list. I'll pick it soon.

insomniasexx  ·  4050 days ago  ·  link  ·  

You need to wrap the username in @ symbols to complete the shoutout. :)

mk forwardslash