Results 1 to 23 of 23

Thread: Using the SRL Stats Signature API

  1. #1
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,691
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default Using the SRL Stats Signature API

    The SRL Stats API exports data in JSON format. Languages like PHP, Python etc can easily parse this.

    Getting Script Details

    Code:
    http://stats.villavu.com/api/script/<SCRIPTIDHERE>
    Example: http://stats.villavu.com/api/script/1
    Output:

    Code:
    {
        "last_commit_by:": "whiplash", 
        "vars": [
            [
                491, 
                "Essence"
            ]
        ], 
        "script": "Essence Miner", 
        "commits": 35, 
        "time": 642, 
        "owner": "whitely", 
        "last_commit_on:": "Sun Dec 26 23:03:25 2010"
    }
    Getting User Details

    Code:
    http://stats.villavu.com/api/user/<USERIDHERE>
    Example: http://stats.villavu.com/api/user/1
    Output:

    Code:
    {
        "last_commit_to:": "Wizzup's Essence Miner", 
        "vars": [
            [
                "Rune Essence (Mined)", 
                28
            ]
        ], 
        "commits": 1, 
        "rank": 294, 
        "user": "Wizzup", 
        "time": 5, 
        "last_commit_on:": "Sat Jan  1 12:56:20 2011"
    }
    Getting the last commit

    http://stats.villavu.com/api/commit/last

    Output:
    Code:
    {
        "timestamp": "Sun Dec 26 23:02:52 2010", 
        "time_added": 24, 
        "user": "whereupon", 
        "script": "Woodcutter"
    }
    Getting the user stats to a specific script

    Code:
    http://stats.villavu.com/api/user/<USERID/script/<SCRIPTID>
    Example: http://stats.villavu.com/api/user/235/script/21
    Output:

    Code:
    {
        "vars": [
            [
                46, 
                "Abyss (Solved)"
            ], 
            [
                3218, 
                "Adamant Ore (Mined)"
            ], 
            [
                9346, 
                "Anchovies Caught"
            ], 
            [
                911, 
                "Anchovies Cooked"
            ], 
            [
                31, 
                "Arnav (Solved)"
            ], 
            [
                43, 
                "Beekeeper (Solved)"
            ], 
            [
                1, 
                "Beekeeper (Unsolved)"
            ], 
            [
                168, 
                "Bowls Filled"
            ], 
            [
                38, 
                "Certer (Solved)"
            ], 
            [
                33591, 
                "Clay (Mined)"
            ], 
            [
                54407, 
                "Clay (Softened)"
            ], 
            [
                75766, 
                "Coal Ore (Mined)"
            ], 
            [
                14409, 
                "Copper Ore (Mined)"
            ], 
            [
                36, 
                "Demon (Solved)"
            ], 
            [
                3, 
                "Demon (Unsolved)"
            ], 
            [
                27, 
                "Evil Bob (Solved)"
            ], 
            [
                9, 
                "Evil Bob (Unsolved)"
            ], 
            [
                37, 
                "Forester (Solved)"
            ], 
            [
                28, 
                "Frog (Solved)"
            ], 
            [
                6, 
                "Frog (Unsolved)"
            ], 
            [
                5630, 
                "Gold Ore (Mined)"
            ], 
            [
                236, 
                "Herring Caught"
            ], 
            [
                386937, 
                "High Level Alchs"
            ], 
            [
                190551, 
                "Iron Ore (Mined)"
            ], 
            [
                25, 
                "Leo (Solved)"
            ], 
            [
                21, 
                "Leo (Unsolved)"
            ], 
            [
                41258, 
                "Loads Done"
            ], 
            [
                29329, 
                "Lobster Caught"
            ], 
            [
                25466, 
                "Lobster Cooked"
            ], 
            [
                922, 
                "Magic Logs Chopped"
            ], 
            [
                3682, 
                "Maple Logs Chopped"
            ], 
            [
                29, 
                "Maze (Solved)"
            ], 
            [
                15, 
                "Maze (Unsolved)"
            ], 
            [
                32, 
                "Mime (Solved)"
            ], 
            [
                2, 
                "Mime (Unsolved)"
            ], 
            [
                20869, 
                "Mithril Ore (Mined)"
            ], 
            [
                35, 
                "Molly (Solved)"
            ], 
            [
                6, 
                "Molly (Unsolved)"
            ], 
            [
                40, 
                "Mordaut (Solved)"
            ], 
            [
                14, 
                "Mordaut (Unsolved)"
            ], 
            [
                57558, 
                "Normal Logs Chopped"
            ], 
            [
                27533, 
                "Oak Logs Chopped"
            ], 
            [
                34, 
                "P. Pete (Unsolved)"
            ], 
            [
                104, 
                "Pike Caught"
            ], 
            [
                40, 
                "Pillory (Solved)"
            ], 
            [
                5, 
                "Pillory (Unsolved)"
            ], 
            [
                42, 
                "Pinball (Solved)"
            ], 
            [
                4, 
                "Pinball (Unsolved)"
            ], 
            [
                32, 
                "Quiz (Solved)"
            ], 
            [
                7006, 
                "Salmon Caught"
            ], 
            [
                38, 
                "Sandwich (Solved)"
            ], 
            [
                2, 
                "Sandwich (Unsolved)"
            ], 
            [
                302, 
                "Sardines Caught"
            ], 
            [
                18392, 
                "Shrimp Caught"
            ], 
            [
                2933, 
                "Shrimp Cooked"
            ], 
            [
                449, 
                "Silver Ore (Mined)"
            ], 
            [
                10786, 
                "Swordfish Caught"
            ], 
            [
                3047, 
                "Swordfish Cooked"
            ], 
            [
                29732, 
                "Times Banked"
            ], 
            [
                59355, 
                "Times Walked"
            ], 
            [
                8387, 
                "Tin Ore (Mined)"
            ], 
            [
                78582375, 
                "Total EXP Gained"
            ], 
            [
                2566, 
                "Total Levels Gained"
            ], 
            [
                6635, 
                "Total Logins"
            ], 
            [
                10478, 
                "Trout Caught"
            ], 
            [
                1450, 
                "Trout Cooked"
            ], 
            [
                12368, 
                "Tuna Caught"
            ], 
            [
                86495, 
                "Tuna Cooked"
            ], 
            [
                202214, 
                "Willow Logs Chopped"
            ], 
            [
                27723, 
                "Yew Logs Chopped"
            ]
        ], 
        "script": "MSI Phoenix Scripts", 
        "commits": 28634, 
        "user": "Anonymous", 
        "time": 264902, 
        "last_commit_on:": "Fri Aug 19 14:00:22 2011"
    }
    Last edited by Wizzup?; 08-19-2011 at 12:04 PM.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  2. #2
    Join Date
    Dec 2010
    Posts
    431
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    I think you meant stats.villavu.com/api/

  3. #3
    Join Date
    Dec 2008
    Posts
    209
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Train View Post
    I think you meant stats.villavu.com/api/
    No, I'm positive it's old.villavu, that's the URL he's been using when discussing it on IRC.

    craig.

  4. #4
    Join Date
    Sep 2008
    Location
    Not here.
    Posts
    5,422
    Mentioned
    13 Post(s)
    Quoted
    242 Post(s)

    Default

    Quote Originally Posted by Craig` View Post
    No, I'm positive it's old.villavu, that's the URL he's been using when discussing it on IRC.

    craig.
    That's his test database.

  5. #5
    Join Date
    Jan 2008
    Location
    10° north of Hell
    Posts
    2,035
    Mentioned
    65 Post(s)
    Quoted
    164 Post(s)

    Default

    Quote Originally Posted by Wizzup? View Post
    Getting User Details

    Code:
    http://old.villavu.com/stats/api/script/<USERIDHERE>
    Example: http://old.villavu.com/stats/api/user/1
    Output:
    Inside of the [code][/code] tags you need to change script to user

    Quote Originally Posted by Train View Post
    I think you meant stats.villavu.com/api/
    I think he did also.

    Dg's Small Procedures | IRC Quotes
    Thank Wishlah for my nice new avatar!
    Quote Originally Posted by IRC
    [22:12:05] <Dgby714> Im agnostic
    [22:12:36] <Blumblebee> :O ...you can read minds

  6. #6
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,691
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Nah, I used old.villavu.com as examples. (So you can verify it works)
    Once the SRL Stats are populated I'll update the post.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  7. #7
    Join Date
    May 2007
    Location
    Tasmania, Aus
    Posts
    898
    Mentioned
    0 Post(s)
    Quoted
    1 Post(s)

    Default

    about time to update the post Wizzup?

  8. #8
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,691
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Done. Thanks.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

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

    Default

    Wizzup?, would it be possible to add variables to the API based on the user ID and/or script ID?

    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..."


  10. #10
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,691
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Do you mean add variables to a specific script owned by a specific user? Like, adding a variable to a script. Not creating entirely new variables?



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

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

    Default

    Hm, keeping the variables that are already defined to the User/Script. At the moment, for grabbing User details, we can get their 'commits, last_commit_to,user,last_commit_on', but what about that User's variables? Essence mined, Strength exp gained, fish cooked, ect... Specific to that user. And maybe, if possible (I think this would be a bit more difficult), getting a User's variables obtained from a specific script only.

    Example:

    Variables for UserID (208):
    "Runecraftin Exp (Gained)": 9999999

    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..."


  12. #12
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,691
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by Flight View Post
    Hm, keeping the variables that are already defined to the User/Script. At the moment, for grabbing User details, we can get their 'commits, last_commit_to,user,last_commit_on', but what about that User's variables? Essence mined, Strength exp gained, fish cooked, ect... Specific to that user. And maybe, if possible (I think this would be a bit more difficult), getting a User's variables obtained from a specific script only.

    Example:

    Variables for UserID (208):
    "Runecraftin Exp (Gained)": 9999999
    I probably misread. Yes, that is possible. I'll look into it and update this thread accordingly.
    Last edited by Wizzup?; 08-19-2011 at 09:47 AM.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

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

    Default

    Quote Originally Posted by Wizzup? View Post
    I probably misread. Yes, that is possible. I'll look into it and update this post accordingly.
    Thank you very much, that would be wonderful.

    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..."


  14. #14
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,691
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Sorry for slight stats downtime ( 30s for a few times, I was testing on the production environment. )

    Updated first post; I think everything is now added, including stats for user to a specific script.

    Now get them signature services up!



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

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

    Default

    Now I need a tutorial on how to make custom signatures for everyone.

    Something like... "http://site.com/S50U208.php" Which would grab the User's (208) variable specific to that script (50). S=Script, U=User

    Very nice work, Wizzup?!

    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..."


  16. #16
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,691
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default




    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

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

    Default

    Yep that's what I've been going on, but I was meaning like anyone could simply put in their User ID and Script ID into the PHP address and put that directly into their signature.

    1 person might want a sig for their ID and Script so they'd use, for example, "http://site.com/S39U105.php" which would automatically grab the info for Script ID 39 and User ID 105. Another person would want something different so the [img] code they use in their signature would be "http://site.com/S108U78.php" for the Script ID 108 and User ID 78.

    I'm sorry if I'm unclear, I guess it's not easy to explain it. I think I might drop Frement a line, I think he could give me a couple points.

    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..."


  18. #18
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,691
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Use GET variables plus some rewrite rules.

    Like, rewrite sigs/user5.png to sig.php?user=5



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

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

    Default

    Quote Originally Posted by Wizzup? View Post
    Use GET variables plus some rewrite rules.

    Like, rewrite sigs/user5.png to sig.php?user=5
    I was just reading over that on W3s, I'll see what I can put together, thanks.

    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..."


  20. #20
    Join Date
    Jun 2017
    Posts
    15
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    Quote Originally Posted by Wizzup? View Post
    Use GET variables plus some rewrite rules.

    Like, rewrite sigs/user5.png to sig.php?user=5

    Thanks!

  21. #21
    Join Date
    Oct 2017
    Posts
    1
    Mentioned
    0 Post(s)
    Quoted
    0 Post(s)

    Default

    thanks

  22. #22
    Join Date
    Dec 2007
    Posts
    2,112
    Mentioned
    71 Post(s)
    Quoted
    580 Post(s)

    Default

    thanks

  23. #23
    Join Date
    Dec 2006
    Location
    Program TEXAS home of AUTOERS
    Posts
    7,934
    Mentioned
    26 Post(s)
    Quoted
    237 Post(s)

    Default

    thanks

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
  •