Mobafire League of Legends Build Guides Mobafire League of Legends Build Guides
's Forum Avatar

This Weeks Free Champions - Cron Jobs

Creator: Ugleh
September 22, 2012 6:45am
2 posts page 1 of 1 Forums » Site Support » This Weeks Free Champions - Cron Jobs
Permalink | Quote | PM | +Rep | Commend by Ugleh » September 22, 2012 6:45am | Report
To remove the load of work on myself I usually try to find whatever content i can do automatically through cron jobs. So i came up with this idea for Mobafire. Each week you can grab the free weekly champs by Screen Scrapping.
You could use curl or simply file_get_contents to grab the source from http://na.leagueoflegends.com/news/champion-rotation
Screen scrap to find the first appearence of this text
Code:
<a href="/news/new-free-champion-rotation-season-two-week-43" title="Read the rest of New
Code:
<a href="*" title="Read the rest of New
Which now gives you the full article of the latest new champions. Then you screen scrap that link to get each champion. You will want to do this every tuesday morning or monday evening.
Ugleh's Forum Avatar

Ugleh
<Member>
Posts: 35
Joined: Sep 13th, 2012
Rep: Unremarkable (1)
Blog   |   Profile
Permalink | Quote | PM | +Rep | Commend by Matt » October 2, 2012 1:45pm | Report
Unfortunately scraping a page like that, which is probably manually written each time by a person at Riot, especially in this case, is unreliable and awkward :( If they provided any form of API we could but, alas.

We have a number of people with access to update it though, and in the past they have been very on-the-ball. If you feel the rotation is too slow to update let us know :)
Matt's Forum Avatar

Awards Showcase
Show more awards
Matt
<Administrator>
Posts: 4265
Joined: Dec 8th, 2009
Rep: Renowned (665)
Profile

Quick Reply:

Guest commenting is currently disabled, please log in or sign up to respond!