Results 1 to 5 of 5

Thread: GetAndSafeWebText

  1. #1
    Join Date
    Jun 2007
    Posts
    785
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default GetAndSafeWebText

    Gets text between selected tags from a html page and safes them to your include Map.

    Website = the webpage you want to take from
    BeginTag is the tag befor the text (<HTML>for example).
    Endtag is the tag after the text (</HTML> for example).
    NameOfFile is how you wanna call the file that gets safed.

    SCAR Code:
    program New;

    var
      A, P : string;
      Text : TStringList;
      B, E, L : integer;

    {.Script Info:
    # ScriptName  = Function GetAndSafeWebText(BeginTag, EndTag, NameOfFile:string): boolean;
    # Author      = Dumpin
    # Description = Gets text between selected tags from a html page and safes them to your include Map
    # Version     =
    # Date        = 24-12-07
    # Comments    = Website = the webpage you want to take from
                    BeginTag is the tag befor the text (<HTML>for example).
                    Endtag is the tag after the text (</HTML> for example).
                    NameOfFile is how you wanna call the file that gets safed.
    /Script Info}

     

    Function GetAndSafeWebText(WebSite, BeginTag, EndTag, NameOfFile:string): boolean;
    begin
      repeat
        P := GetPage(Website);
        A := between(BeginTag, EndTag, P);
        Trim(A);
        Text := TStringList.Create;
        text.add(A);
        SaveToFile(Text, AppPath + 'Websafes\'+NameOfFile+'.txt');
        Result := true;
      until(B = 0);
    end;

     

    begin
        ClearDebug;
        GetAndSafeWebText('http://www.runescape.com/','<title>', '</title>', 'Runescape');
        writeln('succesfully safed');
    end.

    If you got questions, feel free to ask.

    [22:20] <[-jesus-]> freddy, go uninstall yourself

  2. #2
    Join Date
    Jul 2007
    Posts
    1,431
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Maybe example?

    Useful, maybe i'll use something like that, if i should make script with auth
    [CENTER][SIZE="4"]Inactive[/SIZE]I forgot my password[/CENTER]

  3. #3
    Join Date
    Oct 2006
    Location
    Ontario,Canada
    Posts
    1,718
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    ahem... save

    looks good though

  4. #4
    Join Date
    Apr 2007
    Posts
    2,593
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    SCAR Code:
    program New;

    var
      A, P : string;
      Text : TStringList;
      B, E, L : integer;

    {.Script Info:
    # ScriptName  = Function GetAndSafeWebText(BeginTag, EndTag, NameOfFile:string): boolean;
    # Author      = Dumpin
    # Description = Gets text between selected tags from a html page and safes them to your include Map
    # Version     =
    # Date        = 24-12-07
    # Comments    = Website = the webpage you want to take from
                    BeginTag is the tag befor the text (<HTML>for example).
                    Endtag is the tag after the text (</HTML> for example).
                    NameOfFile is how you wanna call the file that gets safed.
    /Script Info}



    Function GetAndSafeWebText(WebSite, BeginTag, EndTag, NameOfFile:string): boolean;
    begin
      repeat
        P := GetPage(Website);
        A := Between(BeginTag, EndTag, P);
        Trim(A);
        Text := TStringList.Create;
        Text.Add(A);
        SaveToFile(Text, AppPath + 'Web Savings\'+NameOfFile+'.txt');
        Result := true;
      until(B = 0);
    end;



    begin
        ClearDebug;
        GetAndSafeWebText('http://www.runescape.com/title.ws','currently ', ' people', 'Players');
        writeln(A);
        writeln('Succesfully Saved!');
    end.

  5. #5
    Join Date
    Jun 2007
    Posts
    785
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Negaal View Post
    Maybe example?

    Useful, maybe i'll use something like that, if i should make script with auth
    Run the script in the state it is at the moment. you will find the title of the Runescape website in scar 3.13/Websafes/Runescape

    [22:20] <[-jesus-]> freddy, go uninstall yourself

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •