Automated Rosetta Stone?

Discussions about the forum and contents
Post Reply
User avatar
Topic Author
mas
Posts: 1461
Joined: Tue Feb 20, 2007 12:54 pm

Automated Rosetta Stone?

Post by mas » Thu Feb 07, 2008 5:23 pm

I was recently inspired by this thread:
http://www.diehards.org/forum/viewtopic.php?t=12522

Now I know myself (lazy), and have probably contributed to the problem. I also know that even if I try REAL hard, I'm not likely to follow the policy to the letter. Most new users probably don't even know that there is such a document.

NOTE: the following describes a solution that has never been put into use, but posts later in this topic describe a solution that can be used.
Being a programmer, Murray Boyd's suggestion hit home... "Well of course, why not use technology to solve the problem", I though. So I went off and made a simplistic phpBB mod that seems like it will fit the bill. Of course I don't administrate this board, or dictate its policy, but I figured "build it and they will come".
So now its time to decide if what I've done is useful, and if our gracious hosts (Alex?) would be willing to install and run it. There is a chance that security and/or performance constraints would rule this out entirely, but I'd hope to be able to work around those.

Just as a preview, check out this page:
http://mas.xtreemhost.com/ticker_descri ... ic.php.htm
It is not actually live, so don't bother clicking any of the links, but notice the ticker symbols with dotted underlines. If you put the mouse over them, there should be a tooltip with some additional info.

A few notes/limitations of this initial version:
* I have pre-loaded definitions for all of Vanguard's investor and admiral funds, as well as ETFs
* Any other funds will be detected during the posting process and the name retrieved from yahoo finance
* The names from yahoo finance, unfortunately are somewhat poor (truncated?)
* Only the name can be retrieved automatically, not the expense ratio
* Expense ratios (and names) are never automatically updated, so they could become stale over time
* there is no web administration, so any changes will require manual edits to a text file (presumably only Alex can do this)


A few technical details...
This is my first venture into PHP, much less making phpBB mods, so if anyone with experience would like to critique it, it would be appreciated.
I cannot determine what environment diehards.org is running, so I tried to target the lowest common denominator:
* PHP 4.2.0 +
* phpBB 2.0.22
The data is read and parsed once for every page load, I haven't been able to figure out how to cache this in a more global way - so performance in a high load environment is uncertain.
I have submitted the mod to the phpBB mods database, but it may be a few weeks until they 'validate' it - whatever that entails.

Finally the code:
http://mas.xtreemhost.com/ticker_describe/


All comments and feedback are welcomed, keep in mind that this was just put together over the course of a few days, so changes/enhancements are possible down the road. I didn't want to build a large complex system and find out that it wasn't wanted :)
Last edited by mas on Sun Oct 23, 2011 8:46 pm, edited 1 time in total.

User avatar
Mel Lindauer
Moderator
Posts: 30066
Joined: Mon Feb 19, 2007 8:49 pm
Location: Daytona Beach Shores, Florida
Contact:

Post by Mel Lindauer » Thu Feb 07, 2008 5:43 pm

Hi mas:

I put my cursor over the ticker symbols and nothing happened.

Regards,

Mel

User avatar
Topic Author
mas
Posts: 1461
Joined: Tue Feb 20, 2007 12:54 pm

Post by mas » Thu Feb 07, 2008 5:50 pm

Mel Lindauer wrote:Hi mas:

I put my cursor over the ticker symbols and nothing happened.

Regards,

Mel
Hmmm. Thats troubling. It works for me in Firefox 2.0 and Internet Explorer 7. If there is a flaw with my html/css, hopefully someone can suggest an alternate rendering mechanism - currently I use the "title" attribute within a span. Thanks for giving it a whirl at least.

AlohaJoe
Posts: 5075
Joined: Mon Nov 26, 2007 2:00 pm
Location: Saigon, Vietnam

Post by AlohaJoe » Thu Feb 07, 2008 5:52 pm

You might want to consider using ABBR elements instead, as this is really the use they're intended for.

(Though it works as-is for me.)

User avatar
Topic Author
mas
Posts: 1461
Joined: Tue Feb 20, 2007 12:54 pm

Post by mas » Thu Feb 07, 2008 5:54 pm

AlohaJoe wrote:You might want to consider using ABBR elements instead, as this is really the use they're intended for.

(Though it works as-is for me.)
Wow, I didn't know there was such a thing, thanks.

mikenz
Posts: 780
Joined: Sat Mar 10, 2007 8:33 pm

Post by mikenz » Thu Feb 07, 2008 6:25 pm

Great work, I love it. Maybe a bit of Ajax to fetch the latest quote and chart from Google finance :D (just kidding)

User avatar
Mel Lindauer
Moderator
Posts: 30066
Joined: Mon Feb 19, 2007 8:49 pm
Location: Daytona Beach Shores, Florida
Contact:

Post by Mel Lindauer » Thu Feb 07, 2008 6:29 pm

mas wrote:
Mel Lindauer wrote:Hi mas:

I put my cursor over the ticker symbols and nothing happened.

Regards,

Mel
Hmmm. Thats troubling. It works for me in Firefox 2.0 and Internet Explorer 7. If there is a flaw with my html/css, hopefully someone can suggest an alternate rendering mechanism - currently I use the "title" attribute within a span. Thanks for giving it a whirl at least.
Hi Again mas:

Thanks for your efforts. It works now, but I have to get the cursor aligned properly for it to work. Too low and it doesn't work.

Regards,

Mel

User avatar
Topic Author
mas
Posts: 1461
Joined: Tue Feb 20, 2007 12:54 pm

Post by mas » Thu Feb 07, 2008 8:15 pm

mikenz wrote:Great work, I love it. Maybe a bit of Ajax to fetch the latest quote and chart from Google finance :D (just kidding)
I did consider various bells and whistles, but for now am just targeting something simple and unobtrusive. Something thats there when you need it, but doesn't distract from the conversation. It might makes sense for them to be active links to, say Morningstar's fund page...

User avatar
Topic Author
mas
Posts: 1461
Joined: Tue Feb 20, 2007 12:54 pm

Post by mas » Fri Oct 08, 2010 10:02 am

Clearly this issue is not a high priority or a pressing concern, but I occasionally like to tinker with things like this. Since there hasn't been any traction to get this change on the server (performance concerns are legitimate issue), I have made a version that users can install on their own browser.

Its pretty quick and dirty, but maybe some people will find it useful:
http://mas.xtreemhost.com/ticker_describe/

User avatar
CaliJim
Posts: 3050
Joined: Sun Feb 28, 2010 8:47 pm
Location: California, near the beach

Post by CaliJim » Fri Oct 08, 2010 6:23 pm

..
Last edited by CaliJim on Wed May 11, 2011 12:26 am, edited 1 time in total.

User avatar
nisiprius
Advisory Board
Posts: 39752
Joined: Thu Jul 26, 2007 9:33 am
Location: The terrestrial, globular, planetary hunk of matter, flattened at the poles, is my abode.--O. Henry

Post by nisiprius » Sat Oct 09, 2010 9:10 am

I'm not seeing the tooltips in Safari 5.0.2 running under Mac OS X 10.6.4.

I do see them using Mozilla Firefox 3.5.13.
Annual income twenty pounds, annual expenditure nineteen nineteen and six, result happiness; Annual income twenty pounds, annual expenditure twenty pounds ought and six, result misery.

User avatar
Topic Author
mas
Posts: 1461
Joined: Tue Feb 20, 2007 12:54 pm

Post by mas » Sat Oct 09, 2010 8:05 pm

nisiprius wrote:I'm not seeing the tooltips in Safari 5.0.2 running under Mac OS X 10.6.4.

I do see them using Mozilla Firefox 3.5.13.
Thanks for the bug report. I'd be curious if anyone else has gotten it to work successfully (or not).

For me it works in:
* Firefox 3.6.10 on Win XP
* Firefox 3.5.9 on Win Vista

I don't have a Mac or Safari, and honestly didn't expect it to work there, but maybe it is possible:
http://8-p.info/greasekit/

There is probably a different HTML variation that would make the tooltips work there. Maybe instead of this line:

Code: Select all

    return "<a href='" + tickerURL + str + "' ><abbr class='tickerDescribe' title='" + desc + "'>" + str + "</abbr></a>";
use this:

Code: Select all

    return "<a href='" + tickerURL + str + "' class='tickerDescribe' title='" + desc + "'>" + str + "</a>";

User avatar
Oicuryy
Posts: 1351
Joined: Thu Feb 22, 2007 10:29 pm

Post by Oicuryy » Sun Oct 10, 2010 12:32 pm

mas wrote: I have made a version that users can install on their own browser.

Its pretty quick and dirty, but maybe some people will find it useful:
http://mas.xtreemhost.com/ticker_describe/
Neat! It works in Opera as a user javascript.

The link to the source at xtreemhost redirects to a 404 page. But the Install link at userscripts.org works (right click and Save Linked Content As).

Did you mean to have double quotation marks at the start of the string in this line? That makes quoteXpath an empty string.

Code: Select all

var quoteXpath = ""//td[@class='quote']//text()";
Ron
Money is fungible | Abbreviations and Acronyms

User avatar
Topic Author
mas
Posts: 1461
Joined: Tue Feb 20, 2007 12:54 pm

Post by mas » Sun Oct 10, 2010 2:44 pm

Oicuryy wrote:Neat! It works in Opera as a user javascript.
Thanks. It seems to work in more browsers than I knew.
Oicuryy wrote:The link to the source at xtreemhost redirects to a 404 page.
Clearly a bug. Now fixed.
Oicuryy wrote:Did you mean to have double quotation marks at the start of the string in this line? That makes quoteXpath an empty string.

Code: Select all

var quoteXpath = ""//td[@class='quote']//text()";
No. Thats a bug also.

I have updated the source with this change, and my suggested change for the tooltip in Safari (don't know if it works).

Someone should fire my QA dept.

If anyone wants to add the ajax'y stuff, feel free :)

User avatar
CaliJim
Posts: 3050
Joined: Sun Feb 28, 2010 8:47 pm
Location: California, near the beach

Post by CaliJim » Wed Mar 23, 2011 1:15 pm

..
-calijim- | | For more info, click this Wiki

User avatar
Topic Author
mas
Posts: 1461
Joined: Tue Feb 20, 2007 12:54 pm

Re: Automated Rosetta Stone?

Post by mas » Sun Oct 23, 2011 8:49 pm

Since the forum was upgraded, the script stopped working. There is now an updated version that works with the new forum software.
See: http://userscripts.org/scripts/show/87684

Anyone who had used it in the past needs to visit and re-install the new version.
(this version also has an updated list of ticker symbols, as there have been new funds and ETFs released)

User avatar
Oicuryy
Posts: 1351
Joined: Thu Feb 22, 2007 10:29 pm

Re: Automated Rosetta Stone?

Post by Oicuryy » Sun Oct 23, 2011 9:41 pm

Thanks, mas. I was hoping you would make an update.

Ron
Money is fungible | Abbreviations and Acronyms

User avatar
Topic Author
mas
Posts: 1461
Joined: Tue Feb 20, 2007 12:54 pm

Re: Automated Rosetta Stone?

Post by mas » Mon Oct 24, 2011 7:27 pm

Oicuryy wrote:Thanks, mas. I was hoping you would make an update.

Ron
Well, I'm glad someone is using it :)
You and I may be the only 2.

User avatar
BigFoot48
Posts: 2759
Joined: Tue Feb 20, 2007 10:47 am
Location: Arizona

Re: Automated Rosetta Stone?

Post by BigFoot48 » Sun Mar 08, 2015 12:47 pm

I recently noticed that this ticker symbol lookup script was no longer working in Firefox so I investigated it this morning and found out several things:

1. The website hosting the java script originally created in 2008 by BH mas is no longer in existence. (A mirror of the site is available but does not contain the full script as best I could tell: http://userscripts-mirror.org/scripts/review/87684
2. BH mas has not posted in several years (I have sent him/her an PM and have gotten a reply).
3. I know nothing about java scripts but in looking at the code in Greasemonkey I determined the reason it had stopped working was that BH migrated from HTTP to HTTPS at some point, making a script reference void.
To fix it one needs to open Greasemonkey (Tools>Greasemonkey>Manage User Scripts) and then select the script TickerDescribe and edit line 6 (Options>Edit this User Script), adding the "s" and making it: "viewtopic.php*" (without the quotes).
4. The script probably needs updating for new ticker symbols.

I decided to revive this old thread since it was started by the creator of this very nice tool, and provides some information on its use. It might be useful if the Bogleheads site could host the java script so that events like the demise of a hosting site, or the moving on of the creator won't make the tool also disappear.

For those that don't know what this script tool does, look at the first post in this thread: viewtopic.php?f=1&t=160450 All of the 30 funds listed are underlined for me and I can hover over the symbol and see its name, or click on it load the Morningstar page for the fund. A great time saver!
Retired | Two-time in top-10 in Bogleheads S&P500 contest; 14-time loser

User avatar
Topic Author
mas
Posts: 1461
Joined: Tue Feb 20, 2007 12:54 pm

Re: Automated Rosetta Stone?

Post by mas » Thu Mar 12, 2015 2:04 am

I had not been aware that userscripts.org had vanished.
Maybe this place will be more stable:
https://github.com/mas-bogleheads/TickerDescribe

Direct link (now supports https):
https://github.com/mas-bogleheads/Ticke ... be.user.js

Anyone who cares to enhance or update can collaborate on github...
Or if Bogleheads wants to host it they are free to do so.

Post Reply