Latest Uploads
Extraterre ... .0.1 (zip)

dantheman363

Monty Teas ... Screenie 1

steve_ancell

Santa Clau ... ed his bag

waroffice

manic_platdude.png

spinal

Tetris Clone

steve_ancell

Super blues bros.

spinal

Forum Home

php and bf3stats.com api

UserMessage
Posted : Tuesday, 13 March 2012, 07:27 | Permalink | Mark Here
waroffice


Afternoon,

I would like to code something that returns 2 lines of data for an lcd screen i have, i have the lcd working fine but what I need is to be able save the data and only poll the website API after a set time out period, 5 mins for example.

What I need is a nice way to store the data and a way to check the last time.

bear in mind that this will rarely be accessed via a browser so cookies won't work.

I guess i could use mysql? or a file?

I was hoping for something nice and simple like me.

cheers

Dean
Posted : Tuesday, 13 March 2012, 07:36 | Permalink | Mark Here
JL235


WW Entries : 7
I would just use a file. Dirt simple, and dirt cheap.

If it's just one script, in relation to one expected request, then it will be fine. If it's part of something more complex, then you could have multiple files (each for each LCD screen), and I normally have a 'dynamic' folder where I store all this stuff.

If it's more complicated then that, then use a DB.

I have not tested this code, but this is kinda what I would use for the file time management if I were building this.
-->
It returns either the file time or the current time (depending on if it exists), and also updates the file to the current time.

-----
PlayMyCode.com - build and play in your browser, Blog, Twitter.
Posted : Wednesday, 14 March 2012, 09:41 | Permalink | Mark Here
waroffice


awesome.

just what I was looking for.

Thanks
Latest Posts
Noel's Graduation
rockford Mon 07:37
Screen Burn of the Mind
rockford Mon 07:33
RoadRash!
waroffice Mon 03:08
Development via GUI
waroffice Mon 02:48
Audio Rant
steve_ancell Sat 19:16
Wrong Partition!!!!?
spinal Sat 11:24
Progress / Location Bars
Afr0 Sat 03:15
eBay Lies
spinal Fri 23:44
Shoutbox Topic - 968
dna Fri 19:42
Meh
Afr0 Fri 04:13
More

Latest Items
News : Newsletter #176
Jayenkai Sat 04:49
News : Newsletter #175
Dabz Tue 09:38
Blog : Snow: More Material Junk
Cower Sat 23:17
Dev-Diary : Mutant Monty: Amstrad CPC to Windows conversion
rockford Fri 13:14
Techy : AppleTV
Jayenkai Thu 09:40
Blog : Graphviz
steve_ancell Sat 14:17
Pets : Top-Down Shadow Hack
Jayenkai Tue 05:52
Snippet : JNKrunch v1.0
Jayenkai Sat 07:20
News : Newsletter #173
waroffice Fri 04:47
Blog : Material Loading
Cower Fri 02:08
Pets : I Done Won A Thing
shroom_monk Sun 11:31
Pets : Repurposing A Lexer
Cower Mon 22:06
Bah : Feeling a Little Angry
spinal Mon 11:26
News : Newsletter #170
Dabz Sat 00:34
Showcase : sbfgen
Cower Sat 16:57
More

Who's Online
rockford
Mon, at 07:45
Jayenkai
Mon, at 07:27
spinal
Mon, at 07:13
9572AD
Mon, at 06:20
HoboBen
Mon, at 06:09
steve_ancell
Mon, at 06:06
shroom_monk
Mon, at 06:04
Krakatomato
Mon, at 05:47
Afr0
Mon, at 05:16
CodersRule
Mon, at 03:28
Link to this page
Site : Jayenkai 2006-Infinity |
MudChat's origins, BBCode's former life, Image Scaler.