Discussions » Creation Requests

A much needed filter for wordpress.org plugin search

kms
§
Posted: 2014-06-04

A much needed filter for wordpress.org plugin search

Anyone who has visited the wordpress.org site knows that the plugin search filtering is atrocious. A userscript that could handle filtering by rating, date, downloads and number of reviews would be a godsend. The site is very active, as many individual plugins have several million downloads.

I have been looking at this script to use as a model:

http://userscripts.org:8080/scripts/show/122076

I think it could be modified easily, but my coding skills are non-existant. I'm sure that someone competent could develop something more robust without much difficulty.

It pretty much looks it is comes down to parsing this page:

http://wordpress.org/plugins/search.php?q=*************&sort=***************

And primarily this field, where all of the useful info is listed:

  • Version: 1.3.0
  • Updated: 2014-4-17
  • Downloads: 98,808

  • Average Rating:
    4 stars
    (88)

  • Authors: Frank, Inpsyde GmbH

The 'width' item is the more accurate un-rounded weighted average rating, which is converted to the rounded "4 stars" Exactly 5 stars is 92, exactly 4 is 73.6, etc.

Anyway, I would love to have such a script, and I think it is both relatively simple for someone skilled and could draw a lot of interest to this site.

Thanks!

kms
§
Posted: 2014-06-04

I threw in a bunch of these ' so you can see the coding


<'ul class="plugin-meta"'>
<'li'><'span class="info-marker"'>Version:<'/span'> 1.3.0<'/li'>
<'li'><'span class="info-marker"'>Updated:<'/span'> 2014-4-17<'/li'>
<'li'><'span class="info-marker"'>Downloads:<'/span'> 98,808<'/li'>
<'li'>
<'span class="info-marker left"'>Average Rating:<'/span'>
<'div class="star-holder"'>
<'div class="star-rating" style="width: 87.216px"'>4 stars<'/div'>
<'/div'>
<'span class="ratings-count" title="Rating based on 88 reviews" style="margin-left:4px;"'>(88)<'/span'>
<'/li'>
<'li style="clear:left;"'><'span class="info-marker"'>
Authors: <'a href="//profiles.wordpress.org/bueltge/"'>Frank<'/a'>, <'a href="//profiles.wordpress.org/inpsyde/"'>Inpsyde GmbH<'/a'><'/span'><'/li'>

<'/ul'>

§
Posted: 2014-06-05

Some random thoughts for you:

When I search on wordpress.org, I only get 8 results per page: http://wordpress.org/plugins/search.php?q=backup&sort=

There does not seem to be any feature to submit additional criteria to refine the search, nor do a I see a way to specify the number of results you want. This is sad, because there's no point in sorting/filtering 8 results at a time. You would need to compile several pages of results before it gets interesting. Perhaps make 4 more AJAX requests in the background to build up a Top 40 by relevance, which you then could sort in the page by the criteria of interest?

If I run the same search in the control panel (separate site, not on wordpress.com hosting), I get a lot of results per page, but some information is missing (download count) or harder to see (number of ratings is in a title tag). While learning the API (documentation is a challenge to find) and driving queries through your control panel seems ideal, I suspect that would end up being a PHP project, which is something I have not learned in much detail.

http://codex.wordpress.org/WordPress.org_API#Plugins_API

P.S. userscripts.org seems completely dead at the moment. Hopefully you downloaded or installed whatever that other script was so you have it for reference.

kms
§
Posted: 2014-06-05

Jefferson:

Thank you for replying. I have seen several of your scripts, and greatly respect your skills.

I've attached the script I mentioned above, and I believe it already handles the requirements you've mentioned, albeit for a different site. You set minimum requirements for ratings, number of ratings, etc, and it scrapes 5 page at a time, filtering out the failures, until you get a full page of results.

// @name AppShopperSmarter
// @description Extends AppShopper to display images from browse pages, plus automatically filter out apps based on minimum number ratings and minimum average ratings. Also loads five pages at a time, supports hiding apps indefinitely.

It appears to my unskilled self that merely tweaking the captured fields should be nearly enough to make it work, e.g. scrape this

var apps = page.find('ul.plugin-meta li');
instead of:
var apps = page.find('ul.appdetails li');

It appears to be only a few tweaks, but again, I freely admit I could be grossly underestimating.

If you or anyone else cares to, feel free to check out the attached script. It's quite small and does the job.



Thanks again!

PS:hopefully the original author won't be upset that I have posted it here (not named in the script)

§
Posted: 2014-06-05
Edited: 2014-06-05

Thank you for your kind comments.

That script uses jQuery, so adapting it does require some knowledge of that library. (Mine is minimal, unfortunately.)

There is no license specified, so if portions of the code need to be re-used, it would be a good idea to contact the author, maybe through his Github account? https://github.com/igmcdowell/AppShopperSmarter (Github is another thing I'm not that familiar with...)

Post reply

Sign in to post a reply.