Click to open network menu
Join or Log In
Mobafire logo

Join the leading League of Legends community. Create and share Champion Guides and Builds.

Create an MFN Account






Or

MOBAFire's first Mini Guide Contest of Season 14 is here! Create or update guides for the 30 featured champions and compete for up to $200 in prizes! šŸ†
's Forum Avatar

This Weeks Free Champions - Cron Jobs

Creator: Ugleh September 22, 2012 6:45am
Ugleh
<Member>
Ugleh's Forum Avatar
Posts:
35
Joined:
Sep 13th, 2012
Permalink | Quote | PM | +Rep 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.
Matt
<Administrator>
Matt's Forum Avatar
Show more awards
Posts:
4286
Joined:
Dec 8th, 2009
Permalink | Quote | PM | +Rep 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 :)

You need to log in before commenting.

League of Legends Champions:

Teamfight Tactics Guide