horoscope scrip(perl)
anyone have idea on this kind of script...
I think it is just a matching test within a range of day and month..
Using of time modules would be pretty simple, and anyone can give me some suggestion...
I got a module Date::horoscope...
But I don't know how to use it...or there is a much easy way..
Thanks..
Wil posted this at 10:41 — 18th March 2002.
They have: 601 posts
Joined: Nov 2001
Hi
Not sure if I understand your message correctly. What exactly are you trying to do here?
Date::horoscope gives you information about using the module here:
http://search.cpan.org/doc/TBONE/Date-Horoscope-2.0/Horoscope.pm
And this is the synoposis it gives:
#!/usr/bin/perl
use Date::Horoscope; use Date::Manip;
$date='1969-05-11';
$zodiac_sign_name = Date::Horoscope::locate($date);
$zodiac_sign_posn =
$Date::Horoscope::horoscope{Date::Horoscope::locate($date)
}->{position},$/;
Basically, you pass it a date in a veriety of forms, but the most common is the unix timestamp form and then the module returns the zodiac sign the date resides in. Based on this information it's up to you what you want to do after...
- wil
uatt posted this at 23:41 — 18th March 2002.
They have: 27 posts
Joined: Jan 2002
thank you for the hints
1.returns the zodiac sign the date resides in
2.what you want to do after
however, a little problem ...my free webhosting do not have modules Date::Horoscope andDate::Manip pre-installed...
Wil posted this at 09:22 — 19th March 2002.
They have: 601 posts
Joined: Nov 2001
Ack, then you're preety much stuck. The only thing I would suggest you do then is to ask them to install the modules for you - most good providers should do. The module comes off CPAN so it should be preety much kosher.
If they come back to you saying 'no' then we'll look for other solutions.
- wil
uatt posted this at 10:28 — 19th March 2002.
They have: 27 posts
Joined: Jan 2002
I will try...nice to meet you..
theprofessional posted this at 14:04 — 20th March 2002.
They have: 157 posts
Joined: Mar 2002
Are you trying to retrieve horoscope based on day and month?
I've done this with PHP in conjunction with MySQL database at: freeastrology.net
The client can then change horoscopes on the fly through an admin menu on their site.
Am I way off on what you are trying to do?
uatt posted this at 15:51 — 21st March 2002.
They have: 27 posts
Joined: Jan 2002
to theprofessional
you are not way off...and what I need is just something like that...
I like to compose it in perl....
to Wil
I decide to de-compose the modules and I tried to copy the relevant function to the script
theprofessional posted this at 18:21 — 21st March 2002.
They have: 157 posts
Joined: Mar 2002
Well, if I can help in PHP, let me know. I left Perl when I discovered PHP, real quick. The only thing I need Perl for now is... nothing.
Wil posted this at 18:32 — 21st March 2002.
They have: 601 posts
Joined: Nov 2001
uatt
Send me copies of the module => [email protected]
I can help you exctract the sub you need.
uatt posted this at 00:05 — 22nd March 2002.
They have: 27 posts
Joined: Jan 2002
It is a simple pakage...
just one file useful....
However, it is also making use of modules Date::Manip
so, I will take a while to parse Manip as there is no such module in the free webhosting and following link can see all available modules..
http://csss.hypermart.net/module.cgi
Thanks for both of you
Wil posted this at 09:16 — 22nd March 2002.
They have: 601 posts
Joined: Nov 2001
Aha.
Well, that all Data::Manip does is to format your current unix time to : mm/dd/yy format.
You can do that with something like:
my ($day, $month, $year) = (localtime)[3,4,5];
$year += 1900;
$month += 1;
my $date = sprintf("%02d/%02d/%d\n", $day, $month, $year);
- wil
Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.