With PHP, you get one blogroll

Having finally gotten my sorted-in-update-order dropdown-list blogroll in fairly stable condition, with code that I’m only somewhat ashamed of, I could use a few friendly beta testers with PHP weblogs who would be willing to try out my tutorial on how to it.

16 Comments

Comment by Phil Ringnalda #
2002-04-20 22:57:38

Though at this exact moment, you’ll find the blo.gs service unavailable due to a database problem (not messing up my blogroll during those problems was what took me so long to ship, which has now given me shipping fever).

 
Comment by ruzz #
2002-04-21 00:07:20

im in!

 
Comment by ruzz #
2002-04-21 00:41:30

and I’m up and running. But not without a small snag. You see, Ive already got an instance of xml_parser running to parse my recently updated list. No biggy, I had to rename the functions startElement and endElement to startElement2 and endElement2 because you cant declare the same function name 2 times. I hope that made sense.

this is not going to happen for 99.9% of users.

This is great man. I love it. I can finally use blo.gs in some meaningful way and i think if people find out about this you will roll jason out of the blogrolling game :)

pun intended.. heh.

 
Comment by Phil Ringnalda #
2002-04-21 00:54:23

That was quick!

I should have thought of the conflicting function names problem, since when I was trying to figure out where I stole the original code, I found it virtually unaltered in about a dozen different places. And since it started out over-globalled, and I made that even worse, it’s probably not very well-behaved in a busy page. Result of amateur programming in a file that’s going to be included: I wasn’t seeing any other code around it, so I didn’t think about any other code. Tomorrow I’ll do a little variable and function renaming, and maybe try to cut down on the globals a tiny bit, just to cut the support headache.

It is sweet, isn’t it? I thought when I first signed up for blo.gs, at #34, that I was just getting in early, but it’s still only up to 124. And if I ever learned the Blogger-lesson, I’d do my damnedest to keep it that way, just telling enough people about it to keep Jim interested in leaving it running.

 
Comment by ruzz #
2002-04-21 01:08:02

it is sweet. It the cats ass. It’s unforunate to only pull the file once an hour, but I will deal somehow.

So are you saying you dont want me to promote the shit out of this or what?

 
Comment by ruzz #
2002-04-21 01:12:36

oh and..
this brings to mind two things:

1.what a crappy thing to do to blogger users including it as a perk in pro. As if it costs ev anything to implement the ping. Admittedly if he did allow the ping it might well be the ping of death, but i digress.

2. damn its going to take me hours to sort through the lists to find my sites…

:)

 
Comment by ruzz #
2002-04-21 01:32:01

oooo new problem.

you are using an plain old http request to retrieve the favorites.xml file from blo.gs and my isp (as many do) likes to run interference on some sites (no idea why) and cache a copy of the page.

So, I added a crap load of new sites to my list, set the time to 60 seconds instead of 3600 to force a reload and got nada. I had to go to blo.gs and manual (ctrl-shft-f5) refresh the page, then reload my site which displayed current information.

This is a problem some of my bbt sites have when trying to use remote templates. I searched for a work around for a bit but never found one. Without something, people whos isp cache copies will be forced to wait for the cached copy to expire before their list updates.

youre thoughts? if you need more info, by all means email me :)

 
Comment by Phil Ringnalda #
2002-04-21 01:42:41

1 – Yeah, I thought that way at first, but on second thought: there are probably about as many interesting Blogger blogs as there are Radio/MT/Greymatter/BBT, but there are far, far more Blogger blogs that are only interesting to two people tops than there are all other sorts of blogs combined. If you are absolutely stuck on Blogger Classic, you can use w.bloggar, which pings, or you can get one of my bookmarklets to ping (or even do my auto-ping when you ”view web page”, hidden in the bowels of bloggertech). Troll the ”recently updated” on blogger.com for a while, and then think again about whether you want every one of those clogging up weblogs.com. Mostly I’m not elitist about blogging, but just this once, I am.

2. It’s hidden, but there is a search: upper right corner, click search and a little box pops up (I clicked it three or four times the first time I noticed it, expecting to go to a new page).

0. Hell yes, promote it till it bleeds. But it might be better to wait until after noon tomorrow, when I wake up and do 0.5.1 with better variables and functions.

3. Grr. Is it a problem with the header not claiming that it should expire (or maybe the header intentionally claiming it doesn’t expire for an hour), or not reporting a new modified date? Jim’s amenable to fixing problems when he can. Otherwise, if the header is reporting a new modified date, and your ISP’s caching proxy ignores that, then they are bad, bad people. My eyes are blurring, and I’m sure my brain is too, so I’ll have to peek at the headers tomorrow.

 
Comment by ruzz #
2002-04-21 01:50:51

3. I suspect its jims server either not giving an expiry date or, giving an invalid one. As I said my isp only caches some sites, which leads me to think that those sites would fall under the undefined revalidation category.

0. Will do.

1. No money in it for jim.. sigh.

2. Searching would require being able to recall my list from memory. It actually only took about a half hour.

 
Comment by pixelkitty #
2002-04-21 04:56:28

um ok Im going to try this out

wish me luck

 
Comment by pixelkitty #
2002-04-21 04:58:18

nope my brain melted

Ill have to try it some other time when Im less tired

 
Comment by Phil Ringnalda #
2002-04-21 11:16:14

Two minutes to melt your brain. I’m quick, I am!

Version 0.5.1 is up, with every global variable and every function prefixed with ”blogroll”, which I hereby claim as mine and mine alone for all time, so it should work and play well with others now.

3. Rex Swain’s HTTP viewer says it isn’t sending any last mod or expiry date. While I can understand an ISP thinking in 1998 static web terms and treating that as meaning that they can cache it as long as they like, I can’t approve of it. My web is dynamic and changed unless it says it isn’t, not the other way around.

 
Comment by ruzz #
2002-04-21 11:38:23

then your isp gives pages (and you) the benefit of the doubt. Mine err’s on the side of conserving bandwidth i guess.

I’m friends with the owner of my isp, perhaps I can convince him to rethink that. But until then…

 
Comment by Hossein #
2002-04-22 05:03:07

Back when I lived on campus, my college network used a cache engine, and we had problems very similar to this. However, it turned out that if you attached a line that says ”pragma:no-cache” to the HTTP request, then it would always force the cache engine to get the latest version. Have you tried modifying it to include the no-cache line? I had a hard time understanding your code, since I’m not a PHP expert (and because ychoau;dt shoamde ksionmdeo fkoibnfdusion :), but I would imagine it would look something like this (pulled from the manpage for fsockopen):

$fp = fsockopen (”blo.gs”, 80, $errno, $errstr, 30);
if (!$fp) {
   echo ”$errstr ($errno)<br>n”;
} else {
   fputs ($fp, ”GET /34/favorites.xml HTTP/1.0rnHost: blo.gsrnPragma:no-cachernrn”);
  vwhile (!feof($fp)) {
       echo fgets ($fp,128);
}
     fclose ($fp);
}

 
Comment by ruzz #
2002-04-22 14:45:34

That may work as its a socket request rather than an http request.

Im going to play with that some.

 
Comment by ruzz #
2002-04-22 15:25:04

seems that works. But now I need to strip off the head information so it doesnt gack the xml parser. I think..

im REALLY tired today

 
Name (required)
E-mail (required - never shown publicly)
URI
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <del datetime="" cite=""> <dd> <dl> <dt> <em> <i> <ins datetime="" cite=""> <kbd> <li> <ol> <p> <pre> <q cite=""> <samp> <strong> <sub> <sup> <ul> in your comment.