Results 1 to 13 of 13

Thread: GetGithubPage - Works on any PC.

  1. #1
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default GetGithubPage - Works on any PC.

    Came across a site http://rawgit.com/ that https isn't required therefore people without OpenSSL can read it. This means you auto update your script from Github, and it should work for everyone.

    Just copy the URL from your browser while browsing the file you want to read, and use that as the URL parameter.

    Example:
    Simba Code:
    Writeln(GetGithubPage('https://github.com/SRL/SRL-6/blob/master/lib/utilities/drawing.simba'));

    And the function (ps & Lape):

    Simba Code:
    function GetGithubPage(const URL: String): String;
    var
      NewURL: String;
      p: Integer;
    begin
      Result := '';
      p := Pos('.com/', URL);
      if (p = 0) then
        Exit;

      NewURL := Copy(URL, p + Length('.com/'), Length(URL) - p + Length('.com/'));
      Result := GetPage('http://cdn.rawgit.com/' +  Replace(NewURL, 'blob/', '', [rfReplaceAll]));
    end;
    Last edited by Olly; 11-03-2014 at 08:24 PM.

  2. #2
    Join Date
    Jun 2007
    Location
    The land of the long white cloud.
    Posts
    3,702
    Mentioned
    261 Post(s)
    Quoted
    2006 Post(s)

  3. #3
    Join Date
    Dec 2011
    Location
    Hyrule
    Posts
    8,662
    Mentioned
    179 Post(s)
    Quoted
    1870 Post(s)

    Default

    Quote Originally Posted by The Mayor View Post
    Very nice!!!! I hate using google code just to update scripts
    ditto! Thanks Olly

  4. #4
    Join Date
    Oct 2006
    Posts
    6,752
    Mentioned
    95 Post(s)
    Quoted
    532 Post(s)

    Default

    Your the best @Olly;!!!
    “The long-lived and those who will die soonest lose the same thing. The present is all that they can give up, since that is all you have, and what you do not have, you cannot lose.” - Marcus Aurelius

  5. #5
    Join Date
    Aug 2007
    Location
    Colorado
    Posts
    7,421
    Mentioned
    268 Post(s)
    Quoted
    1442 Post(s)

    Default

    This is very handy; thank you.

    Current projects:
    [ AeroGuardians (GotR minigame), Motherlode Miner, Blast furnace ]

    "I won't fall in your gravity. Open your eyes,
    you're the Earth and I'm the sky..."


  6. #6
    Join Date
    Jan 2014
    Location
    New Found Land
    Posts
    108
    Mentioned
    3 Post(s)
    Quoted
    21 Post(s)

    Default

    nice work, sure to make everybodies live a little easier eh?

    "When all government, domestic and foreign, in little as in great things, shall be drawn to Washington as the center of all power, it will render powerless the checks provided of one government on another, and will become as venal and oppressive as the government from which we separated."

  7. #7
    Join Date
    Oct 2006
    Posts
    6,752
    Mentioned
    95 Post(s)
    Quoted
    532 Post(s)

    Default

    Found a problem with it @Olly;. It doesn't update when your github page updates. I changed a page of reflection last night ~ 8 hours ago, and according to rawgit, the page is still the same. So i'm assuming it refreshes the page at set intervals...
    “The long-lived and those who will die soonest lose the same thing. The present is all that they can give up, since that is all you have, and what you do not have, you cannot lose.” - Marcus Aurelius

  8. #8
    Join Date
    Mar 2013
    Posts
    1,010
    Mentioned
    35 Post(s)
    Quoted
    620 Post(s)

    Default

    Quote Originally Posted by elfyyy View Post
    Found a problem with it @Olly;. It doesn't update when your github page updates. I changed a page of reflection last night ~ 8 hours ago, and according to rawgit, the page is still the same. So i'm assuming it refreshes the page at set intervals...
    Their cdn service perm caches the page... It will never update :/
    #slack4admin2016
    <slacky> I will build a wall
    <slacky> I will ban reflection and OGL hooking until we know what the hell is going on

  9. #9
    Join Date
    Oct 2006
    Posts
    6,752
    Mentioned
    95 Post(s)
    Quoted
    532 Post(s)

    Default

    Quote Originally Posted by Harrier View Post
    Their cdn service perm caches the page... It will never update :/
    Oh well then that is kinda a problem haha

    Just saw this as well

    "It's best to use a specific tag or commit hash in the URL (not a branch). Files are cached permanently after the first request."
    “The long-lived and those who will die soonest lose the same thing. The present is all that they can give up, since that is all you have, and what you do not have, you cannot lose.” - Marcus Aurelius

  10. #10
    Join Date
    Mar 2013
    Posts
    1,010
    Mentioned
    35 Post(s)
    Quoted
    620 Post(s)

    Default

    Quote Originally Posted by elfyyy View Post
    Oh well then that is kinda a problem haha
    Guessing Olly forgot to read the FAQ :/
    #slack4admin2016
    <slacky> I will build a wall
    <slacky> I will ban reflection and OGL hooking until we know what the hell is going on

  11. #11
    Join Date
    Nov 2007
    Location
    46696E6C616E64
    Posts
    3,069
    Mentioned
    44 Post(s)
    Quoted
    302 Post(s)

    Default

    An easy fix would be to use this for example:
    Progress Report:
    http://static.frement.net/proxy.php?u=https://raw.githubusercontent.com/SRL/SRL-6/master/lib/utilities/drawing.simba
    Last edited by Frement; 11-20-2014 at 01:28 PM. Reason: Apparently someone can't use their brain.
    There used to be something meaningful here.

  12. #12
    Join Date
    Nov 2011
    Location
    England
    Posts
    3,072
    Mentioned
    296 Post(s)
    Quoted
    1094 Post(s)

    Default

    Heh, Why would I read the faq!

    Guess this idea is pointless.

  13. #13
    Join Date
    Jun 2012
    Posts
    4,867
    Mentioned
    74 Post(s)
    Quoted
    1663 Post(s)

    Default

    Quote Originally Posted by Frement View Post
    An easy fix would be to use this for example:
    Progress Report:
    http://static.frement.net/proxy.php?u=https://raw.githubusercontent.com/SRL/SRL-6/master/lib/utilities/drawing.simba
    Thanks, I'll update my scripts to do this

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
  •