feature request - remove auctions after n days / after x complete auctions

Subscribe to feature request - remove auctions after n days / after x complete auctions 7 post(s), 2 voice(s)

Avatar level20peon 10 post(s)

would it be possible to add such feature ? jbidwatcher becomes quite resource hungry if there are hundreds of items in total in the lists.

Avatar Morgan Schweers Administrator 1,204 post(s)

It does become pretty darn hungry… It should be possible; I just want to get things set up so folks can use my.jbidwatcher.com as an archival of auctions if they want to, before adding stuff that auto-deletes the listings from JBidwatcher’s desktop database.

This is one example of why I wish I had gotten scripting into JBidwatcher; I could give you a quickie script in probably 5-10 minutes which you could add into the scripting edition of JBidwatcher that would do exactly what you want, but my scripting version adds 10MB to JBidwatcher’s size. :( I never came up with a killer feature that would sell folks on the additional weight.

— Morgan Schweers, CyberFOX!

Avatar level20peon 10 post(s)

I have read everything there is about jbidwatcher scripting but due to the lack of documentation I am not able to get a grasp on it. I am currently using an external script to interact with the webinterface, which unfortunately doesn’t have any commands to remove auctions (at least I didn’t find one).
The additional 10MB wouldn’t be a problem for me to “handle”, if there was a manual on how to use it.

Avatar Morgan Schweers Administrator 1,204 post(s)

Let me introduce you to another of the awesome features I never really ended up documenting or exploiting in JBidwatcher…externally triggered events.

curl "http://username:password@localhost:9099/event?name=delete&param={ebay_identifier}"

That triggers an event named ‘delete’, which listens for item numbers and removes them from JBidwatcher. This is actually how the UI deletes items, by throwing them into JBidwatcher’s internal event queue named ‘delete’. There are a dozen or so internal event queues, all handled with Java threads. I built it this way so it would have a responsive UI which would produce queue entries, with all the real work done by named queue consumers. Then, when I implemented the web mode, I threw in a few lines of code (about 6!) which added a hook into the event system via the web interface. It’s amazingly powerful for firing asynchronous events, but also completely unused.

I don’t even have a list anywhere of all the events, and the parameters they take, but here are a few of the important queues…this is the first time I’ve documented this publicly, I believe.

  • Swing – has tons of commands, the processing thread for this runs on the Swing event thread so it can do UI operations safely. Look at UIBackbone.java
  • auction_manager – Just the TIMECHECK option, which tries to sync time
  • browse – Launches a browser to the provided URL
  • delete – Deletes the listing, as above
  • drop – Acts as if a drag-and-drop for the item/URL just happened
  • my – Stuff to support the My JBidwatcher future features
  • redraw – Redraws a listing on the display, refresh a category, update the font, or set the background color. :)
  • sfx – Play a sound effect in MP3 format. :) I never added any triggers, but you can send ‘/audio/bid.mp3’ to hear a sound effect
  • tray – On supported platforms, controls system tray effects (messages, stats, on/off)
  • update – Check for an update
  • user – Everything that you do through a menu goes through this queue, but it’s not really externally scriptable except very simple stuff (complex stuff involves acting on the current selection, and that’s not scriptable; simple stuff is launching various dialogs)

Case is important, all the queues except Swing are lower case.

Not all of the queues accept a string argument, but I think most of them do. I tried to move towards a database-backed queuing system, but I failed as some of the queues couldn’t accept a string argument, and not every data type serialized well, so I backed those changes out a while ago.

To be clear, what you do is request

curl “http://user:pass@localhost:9099/event?name={queue}&param={string}”
to put the event on the queue. (I put it in quotes and a curl statement so the forum software wouldn’t auto-URL-ify it. It works just as well from a Ruby script or some-such.)

Hope that helps in some way!

As for the scripting layer, I’ve been thinking more about how to offer it as an add-on, for folks who want the extra power. I truly suck at documentation, preferring to show example code over extensive documentation. I’ll see what I can do, though.

— Morgan Schweers, CyberFOX!

Avatar level20peon 10 post(s)

Thanks for the information.

I am currently using something like

"wget --http-passwd=$pass --http-user=$user --output-document=- --quiet --tries=1 http://$host:9099/addAuction?id=$ID&action=Add+Auction"
to add auctions via external script for example.

Am I understanding correctly that, once scripting is enabled, I also could do (in this very scenario)

"wget --http-passwd=$pass --http-user=$user --output-document=- --quiet --tries=1 http://$host:9099/delete?name=deleteauction&param=$ID"
or am I getting it wrong ? I tried this approach but it returns

“Error: No such auction in list!
Return to auction list.”

What am I doing wrong here ?

PS: I don’t get the formatting options of this forum script… so please never mind the readability of my post.

Avatar Morgan Schweers Administrator 1,204 post(s)

I’m afraid I haven’t communicated clearly; this has nothing to do with scripting enabled/disabled. The capability is built into JBidwatcher already.


wget --http-passwd=$pass --http-user=$user --output-document=- --quiet --tries=1 "http://$host:9099/event?name=delete&param=$ID"

The URL is actually /event, and the queue you want to place an event on is given in the name parameter, with the value you want to inject into the queue being given in the param parameter.

Don’t worry about formatting options; I’ve fixed it up. You can use <pre></pre> to block code out, or highlight code inline with <code></code>.

— Morgan Schweers, CyberFOX!

Avatar level20peon 10 post(s)

I understand. I just thought that the events name would just be some custom name one can choose.

Thanks for your explanation.

If it’s not too much effort, could you post the script you mentioned in your first post in this topic (which would delete old auctions) so I can see your approach ? I would read the logs via script and then trigger an event based on the auction status, which then would delete the respective auctions via url call.

About the forum formatting: Thank you for correcting my post. The help on the right side of the post input field says “bq.” would form a quote which didn’t exactly work out (with or without brakets).