Shoutbox

Web services plugin [DEV/BETA] - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Messenger Plus! for Live Messenger (/forumdisplay.php?fid=4)
+---- Forum: Scripting (/forumdisplay.php?fid=39)
+----- Forum: Plug-Ins (/forumdisplay.php?fid=28)
+------ Thread: Web services plugin [DEV/BETA] (/showthread.php?tid=38152)

Web services plugin [DEV/BETA] by Yousef on 02-09-2005 at 10:18 PM

Well, after I saw Sprinkles' idea about web services, I started coding.
The idea of this plugin is to easily share information from the net with your contacts. For example, by typing "/xparse quote einstein" some quotes of einstein will be sended automatically.
Inspired by TB's talkers I decided to make it a very flexible plugin. People can make scripts to handle different websites. The plugin creates a Microsoft XML Domdocument object from a given url, and then the script can filter out the necessary information. Instead of talkers, I call these scripts 'parsers'. At the moment I created 4 different parsers:

  • News parser, grabs the latest news headers from cnn
  • Quote parser, grabs the Quotes of the Day from quotationspage.com, or searches for quotes when an argument is supplied
  • Family guy quote parser, send random quotes from 'The family guy' to your contacts
  • Msgweb news parser, quite useless maybe, but it gets the latest news from my website
  • Azlyrics.com parser, search for lyrics
  • dictionary.com, get the meaning of a word...
  • Parser for http://www.timeanddate.com/worldclock/ to get the current time in all big cities

For now I didn't make a dll yet, so I can't upload a plugin version, but here is a screenshot of the config window. It clearly illustrates the use of the plugin:

[Image: attachment.php?pid=377804]

I'd like to know
  • what you think of this idea.
  • what features you'd like to see in the final version.
  • what parsers you think would be useful.
  • who's interested in developing parsers
  • what would be a good name for the plugin ;)

For the scripters, here is the source of the quote parser (quote.vbs)
code:
sub info() 'purpose: give the config screen all the parser info
    engine.description = "Share more than 20,000 famous quotes with your contacts"
    engine.help = "This parser gets the quotes from http://www.quotationspage.com. When you don't supply a parameter the parser will show you the quotes of the day. Otherwise it'll do a search for the supplied text."
    engine.syntax = "<search (optional)>"
end sub

sub run()
    if trim(engine.argument) <> "" then
        url = "http://www.quotationspage.com/search.php3?homesearch=" & trim(engine.argument)
    else
        url = "http://www.quotationspage.com/qotd.html"
    end if
    engine.getXML cstr(url), "parse", true
end sub

'There is a regularity in the source code of the website:
'all quotes are between <dt> tags
'all authors are between <dd> tags, and are shown bold (with a <b> tag)
'with this information we can make the follow code:
'note that the xml object is data.xml

sub parse(xml) 'purpose: filter the xmlobject
    i = 0
    for each item in xml.getElementsByTagName("dt")
        if str = "" then
            str = item.Text & vbcrlf & "---" & xml.getElementsByTagName("dd").item(i).getElementsByTagName("b").item(0).text
        else
            str = str & vbcrlf & vbcrlf & item.Text & vbcrlf & "---" & xml.getElementsByTagName("dd").item(i).getElementsByTagName("b").item(0).text
        end if
        i = i + 1
    next
    engine.output cstr(str)
end sub

As you can see it ain't that much code to handle a single website...

Let me hear what you think

edit: Installer link:
http://shoutbox.menthix.net/attachment.php?pid=379120

API Tutorial link:
http://www.msgweb.nl/en/MEWS/tutorial.php


RE: Web services plugin [DEV] by jameslives on 02-10-2005 at 01:37 PM

this plugin would be great!
and what about a world clock?
could you put one on


RE: Web services plugin [DEV] by user27089 on 02-10-2005 at 01:39 PM

That looks amazing, seriously... looks like lotsa code will be needed :p.


RE: Web services plugin [DEV] by SilentRevolution on 02-10-2005 at 02:03 PM

looks pretty cool..i like it


RE: Web services plugin [DEV] by Yousef on 02-10-2005 at 02:27 PM

thx for your reactions, I just made a parser for azlyrics.com and dictionary.com. I'll now work on the "parser api" documentation and then upload a test version ;)

edit:

quote:
Originally posted by jameslives
this plugin would be great!
and what about a world clock?
could you put one on
Just made one for http://www.timeanddate.com/worldclock/, it took me only five minutes with the 'api' :o).  Maybe quite useless to get it from a website, because you could get the times straight from your own computer I guess. But it will be a nice example parser.
RE: Web services plugin [DEV] by Dempsey on 02-10-2005 at 03:00 PM

yea this looks great it looks like a lot of works gone into it.   Is there going to be some form of online database where people can upload there parsers for other people to access.  Then you could maybe have a 'Check for New Parses' button in the plugin.


RE: Web services plugin [DEV] by Yousef on 02-10-2005 at 03:04 PM

I'll make a parser database at my website http://www.msgweb.nl


RE: Web services plugin [DEV] by user27089 on 02-10-2005 at 03:05 PM

Sounds cool, how will people make the parsers?


RE: Web services plugin [DEV] by jameslives on 02-10-2005 at 03:06 PM

quote:
Originally posted by noelie


edit:
quote:
Originally posted by jameslives
this plugin would be great!
and what about a world clock?
could you put one on
Just made one for http://www.timeanddate.com/worldclock/, it took me only five minutes with the 'api' :o).  Maybe quite useless to get it from a website, because you could get the times straight from your own computer I guess. But it will be a nice example parser.

great!
I wonder what you could call it
RE: Web services plugin [DEV] by Dempsey on 02-10-2005 at 03:10 PM

quote:
Originally posted by traxor
Sounds cool, how will people make the parsers?
Well i dont think they'ree need a dedicated program as its seems to be just a simple script, but saying that i spose a little prog to help could make it even easier to make them
RE: Web services plugin [DEV] by Yousef on 02-10-2005 at 03:13 PM

quote:
Originally posted by Dempsey
quote:
Originally posted by traxor
Sounds cool, how will people make the parsers?
Well i dont think they'ree need a dedicated program as its seems to be just a simple script, but saying that i spose a little prog to help could make it even easier to make them
Yeah, for now only vb/js scripters can make parsers. I was thinking about an extension to easily make them. This could be done by letting the user select the needed info from a treeview (Like FireFox's 'DOM Inspector')
RE: Web services plugin [DEV] by Dempsey on 02-10-2005 at 03:17 PM

quote:
Originally posted by noelie
. I was thinking about an extension to easily make them. This could be done by letting the user select the needed info from a treeview (Like FireFox's 'DOM Inspector')
Yea that would be cool, so would that mean even people without vb/js knowledge could make parses?  or would it just simplify it for those who know vb/js?

RE: Web services plugin [DEV] by Yousef on 02-10-2005 at 03:23 PM

quote:
Originally posted by Dempsey
quote:
Originally posted by noelie
. I was thinking about an extension to easily make them. This could be done by letting the user select the needed info from a treeview (Like FireFox's 'DOM Inspector')
Yea that would be cool, so would that mean even people without vb/js knowledge could make parses?  or would it just simplify it for those who know vb/js?
Both, but at the moment it's not at the top of my tasklist ;)
RE: Web services plugin [DEV] by user27089 on 02-10-2005 at 03:24 PM

you could maybe just make a tutorial on how to easily make the parsers, it would be simple enough really :s...


RE: Web services plugin [DEV] by Yousef on 02-10-2005 at 03:26 PM

quote:
Originally posted by traxor
you could maybe just make a tutorial on how to easily make the parsers, it would be simple enough really :s...
That's what I'm going to do first indeed. After I get something to drink ;)
RE: Web services plugin [DEV] by sprinkles on 02-10-2005 at 11:17 PM

This all looks great! :D


RE: Web services plugin [DEV] by (CyBeRDuDe) on 02-11-2005 at 09:28 AM

WOW!!!! Gonna be amazing! :D... Looking forward for this!!! Good job, and good luck!!!


RE: Web services plugin [DEV] by John Anderton on 02-11-2005 at 10:19 AM

Good idea imo. Keep it up. :)


RE: Web services plugin [DEV] by user27089 on 02-11-2005 at 10:20 AM

When will we be expecting the tutorial, or if its that basic and I can learn... Then I would make some parsers for a few sites or something, I'm willing to if you would like or w/e...


RE: Web services plugin [DEV] by Dempsey on 02-11-2005 at 10:26 AM

yea i'd like to make a few parsers too and also i could host an online parsers database thing if you want?  So new or updated parsers can be downloaded from within in the plugin?

btw what language are you making this in?


RE: Web services plugin [DEV] by user27089 on 02-11-2005 at 10:29 AM

I've got a host that I never use and it has loads of space and unlimited bandwith, so, I could host as many as you please also...

Like I said, just need to learn...

Would it be possible to make it multi-lingual somehow?


RE: RE: Web services plugin [DEV] by Yousef on 02-11-2005 at 11:06 AM

quote:
Originally posted by Dempsey
btw what language are you making this in?

I'm making it in, ugh, VB. I know a lot of you wouldn't recommend it. But although I have some C++ skills I thought it would took me longer to develop it in C++. And so far, VB didn't give me any problems. Instead, I think VB just took a lot of extra coding out of my hands.

quote:
Originally posted by traxor
I've got a host that I never use and it has loads of space and unlimited bandwith, so, I could host as many as you please also...
Thanks for your offer, I'll surely consider it. (are you on #msgplus often?)

quote:
Originally posted by traxor
Would it be possible to make it multi-lingual somehow?
Well, as far as the main plugin, it doesn't contain that many text (see screenshot). Also it's a bit unrealistic that all parsers will be written in several languages. So I don't think it would be useful to translate the main plugin.
But of course I could make a parser for a babelfish a like translation site.

quote:
Originally posted by traxor
When will we be expecting the tutorial, or if its that basic and I can learn...
Almost finished :)

RE: Web services plugin [DEV] by Dempsey on 02-11-2005 at 11:13 AM

if u do want an online db thingee let me know, ive got 12GB webspace, that should be enough :p


RE: Web services plugin [DEV] by user27089 on 02-11-2005 at 11:25 AM

quote:
Originally posted by noelie
Well, as far as the main plugin, it doesn't contain that many text (see screenshot). Also it's a bit unrealistic that all parsers will be written in several languages. So I don't think it would be useful to translate the main plugin.
But of course I could make a parser for a babelfish a like translation site.

If it doesn't contain that much text, it would be easy to translate or w/e... There are a lot of dutch and french users of plus! and many other people that use plus! in different languages, and it may be helpful to have several parsers that are different languages or w/e...
RE: Web services plugin [DEV] by Yousef on 02-11-2005 at 12:09 PM

quote:
If it doesn't contain that much text, it would be easy to translate or w/e... There are a lot of dutch and french users of plus! and many other people that use plus! in different languages, and it may be helpful to have several parsers that are different languages or w/e...
Yeah, you've got a point there, I'll consider it ;)

Anyway, here's a little tutorial: How to make your own parsers. Tell me what you think of the way it works. I'll now work on releasing an alpha version.
RE: Web services plugin [DEV] by user27089 on 02-11-2005 at 12:10 PM

Seems like a good tutorial to me, but the <textarea>'s shouldn't have the same coloured background, make it a different colour, its a little confusing, other than that (y).


RE: Web services plugin [DEV] by Yousef on 02-11-2005 at 12:15 PM

quote:
Originally posted by traxor
Seems like a good tutorial to me, but the <textarea>'s shouldn't have the same coloured background, make it a different colour, its a little confusing, other than that (y).
That's because it isn't a <textarea> ;), just refresh, I changed it
RE: Web services plugin [DEV] by user27089 on 02-11-2005 at 12:19 PM

quote:
Originally posted by noelie
quote:
Originally posted by traxor
Seems like a good tutorial to me, but the <textarea>'s shouldn't have the same coloured background, make it a different colour, its a little confusing, other than that (y).
That's because it isn't a <textarea> ;), just refresh, I changed it

Thats much better, so do you need visual basic to do this, or can you do it in notepad and save it as a *.vps or whatever?
RE: Web services plugin [DEV] by Dempsey on 02-11-2005 at 12:28 PM

you can just make vbs files in any text editor


RE: Web services plugin [DEV] by Yousef on 02-11-2005 at 12:35 PM

quote:
Thats much better, so do you need visual basic to do this, or can you do it in notepad and save it as a *.vps or whatever?
Updated the tutorial.

Anyway, there's a little problem with Javascript parsers. It seems I can't call basic functions like toLowerCase from the parsers. Do I really need to add a javascript object with all the standard functions :o

btw: what would be a good name for the plugin? 'web services' or 'internet services', or something more original..?
RE: Web services plugin [DEV] by sprinkles on 02-11-2005 at 01:06 PM

Question: Can parsers contain user entered variables (Thinking back to the cinema example, this wouldn't work unless the user could enter the cinema name (http://www.sprinkles.me.uk/odeonxml.php?cinema=User Cinema))

edit: stupid question, just read the tut :D


RE: Web services plugin [DEV] by Dempsey on 02-11-2005 at 02:41 PM

i like the name Web Services, but although it says what it does, i think it sounds a bit boring lol, maybe soemone can think of a better name


RE: Web services plugin [DEV] by Yousef on 02-11-2005 at 03:17 PM

quote:
Originally posted by Dempsey
i like the name Web Services, but although it says what it does, i think it sounds a bit boring lol, maybe soemone can think of a better name
Yeah atm everything is named 'Internet Services', but all original ideas are more than welcome.
edit: What about 'MEWS' (Messenger Web Services)?

I just builded the application into a DLL, and everything seems to work fine when I use the plugin in Messenger Plus! (h) Now I'm going away for an hour, after that I'll think of some extra features and make an installer etc.

edit: Language support is now almost implemented. I deed keep it simple, so there's only a stringtable in a xml file, don't know whether that suits for all languages (like unicode langs etc.)...
RE: Web services plugin [DEV] by jameslives on 02-12-2005 at 10:02 AM

MEWS is a great name!


RE: Web services plugin [DEV] by Yousef on 02-12-2005 at 12:30 PM

I attached an installer for the test version.

This version is only for testing purposes!

(didn't have much time to test it, so don't blame me 2 much if it doesn't work...) Got to go now ;)

Edit: I updated the installer, bit uglier but seems to work fine!


RE: Web services plugin [DEV] by Eljay on 02-12-2005 at 12:44 PM

doesnt work for me
get runtime errors when i start msn


RE: Web services plugin [DEV] by user27089 on 02-12-2005 at 03:04 PM

Whenever I start msn messenger with the web services plugin installed, I get the following error:

[Image: attachment.php?pid=379872]

Versions:
Windows Version: Windows XP, 5.01.2600
Messenger Client Version: 7.0.0425
Messenger Plus! Version: 3.40.0112


RE: Web services plugin [DEV] by crank on 02-12-2005 at 03:37 PM

AWESOME!!!!
Works fine for me but i can't acces your parser tutorial and other pages :s

P.S. echt goede plugin man!


RE: Web services plugin [DEV] by Yousef on 02-12-2005 at 03:50 PM

thx cr@nk :) yeah the url's aren't set to the right page, thanks for reminding me.
I'll check why the others get the error..


RE: Web services plugin [DEV] by TGG on 02-12-2005 at 07:11 PM

Great Plugin Noelie (Y) :D!
Noelie just sent it to me with a different installer, and it worked fine with that.


RE: Web services plugin [DEV] by jameslives on 02-13-2005 at 12:58 PM

this is great it works fine


RE: Web services plugin [DEV] by Yousef on 02-13-2005 at 01:05 PM

good to hear it's working now. I still need to repair some things (like share a parser, and the internet links). Tell me when you think there are any features missing. Also I'd like to know whether anyone is willing to make a translation file for French & Spanish, or other languages.


RE: Web services plugin [DEV] by Eljay on 02-13-2005 at 01:16 PM

still not working fine for me :S

EDIT:

just regsvr32'ed the dlls and it works fine now, nice plugin (Y)


RE: Web services plugin [DEV/BETA] by Yousef on 02-13-2005 at 07:57 PM

Updated the installer again :)
http://shoutbox.menthix.net/attachment.php?pid=379120


RE: Web services plugin [DEV/BETA] by leito on 02-13-2005 at 08:27 PM

Juzzi I can help with the spanish version, PM me.


RE: Web services plugin [DEV/BETA] by Yousef on 02-13-2005 at 09:18 PM

Updated the installer again, when a parser returns messages too long to fit into a single message, it's split into multiple messages now.

leito, I would be pleased (I pm you tomorrow)


RE: Web services plugin [DEV/BETA] by OWNd742 on 02-13-2005 at 10:11 PM

so basically in this sense u can have a block checker ?

lets say you have a common host server website that has the block checking thing on it, then u just insert the email and it will show u if there online or not. this is possible with this web plugin right?

but keep it going!


RE: Web services plugin [DEV/BETA] by Tochjo on 02-13-2005 at 10:34 PM

quote:
Originally posted by OWNd742
website that has the block checking thing on it
These block checking methods are unreliable, as are all other block checking methods. They simply simulate another address and use that to see if the person you want to check is online. However, if that person has enabled the checkbox that ensures only people in his allow list can see his status, it will always indicate he's offline, even if he is online.

You can read more about that at Block checkers DO NOT work :)
RE: Web services plugin [DEV/BETA] by OWNd742 on 02-13-2005 at 10:47 PM

for crap sakes i still want one, i dont care if it is unreliable it still gives us a 50 50 chance to see if they really are offline....


RE: Web services plugin [DEV/BETA] by Concord Dawn on 02-13-2005 at 11:59 PM

I can help with French, PM me.


RE: Web services plugin [DEV/BETA] by (CyBeRDuDe) on 02-14-2005 at 12:43 AM

quote:
Originally posted by OWNd742
for crap sakes i still want one, i dont care if it is unreliable it still gives us a 50 50 chance to see if they really are offline....

They are not reliable AT ALL!!!!... FFS!!!! GET IT!!!
The MSN Protocol once had a "flaw" that you could "abuse" to get the information if you were blocked or not... it would check there status and the status recived were a number (I don't remember the exact number, but something like this), if the contact was offline you would the code 216 and if they had blocked you you would get the code 215.. but since msn 6.xx this "flaw" have been fixed by MSN, now you get the code 216 for offline no matter if they have blocked you or are truly offline...
I don't know about the method about "faking" an account, how reliable it is, but if the user have the "privacy" setting enabled then you would always see them as offline no matter what.... but I don't know if it works if they have this setting disabled... :S.. but this is the only way it MIGHT be reliable... but there is only a VERY limited number of people using this method!!! all on all!!!!... BLOCKCHECKERS DO NOT WORK!!!! Just get it into your head!!!.. Please understand!!!! We don't want to listen to all your "we want a blockchecker" posts!!!

RE: Web services plugin [DEV/BETA] by Yousef on 02-14-2005 at 06:30 AM

Thank you Cuberdude, don't need any blockchecker talk in this thread...

If you think it's technically possible, make one yourself.
-end of subject-


RE: Web services plugin [DEV/BETA] by xsRush on 02-14-2005 at 10:08 AM

Nice plug-in.

As for a name how about:
Web Parser Plus.
Parser Plus.

Looks like you have found a name already though.

Again nice plug-in (Y)


RE: Web services plugin [DEV/BETA] by KeyStorm on 02-14-2005 at 10:17 AM

Oh, didn't happen upon this thread until now. It's great, I'll gotta test it :O


RE: Web services plugin [DEV/BETA] by Yousef on 02-14-2005 at 04:10 PM

quote:
Originally posted by xsRush
Nice plug-in.

As for a name how about:
Web Parser Plus.
Parser Plus.

Looks like you have found a name already though.

Again nice plug-in (Y)
thanks xsRush, but I prefer MEWS :)
quote:
Originally posted by KeyStorm
Oh, didn't happen upon this thread until now. It's great, I'll gotta test it :O
Cool, tell me your findings
RE: Web services plugin [DEV/BETA] by jameslives on 02-14-2005 at 04:28 PM

sometimes when i load msn (since i installed plugin) it comes up with about 5 errors from your plugin and some other plugins then they are all disabled.


RE: Web services plugin [DEV/BETA] by Concord Dawn on 02-14-2005 at 04:32 PM

You should have the installer find download all the dependencies, like SPNG.


RE: Web services plugin [DEV/BETA] by Yousef on 02-15-2005 at 07:20 PM

I'd like to know now whether anyone has had problems with the latest installer (you can always pm me), as well as any problems with the plugin itself. This because I'm planning to release it at the end of this week. Feature suggestions are always welcome as well.


RE: Web services plugin [DEV/BETA] by jameslives on 02-16-2005 at 04:44 PM

Sometimes (hardly ever) when i click a function for this plugin in the plugins menu it doesnt insert the '/'
could be my msn though


RE: Web services plugin [DEV/BETA] by TGG on 02-16-2005 at 05:22 PM

Does the azlyrics parser search by artist aswell, or is it just lyrics?
If not, i think there should be one that finds lyrics by artist


RE: Web services plugin [DEV/BETA] by Yousef on 02-16-2005 at 05:35 PM

it returns the first lyric that it finds with the given keywords. So you can supply artist & lyrics, like: "Eminem like toy soldiers" or "lopez get right" etc. When you only supply an artist name, how should we know what song you want the lyrics for?


RE: Web services plugin [DEV/BETA] by riahc4 on 02-16-2005 at 11:38 PM

Could a currency coverter be possible?


RE: Web services plugin [DEV/BETA] by Yousef on 02-17-2005 at 06:18 AM

great idea, but place parser ideas
here


RE: Web services plugin [DEV/BETA] by Sypher on 02-18-2005 at 11:54 AM

Hmm this doesn't really work on Plus! 3.50.0120 (Beta)

The /xmews doesn't seem to work, and the /xparse doesn't work either...


RE: Web services plugin [DEV/BETA] by Yousef on 02-18-2005 at 02:06 PM

quote:
Originally posted by SyPhEr
Hmm this doesn't really work on Plus! 3.50.0120 (Beta)

The /xmews doesn't seem to work, and the /xparse doesn't work either...
Where can I download that version? Anyway, does the plugin show up in the menu, and does /xmewsconfig work (as well as the try command button)?
RE: Web services plugin [DEV/BETA] by Dempsey on 02-18-2005 at 02:10 PM

You cant download that version, its currently it private beta testing


RE: RE: Web services plugin [DEV/BETA] by Sypher on 02-18-2005 at 03:33 PM

quote:
Originally posted by Juzzi
quote:
Originally posted by SyPhEr
Hmm this doesn't really work on Plus! 3.50.0120 (Beta)

The /xmews doesn't seem to work, and the /xparse doesn't work either...
Where can I download that version? Anyway, does the plugin show up in the menu, and does /xmewsconfig work (as well as the try command button)?



/xmewsconfig works, but doing "/xmews azlyrics 3 Doors down - It's not me gives me 2 msgboxes:

quote:
XML Document moet een element hebben op het hoogste niveau


and

quote:
-2147417843 Automation Error


The last error keeps on coming as long as the window is open...