Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Get your Dockling ideas here

Get your Dockling ideas here
Thread Tools
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status: Offline
Reply With Quote
May 12, 2001, 09:05 PM
 
I think Docklings have an extreme amount of potential and would like to get some discussion going on ideas people might have for them. I know there are a lot of people looking to start programming and these seem like very cool little projects with the possibility of mass appeal.

I've mentioned a stock ticker before.

I'd also like to see a baseball dockling. You can select the game, and the score and inning show up in the dock. A pop-up allows you to see the scores of the other games and also switch between games. This might require some sort of link to a sports site, but I seriously doubt they would have much of an interest in such a thing unless someone just proposed doing it for them. Actually, I'm sure there is some sql database out there that offers up this sort of data. The idea could be enhanced to include whatever sports season happened to be going on at the time.

kman

[This message has been edited by kman42 (edited 05-12-2001).]
     
Admin Emeritus
Join Date: Nov 2000
Location: New Yawk
Status: Offline
Reply With Quote
May 12, 2001, 09:19 PM
 
Moving to Mac OS X Developer. Click through to find your thread.

thanks

------------------
the oddball newsletter
------------------
it's only after you lose everything that you're free to do anything
"Do not be too positive about things. You may be in error." (C. F. Lawlor, The Mixicologist)
     
Addicted to MacNN
Join Date: Mar 2001
Location: Seattle, WA
Status: Offline
Reply With Quote
May 12, 2001, 11:28 PM
 
we don't need docklings! Apple should just move the function to the application icon instead.

just my 2 cents...

------------------
"Imagine the disincentive to software development if after months of work another company could come along and copy your work and market it under its own name...without legal restraints to such copying, companies like Apple could not afford to advance the state of the art."
- Bill Gates, 1983 (New York Times, 25 Sep 1983, p. F2)
The spirit of resistance to government is so valuable on certain occasions, that I wish it always to be kept alive.
- Thomas Jefferson, 1787
     
kman42  (op)
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status: Offline
Reply With Quote
May 13, 2001, 12:03 AM
 
I think it is sort of assumed that application icons and docklings will become one in the same. For instance, everyone agress that the functionality of the iTunes docking should be in the iTunes app icon. However, this doesn't mean that docklings can't be made that serve the specific function of performing a small repetitive task and reporting it graphically via an icon in the dock.

I wasn't trying to suggest that dockling functionality should be unique to something called a 'dockling'. I meant dockling in the larger sense of the word as something in the dock providing feedback , be it a small app that only performs in the dock (the weather, stock ticker, or baseball scores) or the functionality of a large app reporting info or having functionality through its dock icon (iTunes, a list of commonly used email addresses in Mail.app, your current checking account balance in quicken).


Specifically, I was looking for people to suggest ideas for the former, but novel uses for the latter would be appropriate as well.

kman
     
themexican
Guest
Status:
Reply With Quote
May 13, 2001, 01:49 AM
 
1. OT/PPP strip clone for X.

2. TCP/IP activity dockling for high bandwith users.

3. Intruder alert dockling--shows people trying to remote login...maybe with popup of ip's&attempt types. Maybe even with a settable beep.


4. local network chat dockling-pop up shows connected users; selecting one brings up small window for message. When messages come in, icon is changed (like mail app); new messages are availabe from popup.

5. sound level bars- like on a stereo...for when music is playing (should actually be part of the itunes icon...actually the whole itunes dock should be part of the main itunes icon)

6. Finder dockling -replacement for finder icon in dock. Finder dockling icon should indicate whether classic is running by showing half of the face in yellow.

7. background picture dockling--for quick switching of background pix (select them off a list that reflect the contents of a folder)...also allow us to input urls to grab live pictures from the web.

8. app launcher dockling--pop up with apps to launch. Drag on an app it adds to list. Should be able to have a settable title visible in the icon itself. Also multiple instances should be allowed.

9. theme switcher dockling--switch out various extras resources (for those of us experimenting with themes)

10. Favorite websites dockling-plug in a few fav urls. Dockling indicates on the icon when they are changed by checking them periodically.

11. Quick search dockling--I hate sherlock with a passion. Too giant when I just want to find a file. Clicking on the quick search dockling would pop up a search items window. You plug in search items, the window pops back down and a list of hits comes up.

12. Quick search google dockling--same as above except for google.



[This message has been edited by themexican (edited 05-13-2001).]
     
Senior User
Join Date: Feb 2001
Location: Rochester, uk
Status: Offline
Reply With Quote
May 13, 2001, 03:56 AM
 
I'd like docklings to have the ability to pop up anything they want, not just a menu. So many docklings would work better with a slider, picture or other little window.

In fact, now this is in the Developer forum, does anybody think this could be done under Objective-C? How much control do programs get over their dockling?

6. Finder dockling...
8. App launcher dockling
I think the Finder dockling's menu should contain the contents of a folder somewhere in Favourites... just like the Apple menu. But certainly, experience shows that an OS desperately needs SOME form of global hierarchial menu.

11. Quick search dockling
This should be in the finder's toolbar, for finding files. And it should be in a browser's toolbar for the web. And I agree, Sherlock is way too heavy for just finding a file.

All words are lies. Including these ones.
     
Forum Regular
Join Date: Jan 2001
Status: Offline
Reply With Quote
May 13, 2001, 05:02 AM
 
I would like to see a "classic apple menu dockling" A dockling that lists the items in a folder in your user/home.
     
Mac Enthusiast
Join Date: Sep 2000
Location: Vermont, USA
Status: Offline
Reply With Quote
May 13, 2001, 08:31 AM
 
If you put your user/home folder in the dock, clicking and holding will display its contents in a popup menu.
     
kman42  (op)
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status: Offline
Reply With Quote
May 13, 2001, 09:07 AM
 
I really like the idea of the TCP/IP bandwidth/activity monitor and the intruder alert monitor. The latter would be cool on it's own or as part of a software firewall setup (perhaps a GUI front end for the builtin firewall features).

The chat dockling would be a very cool addition to Fire.

By the way, Weatherling just keeps getting better and it looks to be a model dockling very soon. Once they get dynamic icons and some data management features, it will truly rock! Already, it is very nifty.

kman
     
Fresh-Faced Recruit
Join Date: May 2001
Location: Toronto, Ontario, Canada
Status: Offline
Reply With Quote
May 13, 2001, 10:03 AM
 
I think the Finder dockling's menu should contain the contents of a folder somewhere in Favourites... just like the Apple menu. But certainly, experience shows that an OS desperately needs SOME form of global hierarchial menu.
i've seen a lot of people ask for this and it makes me wonder if people realize that you can get a hierarchical menu by dragging any folder into the dock. i have a folder that i've put in my Home directory called "Application Shortcuts," and dragged that folder to the dock. i then made shortcuts to all of the applications i want to quickly access, exactly as i would do in OS 9 by putting those shortcuts in the "Apple Menu Items" folder. i get the following behavior by click-hold or right clicking the folder in the dock:



this behaviour, for all intents and purposes, behaves exactly like the Apple Menu in OS 9 as far as linking to applications goes. personally i prefer this method of using the dock to the apple menu, and i've also done the same thing for documents by dragging my "Documents" folder into the doc (the icon next to the open one in the picture).

i agree with a poster above that you should be able to add additional shortcuts to these folders anywhere in the hierarchy (and copying and moving files as well) by just dragging a file on top of the dock icon and having it open the menu to choose where you want it. but this should really be done with some minor feature changes to the existing behaviour of the operating system, so they should be sent to Apple as feedback.

but at any rate, i see no reason why we need any other "Apple Menu clone" for launching applications now that folders can be used in this way. in fact, this way makes more sense than putting your shortcuts in some obscure folder under the system folder to make them appear in some menu. the Apple Menu was always a hack from day one.

but to stay on topic, i would like to see a "quick search" dockling. i'd also like to see functionality in the terminal icon where you could add often used commands to a dock menu. ie, i could add "ssh myhost.org" and when i select that a new terminal window opens and runs that command.

(PS: yes, docklings and icons really should merge -- that iTunes dockling irritates me how it sits there even when i'm not using iTunes. why wasn't this just put in the iTunes icon?).

- j
     
kman42  (op)
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status: Offline
Reply With Quote
May 13, 2001, 11:04 AM
 
It's been alluded to in some other threads, that the dock APIs don't yet support dockling functionality in app icons. I haven't seen any sort of confirmation of this so perhaps someone who has downloaded the SDK or is actively making docklings could chime in. It seems to make sense though as having a separate iTunes dockling is just plain silly.

However, dynamic app icons do seem to be possible as evidenced by mail.app.

Anyone in the know?

kman
     
Fresh-Faced Recruit
Join Date: Sep 2000
Location: Germany
Status: Offline
Reply With Quote
May 13, 2001, 11:08 AM
 
I don't think you can write docklings with Carbon, which disqualifies iTunes as a dockling provider ;(

------------------
Phure (aka BlackMac.de)
He who knows does not talk - He who talks does not know!
Phure (aka BlackMac.de)
He who knows does not talk - He who talks does not know!
     
Junior Member
Join Date: Sep 2000
Location: Cupertino
Status: Offline
Reply With Quote
May 13, 2001, 02:45 PM
 
i've seen a lot of people ask for this and it makes me wonder if people realize that you can get a hierarchical menu by dragging any folder into the dock

I think people do know about this but find it not to be enough. I have 3 problems, 1) it's a bit laggy 2) no icons (although adding icons would make the lag worse 3) no persistant labels on docked folders.

I don't think people want to clone the OS 9 Apple menu, but the much more functional OS 9 pop-up windows which give two click access to apps suborganized with labels. The labels are the real key because you can actually see the cateogies at a glance.

The maddening thing about folder in the dock is that they are unlabeled. This is fine if you have 10 or 20 apps, but I literally have about 20 for each category (apps, graphics, web, music, utils, resources, documents). I have a similar number of apps on my windows machine and I'm getting there in OS X and I've never found a system more efficient than OS 9 popups to get at those apps quickly.

Anyway my perfect launcher app would:

1. Show a settable label.

2. Would accept dragged in apps (just like the dock proper)

3. Could have multiple instances (so we could have one labeled "graphics" and another labeled "web" and so on).

+++++++++++++

-like the stock ticker idea

-love the tcp monitor idea and the firewall monitor idea

-love the idea of a finder dockling with an icon that shows whether classic is running or not. Not knowing at a glance whether classic is up is sort of annoying.

-love the local quick search dockling idea
     
kman42  (op)
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status: Offline
Reply With Quote
May 13, 2001, 04:26 PM
 
How about this for a wacky idea?

I just realized that I have a habit of opening a new browser window for each forum that I read if there is an active discussion and then minimizing them all into the dock. Then I sort of switch around and reload to see if any of them have been updated.

Wouldn't it be cool if minimized browser windows got a little green light on them or something whenever the page is updated (checked every 5 minutes or something)? This shouldn't be any more difficult than mail.app's little red circle. The Omni guys would just have to make minimized windows check for updates every so often and then change the icon. Should be possible; IE has subscriptions that get checked periodically.

kman
     
kman42  (op)
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status: Offline
Reply With Quote
May 13, 2001, 06:48 PM
 
Okay, I have another one. When Fetch is done downloading or uploading a file, the dog in the icon should bark, jump out of the dock and do a back flip like the Dogcow!

This is actually a general principle veiled in humor. Since we now have a multitasking OS, it is going to become much more common for us to start tasks running in the background. It will be important to be able to have optional signals that indicate the task is complete.

kman
     
Senior User
Join Date: Feb 2001
Location: Rochester, uk
Status: Offline
Reply With Quote
May 16, 2001, 05:35 AM
 
Originally posted by kman42:
How about this for a wacky idea?

I just realized that I have a habit of opening a new browser window for each forum that I read if there is an active discussion and then minimizing them all into the dock. Then I sort of switch around and reload to see if any of them have been updated.

Wouldn't it be cool if minimized browser windows got a little green light on them or something whenever the page is updated (checked every 5 minutes or something)? This shouldn't be any more difficult than mail.app's little red circle. The Omni guys would just have to make minimized windows check for updates every so often and then change the icon. Should be possible; IE has subscriptions that get checked periodically.

kman
Okay, this is a little off topic, but go look at Netcaptor for the PC. I think it's the only browser right now, for any platform, that doesn't suck. It has tabs along the bottom (or wherever) for each page, and with little red/yellow/green bullets to show what status each page is.

All words are lies. Including these ones.
     
Junior Member
Join Date: Oct 2000
Status: Offline
Reply With Quote
May 20, 2001, 04:06 PM
 
Originally posted by sadie:
Okay, this is a little off topic, but go look at Netcaptor for the PC. I think it's the only browser right now, for any platform, that doesn't suck. It has tabs along the bottom (or wherever) for each page, and with little red/yellow/green bullets to show what status each page is.

Ugh.. What are all those buttons? I have 5 buttons on iCab (back, forward, reload, source, and stop), why do I need all that stuff? It's the difference between WinZip and Stuff-it.. Neither app is perfect, but the interface on WinZip drives me nuts..

This is a developer forum right? How about a little app that checks the links in a simplified bookmark file every so often, displays a number (like mail.app) related to the pages that have been updated since your last visit, and then when you click the pop-up menu it lists the updated pages. Clicking one of the updated pages pops open the page in your browser of choice (Note: you could have the app download the page every few minutes and then feed the cached page to the browser to speed things up)..

On a side note: doesn't OmniWeb check the current page every few minutes and reload updated pages automatically? I know the earlier versions did this..
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
May 21, 2001, 01:50 AM
 
Originally posted by kman42:
Okay, I have another one. When Fetch is done downloading or uploading a file, the dog in the icon should bark, jump out of the dock and do a back flip like the Dogcow!

This is actually a general principle veiled in humor. Since we now have a multitasking OS, it is going to become much more common for us to start tasks running in the background. It will be important to be able to have optional signals that indicate the task is complete.
Yes, and the dock is the correct place to put these notifications! There's API for this in Cocoa apps, but I'm not sure if Carbon supports it (yet?). That's how PPP connect draws its lightning bolt and Mail its little number-of-new-messages
     
tie
Professional Poster
Join Date: Feb 2001
Status: Offline
Reply With Quote
May 21, 2001, 12:02 PM
 
As a user, I hope that developers make Dock notifications unobtrusive and adjustable. One reason I'm using OS X, even though I still use many Classic applications, is because I'm sick of that ridiculous flashing menu bar. I just can't concentrate on what I'm doing when the menu is flashing, and this annoys me beyond end (especially, e.g., when a mail server is down for a day and my email client just flashes constantly). I think Fetch is another one of those apps that likes to send annoying notifications whenever it can -- so I've stopped using Fetch.

It's fine to have the fetch dog jump once on completion of a download -- but it shouldn't jump more than once. And the user should be able to turn off all animations.
The 4 o'clock train will be a bus.
It will depart at 20 minutes to 5.
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
May 22, 2001, 01:36 PM
 
Originally posted by kman42:
It's been alluded to in some other threads, that the dock APIs don't yet support dockling functionality in app icons. I haven't seen any sort of confirmation of this so perhaps someone who has downloaded the SDK or is actively making docklings could chime in. It seems to make sense though as having a separate iTunes dockling is just plain silly.

However, dynamic app icons do seem to be possible as evidenced by mail.app.

Anyone in the know?
Yes, you can't modify your app's dock menu, but you can change the icon in the dock (like Clock and PPP Connect, too )
     
Forum Regular
Join Date: Apr 2001
Status: Offline
Reply With Quote
May 26, 2001, 05:43 AM
 
I LOVE the idea of a quick find docklet.... hit the docklet, a little window pops up, type in a name, and boom up comes a list of hits.

Please someone make that one.
     
tie
Professional Poster
Join Date: Feb 2001
Status: Offline
Reply With Quote
May 26, 2001, 03:44 PM
 
Originally posted by b*tchy:
I LOVE the idea of a quick find docklet.... hit the docklet, a little window pops up, type in a name, and boom up comes a list of hits.

Please someone make that one.
You know, you used to be able to press command-F. A window would pop up, you'd type in a name, and boom up came a list of hits. Actually, Sherlock still mostly does this, although it only works if you are infinitely patient.
The 4 o'clock train will be a bus.
It will depart at 20 minutes to 5.
     
Dedicated MacNNer
Join Date: Jan 2001
Location: Computer Error: Unknown
Status: Offline
Reply With Quote
May 26, 2001, 04:12 PM
 
Originally posted by Angus_D:
Yes, and the dock is the correct place to put these notifications! There's API for this in Cocoa apps, but I'm not sure if Carbon supports it (yet?). That's how PPP connect draws its lightning bolt and Mail its little number-of-new-messages
Carbon can adjust a program dock icon. A REALbasic plugin was designed for this.
"...Because the people who are crazy enough to think they can change the world,
are the ones who do."
-To the Crazy Ones

     
kman42  (op)
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status: Offline
Reply With Quote
May 27, 2001, 05:43 PM
 
I'm still waiting for my baseball dockling; someone better have one by the allstar break I'm tired of having to check a website periodically for the scores. I'm starting to learn Cocoa just in case no one gets around to it by the time I learn how (3 yrs max). I haven't downloaded the dockling SDK yet. Anyone have an opinion on it?

kman
     
Fresh-Faced Recruit
Join Date: May 2001
Status: Offline
Reply With Quote
May 31, 2001, 08:11 AM
 
Does anybody know if a Dockling has access to mouse-click information, like where the dockling was clicked?

I ask, I really badly want the iTunes dockling to have the controls the minimized iTunes window has (like similar Linux WHARF-lets)

If the mouse-click stuff isn't possible in the dock right now, are we able to change that by any means? (either by modifying the app, editing plists, or lobbying apple

And, where do i get this Dockling SDK you're all talking about?
I can't find it at http://developer.apple.com/sdk/

Thanks,
-Anand
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
May 31, 2001, 01:07 PM
 
Originally posted by anand2:
If the mouse-click stuff isn't possible in the dock right now, are we able to change that by any means? (either by modifying the app, editing plists, or lobbying apple

And, where do i get this Dockling SDK you're all talking about?
I can't find it at http://developer.apple.com/sdk/
It's not possible. You can't modify applications (well you can if you *really* want to, but it's not much fun and would take for ever... it'd be a waste of time, too). Editing plists won't change the functionality of applications (it can occasionally uncover hidden functionality in programs, though). Lobbying apple is the way to go... although I don't think it'd be terribly useful. Dock icons can get so small it's all a bit pointless...

The Dockling SDK is probably the thing that you can get from Stepwise. See here http://www.stepwise.com/Articles/Tec...-03-30.01.html . Not that the Dock APIs are private and subject to change without notice
     
Junior Member
Join Date: May 2001
Status: Offline
Reply With Quote
Jun 5, 2001, 01:30 AM
 
i'm a big fan of Snard, although much of it's functionality can be had simply by making folders with aliases in them and dragging them to the dock. but snard seems more eligant

plus it has the ability to launch an app as root. which can be useful sometimes.
     
Fresh-Faced Recruit
Join Date: Feb 2001
Location: Wolf424
Status: Offline
Reply With Quote
Jun 5, 2001, 03:43 AM
 
Originally posted by geran
:
<STRONG>I would like to see a "classic apple menu dockling" A dockling that lists the items in a folder in your user/home.</STRONG>
and :
Originally posted by macrophyllum
:
<STRONG>If you put your user/home folder in the dock, clicking and holding will display its contents in a popup menu.</STRONG>
Sure macrophyllum, but it does not well. I like the idea of instant access with popup menus from the Dock. I know I can put my Home folder in the Dock. I do it and I complete it by puting links to "Applications" and "Applications (Mac OS 9)" in my Home folder so I have access to all usable features in my system with one click.

But I am tired of "ctrl-click" or "click & hold" on it. When I don't pay much attention, I simply click and... it opens a Finder window.
1- I want one little click and it immediately shows its contents.
2- I want it on the left, near the Finder icon in the Dock.

I think it would be very simple, it is just a dockling with a link to Home folder in a popup menu.
     
Fresh-Faced Recruit
Join Date: Jan 2001
Location: London, UK
Status: Offline
Reply With Quote
Jun 5, 2001, 04:55 AM
 
As a web developer I would like to see the following docklets:

Stop, Start, Restart, View Logs for Apache, possibly also viewing server-status output

ditto FTP and Mysql

Having to fire up the whole Prefs application, is overkill for this (as with Sherlock for a Google search, I'd like that docklet too)

I may even have time to investigate this myself looking at StepWise's SDK, but Id appreciate it if someone has the time to do this (Tenon have a similar docklet that only works with their iTools)
     
Addicted to MacNN
Join Date: Mar 2000
Location: London, UK
Status: Offline
Reply With Quote
Jun 5, 2001, 01:07 PM
 
I'll add it to my "ToDo -- if i can be bothered and have some free time" list
     
Fresh-Faced Recruit
Join Date: Feb 2001
Location: Wolf424
Status: Offline
Reply With Quote
Jun 6, 2001, 05:41 AM
 
OK. I have the feeling that many people, including me, ask for docklings but a few actually make some.

So I have decided to make mine myself. I am not a developer though, just a webdesigner, I have very little knowledge in programing.
I want a dockling that behaves like the Start button of the Windows task bar. For example it would popup these items, with popup menus for each of them :
- Applications
- Applications (Mac OS 9)
- Documents
- Pictures
- Movies
- Music
...

It is a kind of cross between Home folder and an App launcher.
There is already a dockling with these capabilities, called Snard.
But Snard is difficult to "administrate" if you continuously add and remove Applications to your system : you must indeed manually add or remove them to the Snard configuration.
(I am not blaming them, cause Snard is in fact powerfull)

My dockling idea is a little different and simpler : You add a folder to it (ex: Applications). Then no matter if you add a bunch of apps, they will automatically appear in Start -&gt; Applications.
We are near the original Apple Menu here
     
Fresh-Faced Recruit
Join Date: Feb 2001
Location: Wolf424
Status: Offline
Reply With Quote
Jun 8, 2001, 09:30 AM
 
So far I managed to display the name of the folders (but not their icon) in the popup menu ahead of my Start Dockling.

I use Project Builder with the "Recent Items Dockling" example source code found at Stepwise.

My dockling reads the contents of a plist file, where the paths to the displayed folders are stored.
(for those who understand, in this plist I use an Array called "items" in which there are several Strings "0, 1, 2,..." with the appropriate path for each folder)

I have a problem with this :
I don't know how to make cascading developing menus (popup) from the displayed folders. Something like Start -&gt; Applications -&gt; OmniWeb
My Dockling displays the name of my folders. If you click on Applications it opens a Finder window, this works well.
But I cannot go further Applications and see its contents cause I don't know how to implement this.

I will peel different existing docklings to try reverse coding
     
kman42  (op)
Professional Poster
Join Date: Sep 2000
Location: San Francisco
Status: Offline
Reply With Quote
Jun 10, 2001, 09:02 AM
 
Attention Baseball Fans!

Okay, I've decided to make a dockling to display baseball scores. I expect that this will take me quite a while since I am only on page 200 of 'C Primer Plus'! It is quite likely that I won't even finish it before the World Series, but I'll give it my best shot. I'm going to start with simply displaying the score of the current Padres game as that is my team. I would like to expand it to display any game the user wishes in the dock and have the rest of the scores in a pop-up menu. Eventually, I'd like to have docklings for all of the major sports.


I'm starting with the template from Stepwise as that seems the best way to learn about docklings.

Here's my question: does anyone know a good source for extracting scores? There are the obvious sources like ESPN.com, but that seems like a moving target. I think it is possible to pull down the text of an HTML page and then search for the team names and get the scores, but if they change the format of their page, then I would have to modify the dockling. Is there a service that presents sports scores in a standard way similar to how NOAA broadcasts the weather?

Thanks,
kman
     
tie
Professional Poster
Join Date: Feb 2001
Status: Offline
Reply With Quote
Jun 13, 2001, 07:37 PM
 
kman, I don't know of any scores broadcaster. One way of making your dockling more robust would be to have it takes scores from several different sites. Then if one site changes their format all of a sudden, the others will still work. However, I guess it's possible that around the World Series all the sports sites will change their formats, so this might not work perfectly.

I typed up some perl code which takes the scores from cnnsi and prints out the various scores as follows:

INTERLEAGUE
Bottom of the 4th
Mets 0
Orioles 5
Bottom of the 5th
Marlins 1
Red Sox 0
Top of the 4th
Brewers 0
Indians 2
POSTPONED
Mariners 0
Rockies 0
Top of the 5th
Pirates 0
Tigers 2
Bottom of the 4th
Expos 3
Yankees 3
Top of the 4th
Braves 1
Blue Jays 6
Top of the 5th
Phillies 1
Devil Rays 2
Bottom of the 1st
Reds 1
White Sox 3
Top of the 2nd
Cardinals 1
Royals 3
Top of the 2nd
Astros 0
Twins 0
Athletics 0
Padres 0
Angels 0
Giants 0
Rangers 0
Dodgers 0
AMERICAN LEAGUE
NATIONAL LEAGUE
Cubs 0
Diamondbacks 0
So here's the code:

<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>#!/usr/bin/perl -w
## baseball.pl
## reads the baseball scores from CNNSI

use Socket;
use FileHandle;

my ($host, $port) = (<font color = red>"sportsillustrated.cnn.com"</font>, <font color = blue>80</font>);
my $path = <font color = red>"/baseball/mlb/allgames/scoreboards/today.html"</font>;
my $err;

$err = Connect(SOCK, $host, $port);
<font color = green>if</font> ($err ne <font color = red>""</font>) {
print <font color = red>"- $err\n"</font>;
exit(<font color = blue>0</font>);
}

print SOCK <font color = red>"GET http://$host$path HTTP/<font color = blue>1.0</font>\r\n\r\n"</font>;</font>
$/ = undef;
my $response = &lt;SOCK&gt;;
$/ = <font color = red>"\n"</font>;
close(SOCK);

## get rid of all the excess whitespace
$response =~ s/[\r\n]+\s*/\n/g;
$response =~ s/[\t ]+/ /g;

$response =~ /&lt;br clear=all&gt;/i;
$response = $'; ## trash the header

$response =~ /&lt;TABLE WIDTH=<font color = blue>300</font> BORDER=<font color = blue>0</font> CELLSPACING=<font color = blue>0</font>
CELLPADDING=<font color = blue>0</font>&gt;/i;
$response = $`; ## trash the tail

$response =~ s/&lt;[^&gt;]*&gt;<font color = brown>//g; ## delete all tags</font>
$response =~ s/&nbsp\;<font color = brown>//g; ## delete tabs</font>
$response =~ s/Listen Now<font color = brown>//g;</font>
$response =~ s/Listen|Box<font color = brown>//g;</font>
$response =~ s/\d+d+ [AP]M<font color = brown>//g;</font>
$response =~ s/\w*\|<font color = brown>//g;</font>
$response =~ s/\nR\n/\n/g;
$response =~ s/[\r\n]+\s*/\n/g; ## lose the extra whitespace

$response =~ s/(\w+)\n(\d+)/$<font color = blue>1</font>\t$<font color = blue>2</font>/g;

print $response;
exit(<font color = blue>0</font>);


## Connects a socket to input host, port
## Returns an error string on error, or <font color = red>""</font> on success
## usage: $err = ConnectSocket($sock, $hostname, $port);
sub Connect {
my ($sock, $hostname, $port) = @_;
my ($ipaddr, $sockaddr);

## Look up the hostname to get its IP addr
$ipaddr = inet_aton($hostname) &#0124;&#0124; <font color = green>return</font>(<font color = red>"ERR Bad host"</font>);

## Make a socket addr out of the IP+port
$sockaddr = sockaddr_in($port, $ipaddr);

## Create the socket
socket($sock, PF_INET, SOCK_STREAM, <font color = blue>0</font>) &#0124;&#0124; <font color = green>return</font>(<font color = red>"ERR Bad connection"</font>);

## Set the socket to be unbuffered
autoflush $sock, <font color = blue>1</font>;

## Connect the socket
connect($sock, $sockaddr) &#0124;&#0124; <font color = green>return</font>(<font color = red>"ERR Bad connection"</font>);

<font color = green>return</font>(<font color = red>""</font>);
}</font>[/code]

It's not very robustly written since it basically works by removing the unwanted junk -- rather than looking for the information we want. But it's a start. (To try this script, copy it into BBEdit, change the line breaks to UNIX style and then run it in the Terminal 'perl baseball.pl'. You can also call the script from ObjC and read in it's output.)
The 4 o'clock train will be a bus.
It will depart at 20 minutes to 5.
     
tie
Professional Poster
Join Date: Feb 2001
Status: Offline
Reply With Quote
Jun 13, 2001, 07:50 PM
 
Okay, I don't want to edit that last message since it is so messy, but I just realized that you should remove line 38
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>$response =~ s/\d+d+ [AP]M//g;</font>[/code]
You should also change line 43 to
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>$response =~ s/(\w+)\n(\d+)\n/$<font color = blue>1</font>\t$<font color = blue>2</font>\n/g;</font>[/code]
With these changes, the last few lines of the output are
...
Bottom of the 3rd
Astros 0
Twins 0
10:05 PM
Athletics 0
Padres 0
10:05 PM
Angels 0
Giants 0
10:10 PM
Rangers 0
Dodgers 0
AMERICAN LEAGUE
NATIONAL LEAGUE
10:05 PM
Cubs 0
Diamondbacks 0
as they should be.
The 4 o'clock train will be a bus.
It will depart at 20 minutes to 5.
     
tie
Professional Poster
Join Date: Feb 2001
Status: Offline
Reply With Quote
Jun 13, 2001, 07:54 PM
 
Also, the line with comment "## delete all tabs" was printed incorrectly by UBB. It should read
<BLOCKQUOTE><font size="1"face="Geneva, Verdana, Arial">code:</font><HR><pre><font size=1 face=courier>$response =~ s/& nbsp\;//g;</font>[/code]
except with the space between & and nbsp removed.
The 4 o'clock train will be a bus.
It will depart at 20 minutes to 5.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 10:05 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2