Author Topic: Mekboy Gibberish Generator  (Read 595 times)

Flamekebab

  • Citizens
    Voting Member
  • Posts: 343
  • Karma: 4
    • View Profile
    • Awards
Mekboy Gibberish Generator
« on: November 30, 2015, 08:15:05 PM »

Linky
Ork Meks, much like many human mechanics, are not known for telling the absolute truth. Did they just make up that part to put something extra on the bill? I doubt even other mekboys are sure.


The wordy bits are from me, Craig Dolan, Dawn Patrick-Brown, and a few others from the Gorkamorka community.

The code for this isn't particularly difficult but it does several things I've not done before. It pulls files from Google Sheets where there's this document. Three separate TSV files come from there although as they're each a single column they're literally a text file with an entry on each line and nothing more.


From there some PHP converts them to javascript arrays (and JSON) and the JavaScript works with them from there (brought in via PHP includes).


The general idea was to pull in the data as JSON because that's what one is apparently supposed to do. I couldn't find anything that didn't massively overcomplicate things though so I didn't bother. That said there is JSON for each of the three components should anyone want to have a play with them:
The script should refresh the cache up to once an hour and I think Google Sheets is on a ten minute rotation so additions to the sheet won't show up in the code immediately but eventually will. Dat'z da plan, anyway.


Jubal

  • Megadux
    Executive Officer
  • Posts: 22676
  • Karma: 104
  • Awards Awarded for oustanding services to Exilian!
    • View Profile
    • Awards
Re: Mekboy Gibberish Generator
« Reply #1 on: November 30, 2015, 11:59:11 PM »
Nice work! :)
The duke, the wanderer, the philosopher, the mariner, the warrior, the strategist, the storyteller, the wizard, the wayfarer...