I've been pretty fascinated by what's going on at BlogShares lately, so I figured I'd write a little plugin I could use to access my blog's current value.
And here it is. It's not much of a plugin so far, it's mostly just a little hack to download the tracking page for the current (or a given) blog and throw a couple of perl patterns at the results to pull out the data.
Download one of the following files, unpack it, and place blogshares.pl in your plugins/ directory.
It provides the following tags:
- MTBlogShares
- container tag
- takes one optional argument, blog_url, to specify the url to check at BlogShares, which defaults to the url of the current blog
- MTBlogSharesPrice
- The blog's current stock price
- MTBlogSharesPE
- The blog's current P/E ratio
Usage Example:
<MTBlogShares>
Price: <MTBlogSharesPrice><br />
P/E Ratio: <MTBlogSharesPE><br />
</MTBlogShares>
Minor Update: (2003-04-02 13:54)
- Changed the behavior of MTBlogShares. If there is a problem contacting the BlogShares site, MTBlogShares now returns an empty string instead of erroring out. That should fix most people's problems with the plugin and the state of the site at the moment.
Update: (2003-04-04 13:46)
- I added a new container tag, MTBlogSharesUser, that can be used to access data for your account (instead of for your site). It takes one required argument, id, for your user id at BlogShares.
- Within MTBlogSharesUser, you can use the MTBlogSharesTotalPortfolio to access the total vaue of your portfolio.
- I may add other tags this weekend (including what stocks you own, etc), but that's a bit more of a hassle when you're just download a webpage. Hopefully Seyed and I can get the XML spec worked out this weekend, which would a) speed the use of the plugin up some, and b) give me very easy access to the data (instead of having to toss some regular expressions at an HTML page). Cross your fingers.
Usage Example
<MTBlogSharesUser id="1615">
My portfolio is worth $<MTBlogSharesTotalPortfolio>
</MTBlogSharesUser>
Update: (2003-04-20 00:25)
- Changes at BlogShares caused this plugin to break. I fixed it.
- I hope to be including support for some of the new features that Seyed has added recently.
Update: (2003-04-20 02:23)
- I added the following tags to the plugin by request :
- MTBlogSharesAvailable
- MTBlogSharesOutgoingLinkValue
- MTBlogSharesMarketShare
- Working on adding a share owners list to the plugin, but it is proving more difficult than I expected.
Update: (2003-04-22 15:37)
- I fixed the problem with the total portfolio tag. Seems Seyed went ahead and put some crazy things on the BlogShares pages, like commas in the dollar amounts. :)
Update: (2003-04-25 02:56)
- Finally added shares owners to the plugin. To access them use the following tags:
- MTBlogSharesOwners: container tag for the share owners
- MTBlogSharesOwner: the share owner's name
- MTBlogSharesOwned: the number of shares owned
Usage Example:
<MTBlogShares>
<MTBlogSharesOwners>
<MTBlogSharesOwner> owns <MTBlogSharesOwned> shares<br />
</MTBlogSharesOwners>
</MTBlogShares>
Update: (2003-05-01 13:04)
- The changes to the site broke the plugin again. I am working to fix the problem.
Big Update: (2003-05-01 13:18)
- The changes have been incorporated into the plugin. Everything should be working again. If not, please let me know. I'll look into adding some new features when I get home later tonight. But, for now, I need to get back to actual paying work. ;-)
Another Big Update: (2003-05-01 23:52)
- To celebrate the site going out of beta, I've implemented the following general tags for MTBlogShares:
- MTBlogSharesTotalBonds
- MTBlogSharesTotalProjected
- MTBlogSharesTotalReal
- And I've added a new container tag: MTBlogSharesUserRSS. it acts much like MTBlogSharesUser, except that it uses the portfolio RSS feed instead of the user page. If you do not have the XML::RSS perl module available, it and the following tags will not be available.
- MTBlogSharesUserStocks, which is a container tag for the other tags
- MTBlogSharesUserStockName
- MTBlogSharesUserStockNumber
- MTBlogSharesUserStockLink
- The plugin does not currently extract all the information that it possibly could, so if you have a specific request, please let me know and I'll incorporate it into a future version.
Update: (2003-05-06 16:11)
- I added another tag: MTBlogSharesUserStockSiteLink. It's just like MTBlogSharesUserStockLink, except that it returns a link to the actual site (which has been requested / hacked in a number of places already today). Enjoy! :)
Update: (2003-05-09 21:50)
- Updated to account for changes at the site. MTBlogSharesAvailable and MTBlogSharesTotalBonds should work now.
Update: (2003-05-15 10:39)
- For anyone who downloaded the plugin over the last few days, you may want to download it again. Thanks to me being a tad absent-minded lately, you either got a slightly older version if you downloaded it a couple days ago, or you got a broken version if you downloaded it yesterday. The version available now is working and has been verified by myself. I sincerely apologize for any problems I may have caused.
- In other news, the reason that recent copy was broken was because of a new feature I am implementing: MTBlogSharesOwnerSiteLink. For anyone that owns stock in your site, it will return the URL of their home page, if they have one listed in their Blogshares account.
Update: (2003-06-04 00:10)
- Seyed changed the site again. Amazingly enough, the URLs it uses haven't changed.
- MTBlogSharesTotalReal and MTBlogSharesTotalProjected are now considered deprecated. MTBlogSharesWorth replaces them.
- ( drum roll, please ) I have added three important new tags:
- MTBlogSharesOwnerIfSite: if the stock owner has a site
- MTBlogSharesOwnerSiteName: name of the stock owner's site
- MTBlogSharesOwnerSiteLink: url of the stock owner's site
- These three new tags make use of MT::PluginData to cache home page data, so that is now considered a requirement for the plugin.
Update: (2003-06-06 13:54)
- Fixed a bug that occured when the blog's outgoing link value was less than $100. Thanks to Ryan for letting me know.
template_tags=MTBlogShares,MTBlogSharesPrice,MTBlogSharesPE,MTBlogSharesUser,MTBlogSharesTotalPortfolio,MTBlogSharesAvailable,MTBlogSharesOutgoingLinkValue,MTBlogSharesMarketShare,MTBlogSharesOwners,MTBlogSharesOwner,MTBlogSharesOwned,MTBlogSharesTotalBonds,MTBlogSharesTotalProjected,MTBlogSharesTotalReal,MTBlogSharesUserRSS,MTBlogSharesUserStocks,MTBlogSharesUserStockName,MTBlogSharesUserStockNumber,MTBlogSharesUserStockLink,MTBlogSharesUserStockSiteLink,MTBlogSharesWorth,MTBlogSharesOwnerIfSite,MTBlogSharesOwnerSiteName,MTBlogSharesOwnerSiteLink








my hero :)
Awesome! Thanks! :)
sweet! thanks.
Excellent!! Great plugin!! Thanks!
You da man!
No sooner do I wish for such a plugin, but it appears! Thanks!
GREAT WORK!!!
I am VERY VERY impressed. I love it.
BlogShares ROCK!!! I think it is a great idea. I found your post on the MovableType PlugIn forum, and thus your page and the BlogShares page.
Thanks for all this. Your work is really appreciated, and earnt your blog a perm link on my pathetic little blog. :)
One tip. While I expect most users will understand how to use your tags, it might be nice to post an example of how to use your plugin in their template. :)
Keep up the great work.
Hrm — it doesn't like me. Bleah. I keep getting an "HTTP request error" during rebuilds. My code looks like this:
<MTBlogShares>
<blog_url="http://www.djwudi.com/longletter/">
Current value: <MTBlogSharesPrice><br/>
Current P/E: <MTBlogSharesPE>
</MTBlogShares>
Am I goofing something up?
Michael: No I'm getting the same error on rebuilds. Pull the plug-in code in order to get the site to rebuild properly.
The Blogshares site is hosed. Looks like the traffic has made the database barf. A flaw they are aware of (hey, it's a beta).
David: Can you add something to the next plug-in update so it won't error out when it can't connect to the Blogshares site? Sadly, I'm not familiar enough with MT to hack plugins.
I have a question for you about the plugin: when is the cost for the share determined? When the blog is rebuilt? When the page is accessed? I noticed my stock price hadn't changed since I'd rebuilt the site.
Can you do something like this for b2? it's mainly php-tag based instead of this MTblahblah stuff.
Okay, I am confused. It worked after the first rebuild, but now it won't work, even tho it's the same code!!!!
<MTBlogShares>
<blog_url="http://www.bozzysworld.com/">
current price: <MTBlogSharesPrice>
blogshares p/e: <MTBlogSharesPE>
</MTBlogShares>
WTF!!! How come the code didnt show!!! Everybody else got their code to show!!! Why did you stop allowing HTML!!! UGGG This code sucks. It won't show errors, and it won't show what it's supposed to show...it only shows NOTHING.
My code looks like this guys:
Posted by: Michael Hanscom on April 2, 2003 05:36 AM
How the hell did he post his code in here??!?!?!
Does anyone know if you get problems when trying to use this on multiple blogs in the same MT? I have three blogs that are listed, but on BiblioBlog (www.biblioblog.com), everything is coming up as 0. Anyone else have this problem?
Great Plugin!!!
Check It
I made a stand-alone PHP version of your script. So check it out @ http://www.geeklab.net/ellis/more.php?a=23
I had trouble when I tried using the blog_url but I took it out and everything works just fine now.
I've tried it both with and without the blog_url and it's not working for me.
You have to use the "blog_url" as an optional argument of the MTBlogShares container...
<MTBlogShares blog_url="http://yourblog.url">
Then the rest of the code...
Thank you - worked like a charm!!
Fil, that worked perfectly! Thanks!
I'm one of those people where I just can't get it to generate anything, either with or without the blog_url specified.
Cut & Dried:
<MTBlogShares blog_url="http://www.reallans.com/mmml.shtml">
Price: <MTBlogSharesPrice><br />
P/E Ratio: <MTBlogSharesPE><br />
</MTBlogShares>
Any Ideas?
This is great. I love it (and blogshares).. I thought of a tag/information i would fun
Shareholders
it would list those users in blogshares (and links to their blogs?) that own shares of your blog. Could be fun way to add some value to owning your blog :). and fun to see who has bought shares in your blog.
Everyone using the plugin seems to have their blog's worth and sharevalue reset to "0" all day today. Any ideas on this and how to fix it?
http://www.tampatantrum.com/leftovers/003171.html
I seem to have the same problem. Do I have to do anything on my end to fix it as well?
Okay. I'm lost here. Where is the updated version of the plug-in? I re-downloaded the .zip file, and re-installed the .pl in the plugins folder, and still the same problem. Unless I downloaded the wrong file?
Thanks again -- works great! The only thing I had to change was in the hacked version, the available shares tag was "MTBlogSharesAvailableShares". By dropping "Shares" off the end of that, everything works like a charm.
I upgraded and I'm having problems with my portfolio cost showing up and outgoing link value showing as anything but 0. Anyone else having these problems?
I'm having the same problem as Kymberlie, I rebuild the index template and it still says $0. I tried on two different systems and still have that problem.
Hi, I'm having the same problem as the two above. My total portfolio says $0 even though that's not the case. My other Blogshares info from this plugin is showing up fine (share price & P/E).
Any ETA on the shareholders list tag? This is a great plugin. ;-)
Done. Very cool!
What's with the <MTBlogSharesOutgoingLinkValue> part of the plugin?
I can't get it to work...it always says "0"
Anyone know?
most of the time when the plugin doesnt work, it's because BS is still in beta and seyed keeps moving things around so just hold on and wait for the update.
Okay, I have something boogered here. I figure this is cockpit error, but can't for the life of me figure out what is wrong. Here is the code:
<div class="powered">
<MTBlogShares>
Price: <MTBlogSharesPrice><br />
P/E Ratio: <MTBlogSharesPE><br />
Shares Available: <MTBlogSharesAvailable><br />
Outgoing Link Value: $<MTBlogSharesOutgoingLinkValue><br />
Market Share: <MTBlogSharesMarketShare>%<br />
<MTBlogSharesUser id="3977">
My portfolio is worth $<MTBlogSharesTotalPortfolio><br />
</MTBlogSharesUser>
<MTBlogSharesUserRSS id="3977">
<MTBlogSharesUserStocks>
<a href="<MTBlogSharesUserStockLink>"><MTBlogSharesUserStockName></a><br/>
</MTBlogSharesUserStocks>
</MTBlogSharesUserRSS>
</MTBlogShares>
</div>
The problem is that the SharesUserRSS stuff is not working. I just installed XML::RSS from CPAN, so am sure that part is okay, but nothing spits out of there. Also, is it going to spit out the links to each website, or is it going to spit out the link to the BlogShares page for that website? I would like to see it do the former, if it is doing the latter.
Thanks for the May 1st update. I thought it was me and I was going crazy! Great work by the way.
Never mind - I got it working. Looks like I just had to wait for Blogshares to start spitting out data again.
By the way, I hacked the perl script to do the output of the links like I want them to be. Check it out on my site.
Hi David, I am trying to get your plugin to work, but I can't get the RSS information. Surely I haven't installed the XML::RSS perl module the way I should have done it due to my lack of perl knowledge.
I have created the directory extlib/XML/RSS, and placed the files RSS.pm and LM.pm in there. Can you tell me what I did wrong????
This is cool, but what I REALLY want is to be able to have a MTBlogSharesOwnerSiteLink tag so that if someone buys shares of my blog, they get a link to their site.
great plugin - thanks for fixing the bug when blogshares is down, caused me to stop using it, but now its firmly got its place on my blog
Is there any documentation on installing this and the Tags to use? I must be doing something wrong . I cannot get anything to pop up. does this have to be outside all the other Tags? ANy help would be great! please email me. I did install the XML parser and expat and the XML RSS parser not sure if I can find out if they are working but ... ANy help would be great!
Thanks
For some reason I'm having problems with my portfolio information showing. It used to, but now it doesn't. I even updated the plugin and still no go. Anyone have any ideas?
I'm having problems as well. I think it has to do with the perl scripting. If you check out the MT Forum Thread for this plugin I have the errors listed.
I tried pinging here, but I'll post the link to the entry just in case. Basically, MTBlogSharesOutgoingLinkValue isn't working for me. The post URL is here: http://sharp-eyed.us/archives/000132.php. Good luck chasing that Blogshares code!
More comment please? ;)
I cannot get this thing to work. I read that MT 2.6 or higher was required so I upgraded; still nothing. This is the code I'm using:
[MTBlogShares blog_url="http://www.stevemaas.com/selbstbild/"]
Current Price: [MTBlogSharesPrice][BR]
P/E Ratio: [MTBlogSharesPE][BR]
[/MTBlogShares]
(couldn't figure out how to get the code to show so i used brackets instead)
I see only "Current Price:" and "P/E Ratio:" on my page (http://www.stevemaas.com/selbstbild/ - it's on the bottom left).
Any ideas?
I guess you are doing a great job.Thanks for the info.
Will keep visiting your site.
Hey
I tried till now 5 times to setup MT on my XP.I tried to install it in office, it doesn't allow me to do so.Here they say it's advisable not to give FTP acess.
It would be nice if there was some way we could get our cash balance !
Any Blogs you know which are for Wirless devices.Can we setup MT for Wireless networking devices?
On the blogshares site, they say I have a networth of B$55 million, but your plugin reports only B$40, does your plugin take into consideration Idea Bonds and Ideas?
Cash Balance tags please ?? ? ?
Cash Balance tags please ?? ? ?
Cash Balance tags please ?? ? ?
When the blogshares website was experiencing heavy problems (18-20 September) I noticied that my Movable Type site couldn't be rebuilt anymore, due to this plugin! I removed some parts of the blogshares-plugin (about shares and share-owners), then everything worked fine. My total worth was $0 but that was just fine for me.
My question: are some parts of the plugin dependent of the fact that the blogshares website has to be up and running???
Hi :) Would you consider adding user ideas to this? You can pull all the info from the one API page now for individual users which gives shares held, ideas held, net worth, ranking etc etc.. here's a sample:
http://www.blogshares.com/api/user.php?id=5178
cheers :)
Sweet plug-in.
Here's a couple of feature suggestions for you: How about including ranking, ideas, artifacts and industries?
Hi :) Would you consider adding user ideas to this? You can pull all the info from the one API page now for individual users which gives shares held, ideas held, net worth, ranking etc etc.. here's a sample:
http://www.blogshares.com/api/user.php?id=5178
I'm trying to adapt from your script but not having much joy.. :(
Are you going to update this plugin after jay took over b$ and changed stuff around ?
Tried the plugin tonight. Can't get it working. On trying to rebuild the template after putting the tags in, I get:
An error occurred:
Build error in template 'Main Index': Error in MTBlogShares tag:
MT::App::CMS=HASH(0x8361070) Use of uninitialized value in concatenation (.) or string at lib/MT/Builder.pm line 121.
MT version is 2.64
Just installed the plug-in, I've seen it in use on a number of sites. Followed the directions to the letter.
The P/E shows up just fine. The share price and "my portfolio" values just display as "0".
MT 2.66, BTW.
Like the commenter named "dqci", I just installed the plugin and consistently receive a $0 for the price per share. My P/E ration shows up properly.
Any idea what's going on or how to fix it?
FYI, I'm running MT 2.661.