University of Oregon

Clean up your curl – fixing relative links in scraped content

A few years ago I Added jQuery browser check for ODT and Skillport eLearning. This week I updated that functionality and noticed a relative link in some remote content I was scraping via cURL.
The problem being that the relative link needed to be fully qualified.

Here’s the old table that I cURL from the Skillport support site:
Screen Shot of the old compatibility table

Here’s the updated table:
a view of the table pulled in from skillport
The culprit is the “Click here to view Skillsoft’s Browser Support Statement” at the top of the table. “here” links to /44007.htm which isn’t helpful.
(more…)

Added jQuery browser check for ODT and Skillport eLearning

I noticed a mac user getting frustrated when trying to log in to the eLearning site the other day.
The log in process was hung up on the loading screen for a few minutes:

I pointed out that it said ‘click here’ if it doesn’t load after 40 seconds but I realize that’s not very helpful.
It turns out they were using Firefox, which isn’t one of the supported browsers.

We do have the browser compatibility information on the page but that content is collapsed. So the user would have to look for it.
So I decided to add some browser compatibility tests and display a message to mac / firefox users to save them some trouble.
(more…)

Dynamically retrieve a protected pdf

My goal is to present the viewer with the latest course catalog pdf from our eLearning system.

Users can already log in and search for courses or drill down to a course and it’s details but there’s no overview readily available.

Administrators can open the latest course catalog in the client community.

Since we subscribe to all the courses I feel comfortable posting that catalog for our users.

But I don’t feel comfortable doing that by hand.

Enter php’s cURL.

  1. Open the page and determine the file to be downloaded.
  2. Download the file
  3. set the mimetype and return the file to the user

Simple right? Yes indeed, once you have your tools in order.
(more…)