|
| Author |
Message |
Pepper Senior Member

Joined: 30 Jul 2004 Posts: 178 Location: Auckland, New Zealand
         
|
Posted: Sun Dec 26, 2004 2:09 am Post subject: |
|
|
Yay! My first service!
This service is a countdown to a specified date
URL: http://www.8th-dimension.net/countdown.php
Param's: message - Put your message here, eg. "It will be your birthday in" (Without the quotes) day - What day of the month. Dont put a leading zero. (Instead of 03 use 3) month - What month. Dont put a leading zero. (Eg, March = 3) year - From what year to what year. (Works from 1980 - 2099)
Example: http://www.8th-dimension.net/countdown.php...nth=5&year=2005 Remember, When the message paramater is entered make the spaces %20's!
Bugs: E-Mail/MSN me on pepper [*at*] zingysaturn [*dot*] co [*dot] uk
Hope you like 
If there is enough demand for this service, i'll add another few with hours, minutes and seconds.  |
|
| Back to top |
|
 |
Mojave Almost An Agent

Joined: 01 Nov 2003 Posts: 1434
 
|
Posted: Sun Dec 26, 2004 2:47 am Post subject: |
|
|
Very cool! Just a couple things I noticed.
You should have it default to your next birthday if no year is supplied. Right now, it just gives an error.
You should handle errors better, by giving a nice message as to why there was an error, rather than the actual error output.
It lets me put in illegal dates, like month=115 and day=35. You should fix those and give error messages.
You should allow for messages like: "It is 109 days until your birthday". You could do that by requiring a tag or something in the message: message=It is days until your birthday
I like the service overall. To make it more robust, handle errors and make the message more powerful.  |
|
| Back to top |
|
 |
dan0211 Not Yet a God

Joined: 23 Dec 2003 Posts: 395
    
|
Posted: Sun Dec 26, 2004 12:42 pm Post subject: |
|
|
Cool Pepper, nice idea 
I think this will certainly come in usefull for a lot of people, especially if Mohave's suggestions are used.
I'd plus you, but I cant right now, which is the whole reason for this post  |
|
| Back to top |
|
 |
darkmonkey The Merovingian

Joined: 18 Apr 2004 Posts: 2557 Location: London, England
     votes: 7
|
Posted: Sun Dec 26, 2004 12:55 pm Post subject: |
|
|
Woaw nice Pepper. _________________ ~ Josh
[ Need bot hosting on a dedicated server? PM me. ] |
|
| Back to top |
|
 |
Pepper Senior Member

Joined: 30 Jul 2004 Posts: 178 Location: Auckland, New Zealand
         
|
Posted: Mon Dec 27, 2004 9:23 am Post subject: |
|
|
Okay, I'll get coding  |
|
| Back to top |
|
 |
yowhat2002 Newbie

Joined: 31 Jan 2004 Posts: 36
   
|
Posted: Mon Dec 27, 2004 6:20 pm Post subject: |
|
|
| Code: | | Public Function bdayservice(data As String)<br /><br />'Code by Charles Davison(yowhat2002)<br />If data <> " " And data <> "" Then<br />Dim day As String<br />Dim month As String<br />Dim year As String<br /><br />day = Split(data, ",")(0)<br />month = Split(data, ",")(1)<br />year = Split(data, ",")(2)<br /><br />SendMSG "(o) Working..."<br />Dim strURL As String<br /><br />strURL = frmMain.Inet1.OpenURL("http://www.8th-dimension.net/countdown.php?message=Your%20birthday%20will%20be%20in&day=" & day & "&month=" & month & "&year=" & year)<br /><br />SendMSG strURL<br /><br />Else<br /><br />SendMSG "You must enter the day, month and year in the following format.." & vbCrLf _<br />& vbCrLf & "Day,Month,Year"<br />End If<br />End Function<br /> |
Thats how to make it work in vb  |
|
| Back to top |
|
 |
darkmonkey The Merovingian

Joined: 18 Apr 2004 Posts: 2557 Location: London, England
     votes: 7
|
Posted: Mon Dec 27, 2004 6:54 pm Post subject: |
|
|
That's cool, nice to see it in languages other than Perl. I just wish that other language didn't have to be VB... _________________ ~ Josh
[ Need bot hosting on a dedicated server? PM me. ] |
|
| Back to top |
|
 |
mat007 Almost An Agent

Joined: 12 Jan 2004 Posts: 1375
   votes: 2
|
Posted: Mon Dec 27, 2004 8:25 pm Post subject: |
|
|
| Code: | | print "Getting Data"<br />import urllib<br />f = urllib.urlopen('http://www.8th-dimension.net/countdown.php?message=Your%20birthday%20will%20be%20in&day=25&month=5&year=2005')<br />print f.read()<br /> |
Python
I dono how to shift data in python. (Uses Urllib it comes standard with python) |
|
| Back to top |
|
 |
Pepper Senior Member

Joined: 30 Jul 2004 Posts: 178 Location: Auckland, New Zealand
         
|
Posted: Tue Jan 11, 2005 9:14 am Post subject: |
|
|
Yay! I've finished it (well nearly anyway)
Okay, Taking Mojaves suggestions heres the latest version of the countdown service:
New URL -> http://www.8th-dimension.net/services/countdown/\ (Use it directly, eg http://www.8th-dimension.net/services/coun...blah&month=blah. If you skip straight to countdown.php in that folder, it will bypass all the checks it does.)
If no year is specified it will default to 2005
It wont accept the Day if its not 1-32
It wont accept the Month if its not 1-12
I'm going to tweak it a bit more, just to get it right. I'll post those changes though.
TTFN
- Pepper |
|
| Back to top |
|
 |
Keenie Almost An Agent

Joined: 31 Oct 2003 Posts: 1071
 
|
Posted: Fri Jan 14, 2005 7:25 pm Post subject: |
|
|
Don't make it default to 2005. Make it use the next year where that date hasn't passed.
For instance, putting month=1, day=1 and no year with say 14 days to go, when it should be Jan 1, 2006 instead of 2005. |
|
| Back to top |
|
 |
Dazzy Agent

Joined: 09 Jan 2004 Posts: 1731
 
|
Posted: Fri Jan 14, 2005 9:59 pm Post subject: |
|
|
Cool service and has many more uses that just grabing and sending to the user...
Can be used internally instead of having you're own running constantly.....
Ps,KEENIE  |
|
| Back to top |
|
 |
|