Shoutbox

Make a script get content from a website - 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)
+----- Thread: Make a script get content from a website (/showthread.php?tid=97017)

Make a script get content from a website by gabrielkfl on 03-09-2011 at 04:15 AM

Put simply, what I want is a function that get the content of a text file hosted in the web into a string. Something like this:

var content = download( "http://www.example.com/whatever.txt" );

Now the reason I want this is because I want my script to realize when updates are available online. If there's no way to get the content from the page, anything that allows me to check a status on the web will do. For example, it could check if a certain page exists, like this:

var exists = checkIfPageExists( "http://www.example.com/whatever.txt" );

Anything that allows me to check for updates to my script.



EDIT:
Oops, looks like the script I was searching for already exists.
I found it here: http://mpscripts.net/code.php?id=19

Very cool script, does EXACTLY what I wanted it to. Just found a couple bugs in it, and changed one or two tiny bits, but overall it's perfect.

I'm just gonna leave this page here in case someone shows up with the same doubt.


RE: Make a script get content from a website by matty on 03-09-2011 at 01:39 PM

However relying on your own code to do this isn't always the best option.

An alternative is to define the version information in the ScriptInfo.xml file and Plus! will automatically check the online database for a newer version (obviously once it is back up and online).

XML code:
<?xml version="1.0" encoding="UTF-16"?>
<ScriptInfo xmlns="urn:msgplus:scripts" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:msgplus:scripts PlusScripts.xsd">
    <Information>
        <Name>Screenshot Sender</Name>
        <Description>Allows you to easily send screenshots to your contacts.</Description>
        <Author>matty, Mattias &amp; Dempsey</Author>
        <AboutUrl>http://beta.screenshotsender.com</AboutUrl>
        <Version>5</Version>
        <UpdateId>SS5</UpdateId>        <Build>0062</Build>    </Information>
</ScriptInfo>


RE: Make a script get content from a website by gabrielkfl on 03-11-2011 at 12:19 AM

Okay, but where do I upload my script so that plus checks if it's updated?


RE: Make a script get content from a website by whiz on 03-11-2011 at 08:25 PM

You need to submit it to the Scripts Database.  You'll need a MyPlus! account (sign up or login here) to add contributions, which you can do from here.