Shoutbox

Plugin Idea: Web Services - 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: Plugin Idea: Web Services (/showthread.php?tid=37910)

Plugin Idea: Web Services by sprinkles on 02-04-2005 at 11:39 AM

Just had a good idea for a plugin. It would be great if you could add commands with urls of webservices. I'll explain:

1) User downloads webservices plugin
2) User adds a webservice
3) User types /servicename [parameter] e.g /cinema Cardiff
4) Plugin Recognises commands and loads the appropriate url (not visible to user)
5) Plugin puts text in message and sends to contact.

This would mean that people providing information on the internet could easily provide the information to messenger users without the need to develop an individual plugin.

Example:
Prior to the conversation, Richard has added www.script.com/cinema.php?name= with the command /cinema into the plugin settings

Dave says:
What's on at the cinema tonight?
Richard says:
I'll check

--Richard types /cinema Leicester Square
--Plugin visits script www.script.com/cinema.php?name=Leicester%20Square

Richard says:
Film Choices:
Team America: World Police (15)
Saturday 18.00, 19.00, 20.15.

Assault On Precinct 13 (15)
Saturday 17.45, 20.30, 21.00



Cheesy example but it would be quite cool, trouble is the only programming skills I have are in php, so wouldn't know where to begin coding a plugin!


RE: Plugin Idea: Web Services by KeyStorm on 02-04-2005 at 11:49 AM

In any case it would have to be /xwebservice cinema Cardiff

Anyway, who would add webservices?
I would understand if XML pages were more usual to rertrieve data easily, but how do you plan the plugin to parse the actual site without having to regex (to code an inteligent reader) like a madman?

The need for more XML sources seems really prominent to me :^)


RE: Plugin Idea: Web Services by sprinkles on 02-04-2005 at 11:53 AM

Ok, I maybe used the term web service a bit loosely, I'm not talking about xml web services here, just plain text web pages which are dynamically updated. :)


RE: Plugin Idea: Web Services by KeyStorm on 02-04-2005 at 12:10 PM

Anyway, XML is better than plain text. But there are no plaintext sources in most commercial websites.

If there's the need to parse the html of a site and extract the infromation (regexing)... It's just too much. And normal users won't be able to do that.

On the other hand, if it was usual to offer XML output of the billboards or any other boards and tables of services, the world would be much better. :P

The idea is all right, but it's really difficult to achieve a system that would work well easily.

For example:
If the public transport companies would have XML oputput I would code A system that would tell me exactly when to take a train if I want to be at a certain time in a certain place and I could add that to my digital scheduler without having to look at the timetables myself and calculate the time I need to get to some place.
Unluckily XML (or say plain text) is very rare in these cases. Neither companies nor webmasters care about standardised outputs that may interact way better with many other services.


RE: Plugin Idea: Web Services by sprinkles on 02-04-2005 at 12:30 PM

I understand our point, but I was thinking the parsing would be done by a php/cgi script, which just outputs the information in plaintext


RE: Plugin Idea: Web Services by KeyStorm on 02-04-2005 at 12:42 PM

But the problem's still the same: you gotta get the pages heavily parsed. It's possible, but you may need hours for only one billboard to work properly.

However the variety of websites makes it a tough work to parse that amount of information.
This somehow reminds me of vWatch, a project of which I'm co-manager, that does automatically get the latest versions of any apps from reading and interpreting the author's webpage on-the-fly. It was really difficult to make a system that got only one piece of data, like the version number. Imagine what it would be to parse much more information with the risk of existing a layout change in the website which screws up all the work.

If there was a well founded and reputated project where people would help to get the data parsed and outputted in standard language, namely XML, it would be definitely easier.


RE: Plugin Idea: Web Services by sprinkles on 02-04-2005 at 12:48 PM

ok, I made the example. It gets film times for Uk Odeon cinemas

http://sprinkles.me.uk/odeon.php?cinema=

Try These if you don't know any odeons
http://sprinkles.me.uk/odeon.php?cinema=Sheffield
http://sprinkles.me.uk/odeon.php?cinema=Bridgend
http://sprinkles.me.uk/odeon.php?cinema=Wrexham

It looks a mess on the page, but if you view the source, it's formatted with \n, one film per line


RE: Plugin Idea: Web Services by KeyStorm on 02-04-2005 at 01:10 PM

Takes ages to load, but looks nice. (Y)
Now get it in XML, otherways it's a pain in the ass to read for a desktop app or a CGI.

XML allows to read and parse the full thing into multidimensional arrays being directly available to use by any language (must have XML libraries, but that's usual).


RE: Plugin Idea: Web Services by sprinkles on 02-04-2005 at 04:06 PM

Loading nearly instantly here, and i'm on dialup :S

I'll have a go at making it xml now

edit: Done:
http://sprinkles.me.uk/odeonxml.php?cinema=Bridgend
http://sprinkles.me.uk/odeonxml.php?cinema=West%20End
http://sprinkles.me.uk/odeonxml.php?cinema=Leicester%Square
http://sprinkles.me.uk/odeonxml.php?cinema=Sheffield
http://sprinkles.me.uk/odeonxml.php?cinema=Wrexham

etc...


RE: Plugin Idea: Web Services by L. Coyote on 02-04-2005 at 09:46 PM

The times tag is messy. Is it going to be shown like that to the user?

You could create a day tag.

<day name="THU">
<time>22:00</time>
</day>

Edit: btw, you might want to edit your post (in your post: edit button, next to quote, q. quote, etc.), instead of double-posting, as it is against the forum rules. ;)


RE: Plugin Idea: Web Services by sprinkles on 02-04-2005 at 09:55 PM

I'll try and work out a way of doing that, but the problem is the script is getting the data from a html page with no distinction between the times, the times are just displayed as they are shown there. I tried using ereg_replace, but then everytime a film title contained, for example THU, <day name="THU"> was displayed.

edit: Sorry about that, I've edited my posts now

edit 2: I have tidied it up a bit though, I got rid of the oddly spaced commas, and replaced the day names


RE: Plugin Idea: Web Services by KeyStorm on 02-05-2005 at 03:40 PM

Remember what I said of a project that would convert to XML different timetables and scheduled events. I've been searching and no group is doing such task and no specification has been written in that matter. I think we could write some work for that so we can do several documents that follow a usability standard made by ourselves (specification).

Just an idea :P


RE: Plugin Idea: Web Services by Dempsey on 02-05-2005 at 05:55 PM

Maybe another SF project KeyStorm?  I'd be willing to help although my PHP isn't great


RE: Plugin Idea: Web Services by sprinkles on 02-05-2005 at 09:20 PM

My PHP is dreadful too, I'm learning as I'm doing it!


RE: Plugin Idea: Web Services by KeyStorm on 02-06-2005 at 05:53 PM

Well, I was actually thinking of it and it would rather be a wikipedia-alike project.
We could be using own script to parse whatever site there's to parse but we would be offering the output in wikipages.

If I was a bit more regular in wikimedia community I could suggest them something like this, because this way people could join it easily and add more and more XML resources following the agreed specifications.

SF wouldn't fit our needs since there is no one and only application and we want to output information.

It's gotta be tough, but it would be fine indeed, imo. :)


RE: Plugin Idea: Web Services by Dempsey on 02-06-2005 at 10:21 PM

in a few days when i get my new reseller hosting account i could host this project, as it seems very intriging :D


RE: Plugin Idea: Web Services by Millenium_edition on 02-06-2005 at 10:26 PM

what you can do is making a certain template and using multiple php pages to convert each specific page :)

then use a vb plugin or something to retreive the info :D


RE: Plugin Idea: Web Services by KeyStorm on 02-07-2005 at 12:44 AM

I'll suggest this in wikimedia.org in a few days. Let's see what they say. We'd need to have a clear idea of what we plan to do and how.

Oh, and the plugin would be just a way to implement the service. :)


RE: Plugin Idea: Web Services by Yousef on 02-08-2005 at 10:35 AM

why don't let the plugin immediately get the info from the website instead of a special webserver? I was already experimenting a bit with this stuff

edit: I just found a way to convert some web pages to xml, seems to work fine. I'm planning to implement script files (vb/js) to handle different websites, just like theblasp's talkers. I'll go on tomorrow, party tonight :o)


RE: Plugin Idea: Web Services by sprinkles on 02-08-2005 at 03:57 PM

"why don't let the plugin immediately get the info from the website instead of a special webserver?"

Because then each website would need an individual plugin, thus completely missing the point :P

edit: Wow! You made the anonymous message bot - I use that all the time!


RE: Plugin Idea: Web Services by Yousef on 02-08-2005 at 04:22 PM

thx for the 'wow!' ;) (I'm making an online (internet) version of the bot as well atm)

but I think you're missing my point, the plugin will download the website, and will extract the correct information through a script file. I'll upload a test version probably tomorrow :)