S E R V E R   S I D E
View current page
...more recent posts

While understanding that this truly reveals the amateurishness of my coding abilities, I've posted the PHP code for the reference logging feature I built. (No, this isn't useful in any real way - I'm just posting it in case someone was wondering how I did it. Maybe someone could get an idea from it. But it's too tied to the rest of my system for someone else to be able to use this fragment. Still, I'd like to see others implement their own versions of this feature.)

After a page is served from the database here, the system checks whether reference logging is turned on for that page. If so it includes the snippet of code linked above which determines if there was an external referer who had linked directly to a specific post here (a link to a URL you get when you click on any [link] link.) If so this bit of code gets the HTML of the external page, and parses it so that only the bit of text right around the link to us is left, and stores that text and link in the database here.

It's not pretty. But it does seem to work. I guess, like all of my stuff, it should probably be thought of as a proof of concept. Maybe some day a real coder could write a more elegant version. Still, I'm not sure that version would actually work any better.

I'm very interested to see people's reaction to this feature. This has been hard, so far, because it's not immediately clear what I'm up to. But the implications could be rather large. Especially in the weblog world. There are lots of conversations going on between pages, but no real way for someone unknown to break into the conversational loop. Or rather, the only way for someone unknown to break into the loop is to be pointed at by someone already in the loop. This leads to a certain level of cliquishness. But if all specific references to a page showed up as a link and a snippet of text on the page being linked to (well, actually on a sub page, but noted from the page itself) then new people could be introduced into conversations just by commenting on them.

This takes some power away from the individual author (in the sense that they aren't vetting every single link, some are just appearing.) So there could be resistence on that point. I wonder.
- jim 5-05-2002 7:59 pm [link] [2 refs] [add a comment]

older posts...