Greasemonkey Script linking to Wiki (in General)


Salketer [big bucks] December 10 2009 7:10 PM EST

Hi everyone, has you might have read in the thread "Additions to CB", I am currently working on a script to add a tooltip on the item names displaying the wiki informations.

The project's back-end is almost fully done (some code clean-ups and commenting) and I will be finishing the front-end scripts before next week hopefully.

I am currently looking for a webserver on which I could host the back-end (using PHP, no database needed) for a small amount of time. My company is having major harddrive problems these days so it would not reflect the expected reliability. The script will not be distributed on a large scale while being hosted on another server than mine, it will be mostly for testing and debugging.

Please post comments, suggestions, and more.

AdminNightStrike December 10 2009 7:28 PM EST

Shade has cbstuff.nl and Verifex has defhoboz.biz (not to speak for them, but I'm sure they would be helpful...)

AdminQBVerifex [Serenity In Chaos] December 10 2009 7:29 PM EST

I don't want to rain on your parade, but making an external database of this info outside of CB might not be the best idea especially in this day and age of constant change. The greasemonkey script should be self-contained and intelligently access the wiki page directly as it finds it on the page. That being said, if you want, I could work with you to add tool-tips onto equipment on CB directly. I think everyone could get behind that.

Salketer [big bucks] December 10 2009 7:36 PM EST

Veriflex, the Front-End supports 2 methods for fetching the information. First one being the method you specified assuring a freshly parsed data and the second one using an internal database updated whenever it automatically finds a new update.

While the first method would be preferred for the exactitude of the data, it would require more resources and more bandwidth than the second method.

Before you remind me that the wiki pages are very light and that the CPU usage wouldn't be noticed at all, I prefer giving both options to the users.

AdminQBVerifex [Serenity In Chaos] December 10 2009 8:04 PM EST

Because the data you are retrieving is coming from either one online source or another online source, what exactly does the user gain from picking a source other then CB to retrieve the data? Certainly not speed, and definitely not stability. Have you considered maintaining a cached copy of the wiki data in the users browser itself? This is a totally acceptable solution considering the amount of data in question.

When a user hovers over an item for the first time, the data is parsed from CB, and cached in the users browser data store along with an expiry time. (Like a cookie but more advanced). Then when the user hovers over a piece of equipment it shows the cached version unless it has expired.

That being said, you can also add the tooltips directly into CB itself, without greasemonkey or anything involved, if you'd like to do that we can totally add your code to CB if Jon/NS wants to.

Demigod December 10 2009 8:25 PM EST

Thanks for the work, Salk. Hopefully this feature will be what I expect, and it stands a chance of being adopted into the game.

Salketer [big bucks] December 10 2009 9:08 PM EST

Well, I am very new to GreaseMonkey and I don't know anything at all about the caching possibilities on it.

Currently, the plan is to keep the item database as an object inside the greasemonkey script. The script version is checked every now and then to grab updates if there are any. The server uses the RSS from wiki to see if any changes have been made and to what, if something has changed, update that part and the script.

The best would be actually to implement it directly into CB, of course but I doubt Jon or NS would want to give me access to the script to make the change, and it is pretty hard for me to design something without having any idea about how the website currently works.
This thread is closed to new posts. However, you are welcome to reference it from a new thread; link this with the html <a href="/bboard/q-and-a-fetch-msg.tcl?msg_id=002wuV">Greasemonkey Script linking to Wiki</a>