mIRC Home    About    Download    Register    News    Help

Print Thread
Page 1 of 2 1 2
#46785 03/09/03 07:07 AM
Joined: Feb 2003
Posts: 309
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Feb 2003
Posts: 309
Huzzah!
Life just gets better and better, doesn't it. Its now possible to rather indirectly use PHP in mIRC.
If you lot have read up on windows scriptlets you have noticed you can use Jscript/VBscript/LISP/ActivePerl/NetREXX etc to create COM objects in windows scriptlets.
mIRC as we well know can make use of COM objects - perhaps not as well as we'd all love, but well enough.

I stumbled across http://www.zend.com/lists/php-dev/200205/msg00646.html and my jaw dropped as the implications hit home. WSH + PHP == COM OBJECT + mIRC = ... wow...
And if you used PHP + Java + WSH...

Imagine some of the web applications you could use right in mirc - SOAP services like a google search (Yes, GOOGLE offers a RPC API!), SMS services, email, even free faxing!

Say bye bye to messy sockets and use an api :P
So what do we all think?
Is there a non-care factor around?
Am I too excited over nothing?

I'm mostly excited because this now provides an easy way to bridge the gap between mIRC and the rest of the XML based world. Huzzah!

#46786 03/09/03 07:31 AM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
Sounds ok, but I wouldn't go so far as to say messy sockets, especially when you're talking about Google API queries. With your method, you're talking 4 or 5 layers when /sock commands can talk directly to google with ease.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
#46787 03/09/03 08:06 AM
Joined: Feb 2003
Posts: 309
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Feb 2003
Posts: 309
ah but think of the slowness involved in mirc sockets and stripping out the XML, etc - instead you could get an associative array from PHP and merely loop thru it.

ie start com object
push query to it
pump out results.

So much of the complexity would be hidden behind apis.... it would mean powerful scripts with simplicity - plus PHP's XMLrpc library would be uber optimized so would have minimal performance impact.

It would also mean something like PHP's ADODB is easy peasy - any database, anywhere, right now.

The only thing more I'd ever ask is improvements to the mirc COM calls to be able to call member functions of objects and stuff. (ie application.internetexplorer.window.document.yaddayadda)

and WHEN we have that, we have the world in our greedy little scripting hands.

#46788 03/09/03 08:59 AM
Joined: Dec 2002
Posts: 2,985
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
*Watchdog has a non-care factor.

I'll just use my bosses fax to send faxes and keep mIRC for IRC.

#46789 03/09/03 03:08 PM
Joined: Feb 2003
Posts: 309
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Feb 2003
Posts: 309
*thinks watchy is deliberately missing the point*

I can think of nice uses like integrating with all sorts of other web services - from stock market data and whatever.

C'mon, think hard - you need a welder, a microprocessor, a RF chip and a robot arm, weld these all to your fridge (provided, of course, its a new fangle-dangled internet fridge) and mutter some holy words - I sure as hell could use a /sf2 alias to get me another beer from the fridge, or scratch where i can't be bothered reaching....

Perhaps a little far fetched, but its teh best use i could think of for it. *sighj* i'm off to play internet chess - i say i'm 13 so I don't feel so shamed when a 12 yold russian kid kicks my butt...

#46790 03/09/03 07:27 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
Quote:
So much of the complexity would be hidden behind apis


There is a difference between "hidden" and "nonexistent". COM objects are very slow, WSH is even slower. Sockets might not be the easiest method, but I'd say it would still be faster than using a COM object like you suggest.

#46791 03/09/03 11:57 PM
Joined: Jul 2003
Posts: 742
Hoopy frood
Offline
Hoopy frood
Joined: Jul 2003
Posts: 742
i know some PHP...but where exactly in mirc can i run PHP?


confused confused confused confused confused


http://MTec89Net.com
irc.freenode.net #MTec89Net
#46792 04/09/03 04:38 PM
Joined: Feb 2003
Posts: 309
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Feb 2003
Posts: 309
Speed, simplicity, power - pick two... i'd be willing to hope that using a COM interface via PHP + ADODB (a lib for php) to access mysql would still end up faster than having my poor mirc lock up for some time qith each larger query - yes i'm useing a mirc based scoket script to do it, yes i know a dll exists for it, and no, the dll will not work how i want it to.
Also, considering just how many dodgy com objects exist for accessing mysql (you try a query and -splat- goes yours pc) this is a better solution for that.

Anyway, you love your C of course your going to be a speed lover. *sigh*

As for "Where can I use PHP in mirc" ... mircscripts.org -> COM Objects tutorial (written by, low and behold, me)... read that. Read it again. understand OOP in all of its niceities. Createw a few COM scriplets with javascript/vbscript first.
Find this post again - follow the link to the article, and find the PHP CVS (and the activePHP com bit). Take PHP knowledge, blend with WSH scriptlets knowledge, and hey presto.

#46793 04/09/03 04:40 PM
Joined: Feb 2003
Posts: 309
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Feb 2003
Posts: 309
just a foot note: i reread the bit about complexity in the google api - tehre's precisely 3 methods provided by the api. a dosearch(), a viewCache(), and somethng else (i can't remember)...

Thats gotta be simpler than ugly sockets and trying to strip out html.

Oh well

#46794 05/09/03 02:50 AM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
You can access both their web CGI and their API directly by /sockets.

No matter which way you slice it, you are going to be parsing XML (aka HTML) tags from your results. Using google's new API is nearly the same as using their web CGI, except you get plain XML results with no other page formatting, banners, or markup to strip out. Yet, you still have to parse the XML tags just the same.

This is what $regex is for-- there is no way around it short of (yet another) DLL to do it for you.

- Raccoon


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
#46795 05/09/03 12:53 PM
Joined: Dec 2002
Posts: 2,985
Hoopy frood
Offline
Hoopy frood
Joined: Dec 2002
Posts: 2,985
If I wanted to automate my house the last things I would use is PHP or COM or even mIRC sockets or mIRC anything. I'd use the right tool for the right job, a PLC unit such as Clipsal C-Bus, etc. I don't know why you maintain this fixation with mIRC becoming a conglomerate of computer management technologies when you know as well as I do that it's a mere pipedream and always will be.

#46796 05/09/03 08:49 PM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
I think it would be sweet if I could set a /timer for mIRC to make me toast in the morning.

Morning toast is the #1 ingredient to success.


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
#46797 06/09/03 06:01 AM
Joined: Feb 2003
Posts: 309
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Feb 2003
Posts: 309
If they can put a TV in a car then I want a mirc powered toaster :P

#46798 06/09/03 06:12 AM
Joined: Feb 2003
Posts: 309
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Feb 2003
Posts: 309
*begs to differ a little*... the XML parsing is taken care of by PHP -> all hidden behind an api... you just get back a nice array of results.

http://www.php.net/manual/en/ref.xmlrpc.php + the DOM XML functions... + XML parser functions....

#46799 06/09/03 07:56 AM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
#46800 07/09/03 01:41 PM
Joined: Aug 2003
Posts: 41
T
Ameglian cow
Offline
Ameglian cow
T
Joined: Aug 2003
Posts: 41
CloCkWeRx: If you're so enthusiastic about this, make us a DLL. Then we'll believe.

#46801 07/09/03 03:15 PM
Joined: Dec 2002
Posts: 2,809
C
Hoopy frood
Offline
Hoopy frood
C
Joined: Dec 2002
Posts: 2,809
To quote that URL:

Quote:
This extension is EXPERIMENTAL. The behaviour of this extension -- including the names of its functions and anything else documented about this extension -- may change without notice in a future release of PHP. Use this extension at your own risk.


Yeah that really sounds like something you should use...

#46802 08/09/03 06:16 AM
Joined: Feb 2003
Posts: 309
C
Fjord artisan
OP Offline
Fjord artisan
C
Joined: Feb 2003
Posts: 309
OMG I didn't click that that was what your logo was about racoon!

It jsut hit home. I've been staring at it for the last few minutes goign ... odd... its changed...

go mirc powered kitchen appliances :P

The_Mega_ZZTer; you don't get com scriptlets do you? I've already written a tutorial on both using and making com objects which is by far too much effort for me if i'm to try to pretend i'm a bum (i am, you gotta believe me,.those two jobs i work aren't really work, just an excuse to be lazy in another location.)

codemaster...
'experimental' in php documentation means 'i was too lazy to change this'... it's *reasonably* stable.... so it'll only crash when you do funky stuff with it (ie power the toaster)
and if we stuck to not playing with experimental and buggy stuff, where would we be? we wouldn't be cursed with windows. Hrm. Maybe some merit is in your point.

#46803 08/09/03 09:58 PM
Joined: Sep 2003
Posts: 4
C
Self-satisified door
Offline
Self-satisified door
C
Joined: Sep 2003
Posts: 4
alright, so i was going to follow all this up with a link to some bloke shoving a coffee maker into his pc case but couldn't find the link, so in my search i came across these other alternatives. Perhaps you could at least use mirc to execute some external program macro which will send info through usb/ata/etc to start all this craziness going, either way I found it entertaining, if not in a worrying way.


http://www.vnunet.com/News/1133907 - article about coffee maker pc case

http://www.vnunet.com/News/1129600 - egg frying CPU

http://www.itxpc.com/toaster.htm

http://www.casemodgod.com/kitchen_toaster_pc.htm

http://www.cyberguys.com/templates/searchdetail.asp?T1=142+0905 - USB cup warmer

http://www.cyberguys.com/templates/searchdetail.asp?T1=142+0910 - USB air purifier

http://www.thinkgeek.com/stuff/looflirpa/igrill.shtml - george foreman USB iGrill

http://www.grandtec.com/USBVibe.htm - USB vibrator, i mean massager, i mean how did this get in here?!

http://www.charlotte.com/mld/charlotte/news/weird_news/6514371.htm - i just found this amusing

laugh

#46804 08/09/03 10:16 PM
Joined: Feb 2003
Posts: 2,812
Hoopy frood
Offline
Hoopy frood
Joined: Feb 2003
Posts: 2,812
All very funny...
you'll fit right in here. grin


Well. At least I won lunch.
Good philosophy, see good in bad, I like!
Page 1 of 2 1 2

Link Copied to Clipboard