User Control Panel
Advertisements

HELP US, HELP YOU!

Countdown

 
Post new topic   Reply to topic    Bot Depot Forum Index -> Services
View unanswered posts
Author Message
Pepper
Senior Member
Senior Member


Joined: 30 Jul 2004
Posts: 178
Location: Auckland, New Zealand
Reputation: 9.1Reputation: 9.1Reputation: 9.1Reputation: 9.1Reputation: 9.1Reputation: 9.1Reputation: 9.1Reputation: 9.1Reputation: 9.1

PostPosted: Sun Dec 26, 2004 2:09 am    Post subject: Reply with quote

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 Smile

If there is enough demand for this service, i'll add another few with hours, minutes and seconds. Very Happy
Back to top
Mojave
Almost An Agent
Almost An Agent


Joined: 01 Nov 2003
Posts: 1434

Reputation: 66.4

PostPosted: Sun Dec 26, 2004 2:47 am    Post subject: Reply with quote

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. Very Happy
Back to top
dan0211
Not Yet a God
Not Yet a God


Joined: 23 Dec 2003
Posts: 395

Reputation: 37.8Reputation: 37.8Reputation: 37.8Reputation: 37.8

PostPosted: Sun Dec 26, 2004 12:42 pm    Post subject: Reply with quote

Cool Pepper, nice idea Smile

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 Razz
Back to top
darkmonkey
The Merovingian
The Merovingian


Joined: 18 Apr 2004
Posts: 2557
Location: London, England
Reputation: 39.3Reputation: 39.3Reputation: 39.3Reputation: 39.3
votes: 7

PostPosted: Sun Dec 26, 2004 12:55 pm    Post subject: Reply with quote

Woaw nice Pepper.
_________________
~ Josh
[ Need bot hosting on a dedicated server? PM me. ]
Back to top
Pepper
Senior Member
Senior Member


Joined: 30 Jul 2004
Posts: 178
Location: Auckland, New Zealand
Reputation: 9.1Reputation: 9.1Reputation: 9.1Reputation: 9.1Reputation: 9.1Reputation: 9.1Reputation: 9.1Reputation: 9.1Reputation: 9.1

PostPosted: Mon Dec 27, 2004 9:23 am    Post subject: Reply with quote

Okay, I'll get coding Smile
Back to top
yowhat2002
Newbie
Newbie


Joined: 31 Jan 2004
Posts: 36

Reputation: 28.3Reputation: 28.3Reputation: 28.3

PostPosted: Mon Dec 27, 2004 6:20 pm    Post subject: Reply with quote

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 Wink
Back to top
darkmonkey
The Merovingian
The Merovingian


Joined: 18 Apr 2004
Posts: 2557
Location: London, England
Reputation: 39.3Reputation: 39.3Reputation: 39.3Reputation: 39.3
votes: 7

PostPosted: Mon Dec 27, 2004 6:54 pm    Post subject: Reply with quote

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
Almost An Agent


Joined: 12 Jan 2004
Posts: 1375

Reputation: 15.8Reputation: 15.8
votes: 2

PostPosted: Mon Dec 27, 2004 8:25 pm    Post subject: Reply with quote

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
Senior Member


Joined: 30 Jul 2004
Posts: 178
Location: Auckland, New Zealand
Reputation: 9.1Reputation: 9.1Reputation: 9.1Reputation: 9.1Reputation: 9.1Reputation: 9.1Reputation: 9.1Reputation: 9.1Reputation: 9.1

PostPosted: Tue Jan 11, 2005 9:14 am    Post subject: Reply with quote

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
Almost An Agent


Joined: 31 Oct 2003
Posts: 1071

Reputation: 52.4

PostPosted: Fri Jan 14, 2005 7:25 pm    Post subject: Reply with quote

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
Agent


Joined: 09 Jan 2004
Posts: 1731

Reputation: 72.3

PostPosted: Fri Jan 14, 2005 9:59 pm    Post subject: Reply with quote

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 Very Happy
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Bot Depot Forum Index -> Services All times are GMT
Page 1 of 1

 



Protected by phpBB Security phpBB-TweakS
phpBB Security Has Blocked 9 Exploit Attempts.
Antispam Captcha Mod by phpbb-security.com
Powered by phpBB © 2001, 2005 phpBB Group