Categories
Weblogging

Pebbles

A couple of things:

Thanks to both Squidblog and Pharyngula for the eye opening explanation behind numerous sea monster sightings. Leads one to wonder what could be behind Nessie?

We found out that our panel at SxSW will be on Sunday around noon. High noon in fact, which Kathy will appreciate:

I’m also doing a panel at SXSW with Dori Smith, Shelley Powers, and Virginia DeBolt on “Why are women invisible on the web: whose butts should we be kicking?” As many of you know, I don’t even agree with the premise of the title (I’m a woman, I certainly am not invisible on the web), and I have intense disagreements about this with the other women on the panel, so… it should be a rather festive panel ; ) (I’m thinking smackdown) I have to hand it to Dori, of whom I’m a big fan, for putting together a panel that offers differing perspectives.

Smackdown! Love it.

I think Kathy and others will be surprised. I had an epiphany about this issue on the train ride out to Idaho. Anyway, March 12th in Austin — you can buy us margaritas after.

Categories
Travel

Puddles

I could wish that the weather was a little less wet as I’ve not been able to get out much. I hope to visit the town where I was born and raised on Thursday. I will have to settle for Thursday as the rest of the time the weather promises rain or snow, or rain and snow. Oh well, I’m here to help my Mom anyway, and the weather keeps me home and helpful. Too helpful perhaps as even my mother has mentioned, wistfully, once or twice that isn’t the weather nice enough for me to go on a walk? Yet?

My mom’s two poodles like me. They’re tiny puffballs, and yes, they do yap. One is an apricot, the other white. They’re very affectionate, but the white one doesn’t feel good sometimes; when you pet her, most of the time she leans into you and cuddles; a few times though, she has turned on me and bit me. Luckily, she doesn’t have most of her teeth. Well, not lucky for her; lucky for me.

It is unnerving, though, as I don’t want to upset her. This aberrant behavior doesn’t happen with cats, you know. Either they love you or the loathe you, but they’re consistent.

All is going well, so much so that I will be going home on the 17th.

Categories
Photography

Sun break

sandpoint1

sandpoint2

sandpoint3

Categories
Just Shelley Photography

From a Train Window

Spending two days on a train is an interesting experience, one that could be improved by spending the extra money for a sleeper. No matter how comfortable the coach chairs are, they are not conducive to sleep.

I had a chance to see Illinois’ fall colors on the trip from St. Louis to Chicago. It was a lovely day and the view was wonderful. It was during this portion of the trip that I found out train personnel are very strict regarding baggage. One mentioned weighing my pullman bag until he hefted and then said it would be fine. Note: if you travel by train, don’t fudge your baggage; not when fuel is so costly and the railroads are barely scraping by. If the bag was overweight, I don’t know if the attendant would have started chucking my clothes out the window.

I spent four hours in Chicago waiting my next train. A red cap at Union Station helped me get my bags to lockers, and then retrieved me and the baggage for the next trip. If you ever need a red cap at Union Station in Chicago, I recommend Phil.

Baggage checked, I had three hours to look around, and it was a perfect fall day: cool, sunny, colorful. I had a marvelous time walking up and down canal street. At one point I passed a bunch of trailers for a movie, but I couldn’t see anyone about.

Back at the train station, I decided to go into the large, open room called the Great Room, but it was blocked off. The Clint Eastwood WWII movie, Flags of our Fathers, was being filmed in Chicago, including scenes at the train station. The Great Room had been re-decorated until it resembled its 1940’s self. The security guards were very nice, answering my questions, and letting me take photos from the doorway. I didn’t see anyone in period clothing, so assumed they were probably on break. Too bad—I would have liked to have seen Eastwood.

High, and not so high, lights of the trip:

Good: Having a chance to spend a few hours with the friendly folk in Chicago–not to mention seeing that great downtown.

Good: Spending 1/2 hour waiting for a train with about 30 Amish people, as one group of Amish ran into another group of Amish and exchanged details of their lives. Some English was used.

Bad: Finding out that the Amish are suspicious of outsiders and not particularly friendly.

Good: Train was half empty so I had my two seats to myself.

Bad: When you’re a tad over 5’11”, you cannot fold yourself into two train seats. No, not even when you do that.

Good: The homemade beef pot pie in the dining room was excellent.

Bad: Being seated with three complete strangers in close quarters in the dining car. More, three strangers who look aghast at you when you order a beer for dinner.

Good: The old cars dumped down hills here and there. You wouldn’t think junk could be beautiful, but it is. Especially the rusted out Model T laying on the hillside in North Dakota.

Bad: Seeing so many small, deserted towns along the way, as corporations buy out small farmers and ranchers. One town was completely empty, but strikingly preserved except for the grass growing along the street and a couple of range cows grazing on it.

Bad: Not having enough time to get the camera ready when an exceptionally fascinating view comes along, such as the abandoned town, the Model T, and a wolf in Montana.

Good: Having a chance to see the abandoned town, the Model T, and the wolf, regardless of getting a picture or not.

Good: Being able to walk about, stretch, gaze out the window.

Bad: Trying to sleep sitting up.

Good: The sound, the motion, the feel of being on a train. It is unique.

Bad: One train attendant who was rather offensive with the pretty, young women.

Good: The train conductor who helped me off with my bags at Sandpoint. He answered all my train questions with enthusiasm and delight. It is rare to meet someone so completely and absolutely in love with their work.

Good: Having so much to see that you never get bored.

Best moment: The pass coming from Glacier, Montana to Sandpoint.

The pass is normally completely dark. I was half asleep and reading when I noticed a ghostly blue light around the track ahead of us. Through the fog, a phosphorescent glow silhouetted several train cars lying scattered about—up the hill, down a cliff—in a scene that looked straight out of The Shining.

I asked the conductor about the lights and he said the cars were from a derailed train carrying grain and hadn’t been recovered yet. The lights placed around the cars were to keep away the bears who were attracted to the wet and fermenting corn. The bears would eat the corn, and then pass out on the tracks.

Flags of our Fathers

chicagoandunion

barnbw

train2

Categories
Technology Web

Accessing the Newsgator API within PHP

One of the programming jobs I’ve had recently was to provide PHP functions to access the Newsgator SOAP API; hiding as much of the SOAP bits as possible. I used the nuSOAP PHP library as the basis for my work. Though SOAP functionality is built into PHP 5, my client, like most people, are still using PHP 4, and nuSOAP has a very clean implementation.

For those who might want to give the API a shot, I’ll walk through some sample code that should be easily modified as interested. I had hoped to write a more complete application, but have ran out of time.

The Newsgator API requires an account in order to test the code, but you can sign up for one at no charge. When you get an account, you’re given an online Newsgator Location in which to add subscriptions. You’re also given the ability to create new locations, as well as folders, and to subscribe to and read, syndication feeds. The API itself is split into five main categories for the five SOAP endpoints: Locations, Folders, Subscriptions, Feeds, and Posts.

Each SOAP engpoint page lists the web service methods for the specific item, including a description of the parameters and values returned. An important element when looking at the page is to find a link to the endpoint at the bottom. Clicking on it opens a window asking for the account username and password. Once you enter these, the endpoint page opens, containing links for each of the methods.

Clicking on a method link opens up another page, usually containing a form, and an example SOAP request and response. These latter are essential in order to determine the values used with nuSOAP. You can also test the web service by typing values into the form and invoking the method. If, that is, the parameters are simple values rather than programmatic structures, such as arrays.

Once you’ve looked through the API methods to see what parameters are needed, and explored the actual SOAP request and response, it’s just a matter of plugging in values within the nuSOAP functions. To demonstrate, I’m going to walk through a program that creates a SOAP client, queries the service for all subscriptions for a given location, and then accesses and prints out links to the individual items for the subscriptions.

In the program, I first create a SOAP client using the appropriate endpoint, checking for any error afterwards. (Complete source code is provided later, so no worries about any gaps in the code):

// create SOAP client
$client = new soapclient(”http://services.newsgator.com/ngws/svc/Subscription.asmx”);
$err = $client->getError();
if ($err) {
err($client,$err);
die();
}

I’m not using a proxy or WSDL, so no other parameters other than the endpoint are set.

Next, I define the method’s parameters, in this case a location string and a synchronization token. This latter value is used to synchronize the data between method calls, and in the results you’ll see this returned as part of the response. Using this provided synch value in the next method call ensures that the data, such as the count of unread items for each subscription, is fresh.

// set parameters
$params = array(
‘location’ => $location,
’syncToken’ => $synctoken
);

During the initial web service request, the synch token is blank.

Once the method parameters are set, I added code to authenticate the user:

// authenticate against the service
$client->setCredentials($user, $pass,’basic’);

Note that this uses example uses BASIC authentication; Newsgator also supports DIGEST authentication.

The Newsgator API token is passed in a SOAP header, which I build manually next. Note that the token must be authenticated with the service, so you’ll need to specify the appropriate service namespace:

// create SOAP header for Newsgator API
$hdr = “<ng:NGAPIToken xmlns:ng=’http://services.newsgator.com/svc/Subscription.asmx’>
<ng:Token>$token</ng:Token></ng:NGAPIToken>”;

Finally, we can now invoke the service:

// invoke SOAP service
$result = $client->call(’GetSubscriptionList’, $params,’http://services.newsgator.com/svc/Subscription.asmx’,
‘http://services.newsgator.com/svc/Subscription.asmx/GetSubscriptionList’,
$hdr,false, ‘rpc’,’literal’);

// check for error
if ($client->fault) {
echo ‘<h2>Fault</h2><pre>’; print_r($result); echo ‘</pre>’;
} else {
$err = $client->getError();
if ($err) {
echo ‘<h2>Error</h2><pre>’ . $err . ‘</pre>’;
}
}

In this function call, the SOAP method is the first parameter, followed by the parameters, the SOAP endpoint (namespace), the SOAP action, the manually created header, the serialization style (’rpc’), and the serialization for the parameters (’literal).

The nuSOAP function processes any XML returned as multi-dimensioned arrays. With this service call, the subscriptions are returned as OPML, values of which you can access by walking through the array:

// decipher the array, based on OPML
$opml = $result[”opml”];
$body = $opml[”body”];
$outline = $body[”outline”];
$syntoken = $opml[”!ng:token”];
foreach ($outline as $key => $sub) {
$feed = $sub[”!ng:id”];
$title = $sub[”!title”];
$url = $sub[”!htmlUrl”];
echo “<a href=’$url’>$title</a><br />”;
}

After each subscription is accessed, the feed identifier ($feed) is then used to invoke another service to get the news for the feed. The complete application demonstrates this.