Best Practices - URL Processing

From The Socknet

Jump to: navigation, search

URL's which are intended to be followed by users can use the following substitution markers to personalize them:

%ou
OpenID of the user who clicked the link.

%or
OpenID of the user who referred the user who clicked. This is the OpenID of the user that shows the link. This might not be the creator of the content. (Note: This is not the user who forwarded the message in the case that the message was forwarded.)

If a provider or service supports URL Processing, it will make these substitutions or set them to blank. If it does not, they will be sent by the user's browser unmodified.

Clearly this information isn't trustworthy. It's just a hint. For example, a user could manually fill in these fields.

However, if these are provided, then a signin form can be prefilled with the given OpenID, so the user does not need to type it.

Defining URL Codes in the Future

There might be more codes defined in the future.

As more are defined, remember that the % must not be followed by 0-9 or A-F/i. These are reserved for their URI format purpose: to be hexidecimal codes.

Finding URL's

Aside from URL's that are passed directly in specific Socknet fields, URL's are also found in Socknet messages.

The following XHTML attributes always contain URL's. Some show up in more than one type of XHTML element, so they should be searched for in all elements.

  • href
  • src
  • action
  • background
  • cite
  • classid
  • codebase
  • data
  • longdesc
  • profile
  • usemap

Considerations

The XPath string //@href will find all href attributes, for example. So finding the proper attribute nodes should be as simple as a for loop over a list of them.

Personal tools