Relevance versus Date Sorting on Craigslist

Archived. To ask for help, please use our new help center.
Locked
FourtyCaliber
Posts: 19
Joined: Fri Sep 28, 2012 3:34 pm

Relevance versus Date Sorting on Craigslist

Post by FourtyCaliber » Tue Nov 26, 2013 10:30 am

Hello. First let me say that this is a GREAT site! I've been using this site for years and years and its the ONLY way to search Craigslist. It makes searching so much easier instead of having to search by individual cities on Craigslist. I don't understand why Craigslist just can't understand that not everything that people want is local and that people often travel pretty far distances in order to buy what they want?! But, I digress.

My question/problem doesn't really have anything to do with SearchTempest. It has to do with Craigslist, so if I posted this in the wrong forum, please move it to where it would be better suited.

Anyways, Craigslist (again) recently made some more stupid changes, IMHO, and they changed their default results sorting to "relevance'. It had been by "most recent date". Now, it sorts by relevance. There is a button to resort the results by date or price. However, the user has to do this every time. For every new search conducted on Craigslist, the sorting reverts back to relevance. There is no user setting for this or no cookie is set for the user's preference. To me, this is highly annoying having to repeatedly re-sort everything I search for.

For the vast amount of Craigslist searching I do, I use SearchTempest. However, there are a few times here and there where I use the Craigslist site just for something very local to me that I am searching for.

I immediately noticed that SearchTempest results for Craigslist still sort by most recent date. I assume you have a script working that re-sorts the Craigslist results automatically to most recent date. Or something to that effect.

I use Firefox and I have Greasemonkey installed. I have been trying to come up with a Greasemonkey script that I can use to change the default behavior on Craigslist search results from "Relevance" to "Date". I haven't come up with anything that works. I am not a coder. I know every little about javascript. I posted in a few forums elsewhere asking for help with this (UserScripts, StackOverflow, Yahoo Answers), but no one has helped me.

I just wondered if you could help me with this since you are obviously so good with coding. Maybe whatever script you are using now to change the Craigslist "Relevance" sorting to "Most Recent Date" sorting on SearchTempest would work.

In the SourceCode of the Craigslist search results page, there a line that I believe needs changed. The line is:

<input type="hidden" name="sort" value="rel">

Sort=Rel comes up in the address of the results page. I don't know how to link in here to the Sourcecode of the Craigslist search.

I just did a select all / copy of the page and saved it as a .doc file and tried attaching it to this message. It won't allow me. If you go to any Craigslist site homepage, then run a search for any item, on the results page you get, you can rightclick and view the sourcecode for the page and you will see the line I stated above.

I have no idea what I need to do to change the default relevance sorting. Any chance for some help? I'd really appreciate it. Thanks

User avatar
Tempest Nathan
Site Admin
Posts: 1371
Joined: Fri Apr 18, 2008 10:06 pm
Contact:

Re: Relevance versus Date Sorting on Craigslist

Post by Tempest Nathan » Tue Nov 26, 2013 1:45 pm

Ha, ok. So you're on the right track with that input. You can indeed change it from "rel" to "date" using greasemonkey. (Something like $('input[name=sort]').val('date');)

However, that won't do anything immediately. That input is part of the search form, so what it does is affects where you end up when you submit the search. So you'd need to make that change on both the search and results pages, so that when you submit the form, it sends the value you want to the results page. If there is no hidden sort input on the search page, you should be able to add one with greasemonkey too. (If you need more help creating the GM script, a GM forum is probably a better bet. I'm no expert there.)

Disclaimer: That said, you may want to check craigslist's terms of use to make sure they allow what you're doing. I'm not making any comment on whether you should do this, just giving advice on how to change a form input using greasemonkey. At SearchTempest we don't touch craigslist's code at all. We get all the info we need from Google, and simply link to craigslist listings (which open in completely separate windows).

FourtyCaliber
Posts: 19
Joined: Fri Sep 28, 2012 3:34 pm

Re: Relevance versus Date Sorting on Craigslist

Post by FourtyCaliber » Mon Dec 02, 2013 7:45 pm

Hey Nathan. Thanks for responding.

I'm not 100% sure what you mean when you say:

"However, that won't do anything immediately. That input is part of the search form, so what it does is affects where you end up when you submit the search. So you'd need to make that change on both the search and results pages, so that when you submit the form, it sends the value you want to the results page. If there is no hidden sort input on the search page, you should be able to add one with greasemonkey too."


I have been on the Greasemonkey site and the Userscript site. Haven't gotten any help. If you haven't been on the Userscript site lately, it is really messed up. There is pages and pages of bogus, possibly virus laden, spam scripts. I posted but nobody has replied.

As far as Craigslist is concerned, there are literally hundreds of other different scripts for Craigslist that do different things on Userscripts. I mean YOU are even changing the sort order delivered as the default from Craigslist. Wouldn't that be against their terms?

I thought Greasemonkey was pretty much just javascript?

Don't the scripts on the Craigslist "site" get "compiled" from "off site" sources when the user uses the Craigslist site? Please excuse my terminology in the previous question as I'm sure its incorrect. But, if you look at the sourcecode there are numerous href statements of various scripts. I don't know if there is a hidden attribute that can be changed on the (homepage?). Is that what you mean by the search page? I have no idea how to create it if there isn't. That has to be where it starts, correct? I know that Greasemonkey allows the user to include any/all necessary pages of a website, so including the homepage in whatever script is being used is not hard. Getting a script that works is, at least for me.

I'll try yours, but you don't seem to have much faith in it based on what you said. Would what you wrote be all that is necessary to accomplish the change?

I've posted on Yahoo Answers and StackOverflow too and haven't had any responses yet either.

Thanks Nathan and I do appreciate your input no matter what.

User avatar
Tempest Nathan
Site Admin
Posts: 1371
Joined: Fri Apr 18, 2008 10:06 pm
Contact:

Re: Relevance versus Date Sorting on Craigslist

Post by Tempest Nathan » Mon Dec 02, 2013 11:38 pm

You are right that greasemonkey scripts are just javascript. I can't comment on the legality of modifying craigslist code on your own computer using javascript. We don't do so; all we do is link to their pages.

The sort order of any craigslist results page depends on an argument in the url. The argument is set by that form field you mentioned. So to change the sort order you need to change that field, then submit the form. Yes, there should be a similar one on the homepage, or you would have to create one. I can't really help more than that. I'm sure if you wanted to though, you could go on freelancer.com or whatever and pay someone $20 to make it for you. It should only take 5-10 minutes or so.

Or you could just use the "Just show links" option in SearchTempest's direct results mode. Would only be one extra click compared to running searches on craigslist directly, and if you want you could get ebay, amazon, and oodle at the same time.

Locked