≡ Menu
Deep in the Code

Another Code School Profile Scraper Update

Merry Christmas!

This will be a short post – I guess Code School must make minor changes to their user profile code about this time each year, as it was just a year ago that I had to update this code.

Code School logo

For the codeschool.php file, change this:

/* disabling the anchor tags on each badge by changing to divs */
$full_content = str_replace("<a href","<div class",$full_content);
$full_content = str_replace("</a>","</div>",$full_content);

to this:

/* disabling the anchor tags on each badge by changing to divs */
$full_content = str_replace("<a rel=\"tooltip\" ","<div ",$full_content);
$full_content = str_replace("href=\"/learn","data-href=\"http://codeschool.com/learn",$full_content);
$full_content = str_replace("</a>","</div>",$full_content);

This will eliminate the links that would be intended to point at the Code School paths, but instead end up being broken links pointing at your own site.

Have a Happy New Year!

About the author: I solve problems. Solutions Architect / Senior Software Engineer / Business Analyst / Full-Stack Developer / IT Generalist