We have detected that cookies are not enabled on your browser. Please enable cookies to ensure the proper experience.
Results 1 to 12 of 12
  1. #1

    Question List of IDs for all items from data.lotro.com

    Hi

    Is there a way to get a list of ID's for ALL items from data.lotro.com? More specifically a list of all armour and jewellery IDs?

    Im interested in making a site that presents lists of items sorted in different ways. To do that though Id need to periodically update a list of all available items so i can collect info and do some processing at my end.

  2. #2

    Re: List of IDs for all items from data.lotro.com

    Quote Originally Posted by stingray69 View Post
    Hi

    Is there a way to get a list of ID's for ALL items from data.lotro.com? More specifically a list of all armour and jewellery IDs?

    Im interested in making a site that presents lists of items sorted in different ways. To do that though Id need to periodically update a list of all available items so i can collect info and do some processing at my end.
    I've got some perl code that will do just that, and even if you don't want to use Perl, you can at least see the API calls that I used. Unfortunately it's sitting on my machine at work (not that I would write such things on company time! ) so if you haven't got a response by then I'll send it tomorrow.

  3. #3
    Join Date
    May 2008
    Location
    Australia
    Posts
    101

    Re: List of IDs for all items from data.lotro.com

    Quote Originally Posted by stingray69 View Post
    Hi

    Is there a way to get a list of ID's for ALL items from data.lotro.com? More specifically a list of all armour and jewellery IDs?

    Im interested in making a site that presents lists of items sorted in different ways. To do that though Id need to periodically update a list of all available items so i can collect info and do some processing at my end.
    There is no direct way to get the items and their corresponding ID's. I tried different methods for lotchi, but ended up using the lorebook search functionality. If you can deal with json results it appears to be the most comprehensive and easiest way. The results return the name of an item and the resource ID.
    Want to experiment with your character's equipment? try [URL="http://lotchi.grimblingandgrambling.com"]lotchi[/URL]

  4. #4

    Re: List of IDs for all items from data.lotro.com

    Very cunning, hadn't thought to look for json in the lorebook queries!

    I just had a quick poke around - this seems to do the trick, e.g. for jewellery;


    http://lorebook.lotro.com/index.php?...m_type%5B%5D=j


    returns this json;


    {
    "sEcho": 1,
    "iTotalRecords": 50,
    "iTotalDisplayRecords": 3713,
    "aaData": [ ["<a href=\"/wiki/Item:Amethyst_Ring_of_Tactics\ "><img src=\"http://content.turbine.com/sites/lorebook.lotro.com/images/icons/item/jewelry/eq_craft_j_t1_d_ring_2.png\" class=\"icon\" rel=\"/index.php?action=ajax&rs=efLot roResourceAjaxWrapper&rsargs[]=item&rsargs[]=1879180736\" /></a>", "<div class=\"asuncommon\" title=\"Uncommon\"></div>", "<a href=\"/wiki/Item:Amethyst_Ring_of_Tactics\ ">Amethyst Ring of Tactics</a>", "Jewellery", "13", "12"]
    ,["<a href=\"/wiki/Item:Amethyst_Ring_of_Tactics\ "><img src=\"http://content.turbine.com/sites/lorebook.lotro.com/images/icons/item/jewelry/eq_rcp_j_t1_d_ring_tactical_cr it.png\" class=\"icon\" rel=\"/index.php?action=ajax&rs=efLot roResourceAjaxWrapper&rsargs[]=item&rsargs[]=1879152609\" /></a>", "<div class=\"asuncommon\" title=\"Uncommon\"></div>", "<a href=\"/wiki/Item:Amethyst_Ring_of_Tactics\ ">Amethyst Ring of Tactics</a>", "Jewellery", "13", "12"]
    ,["<a href=\"/wiki/Item:Ancient_Arrowhead\"><img src=\"http://content.turbine.com/sites/lorebook.lotro.com/images/icons/item/jewelry/eq_angmar_pocketitem_08.png\" class=\"icon\" rel=\"/index.php?action=ajax&rs=efLot roResourceAjaxWrapper&rsargs[]=item&rsargs[]=1879057799\" /></a>", "<div class=\"asrare\" title=\"Rare\"></div>", "<a href=\"/wiki/Item:Ancient_Arrowhead\">Ancie nt Arrowhead</a>", "Jewellery", "48", "n/a"]
    ...etc...
    ]
    }


    so it looks like I can scrape the IDs from the 'rel' urls. Its just shame you cant get more than 50 results back per query which means 74 requests for jewellery alone!

    Is that how you've both been doing it or is there a cleaner way?

    Cheers for the help!
    Last edited by stingray69; May 14 2010 at 05:47 PM.

  5. #5

    Re: List of IDs for all items from data.lotro.com

    Quote Originally Posted by stingray69 View Post
    Very cunning, hadn't thought to look for json in the lorebook queries!

    I just had a quick poke around - this seems to do the trick, e.g. for jewellery;


    http://lorebook.lotro.com/index.php?...m_type%5B%5D=j


    returns this json;


    {
    "sEcho": 1,
    "iTotalRecords": 50,
    "iTotalDisplayRecords": 3713,
    "aaData": [ ["<a href=\"/wiki/Item:Amethyst_Ring_of_Tactics\ "><img src=\"http://content.turbine.com/sites/lorebook.lotro.com/images/icons/item/jewelry/eq_craft_j_t1_d_ring_2.png\" class=\"icon\" rel=\"/index.php?action=ajax&rs=efLot roResourceAjaxWrapper&rsargs[]=item&rsargs[]=1879180736\" /></a>", "<div class=\"asuncommon\" title=\"Uncommon\"></div>", "<a href=\"/wiki/Item:Amethyst_Ring_of_Tactics\ ">Amethyst Ring of Tactics</a>", "Jewellery", "13", "12"]
    ,["<a href=\"/wiki/Item:Amethyst_Ring_of_Tactics\ "><img src=\"http://content.turbine.com/sites/lorebook.lotro.com/images/icons/item/jewelry/eq_rcp_j_t1_d_ring_tactical_cr it.png\" class=\"icon\" rel=\"/index.php?action=ajax&rs=efLot roResourceAjaxWrapper&rsargs[]=item&rsargs[]=1879152609\" /></a>", "<div class=\"asuncommon\" title=\"Uncommon\"></div>", "<a href=\"/wiki/Item:Amethyst_Ring_of_Tactics\ ">Amethyst Ring of Tactics</a>", "Jewellery", "13", "12"]
    ,["<a href=\"/wiki/Item:Ancient_Arrowhead\"><img src=\"http://content.turbine.com/sites/lorebook.lotro.com/images/icons/item/jewelry/eq_angmar_pocketitem_08.png\" class=\"icon\" rel=\"/index.php?action=ajax&rs=efLot roResourceAjaxWrapper&rsargs[]=item&rsargs[]=1879057799\" /></a>", "<div class=\"asrare\" title=\"Rare\"></div>", "<a href=\"/wiki/Item:Ancient_Arrowhead\">Ancie nt Arrowhead</a>", "Jewellery", "48", "n/a"]
    ...etc...
    ]
    }


    so it looks like I can scrape the IDs from the 'rel' urls. Its just shame you cant get more than 50 results back per query which means 74 requests for jewellery alone!

    Is that how you've both been doing it or is there a cleaner way?

    Cheers for the help!
    Yeah I didn't realize there was a JSON return either, but just sticking your farming script in a loop, incrementing displayStart by 50 each time should do the trick.

    regex should be able to handle the rest easily. If you're doing this in PHP, just use preg_match_all, then loop through the returned array and dump it to db.
    [CENTER][IMG]http://i.imgur.com/wK9A7aa.png[/IMG]

    [SIZE=1][B][COLOR=white]75[/COLOR][/B] Fourohfour | [B][COLOR=white]75[/COLOR][/B] Artemedis | [COLOR=Blue][B]60[/B][/COLOR] Whiskeytango Foxtrot | [B][COLOR=#00ca00]50[/COLOR][/B] Mistah Boombastic | [B][COLOR=#00ca00]56[/COLOR][/B] Appetizer | [B][COLOR=#a7a7a7]25[/COLOR][/B] Aggromi | [B][COLOR=blue]61[/COLOR][/B] Onepointtwentyone Gigawatts [/SIZE] [/CENTER]

  6. #6

    Re: List of IDs for all items from data.lotro.com

    Sorry, I completely forgot to send you my code while I was at work today. Anyway, no need to reinvent the wheel, and no need to do any scraping, as the Lorebook is just a mediawiki and hence you can use the standard Mediawiki API to do this. There should be a MW API implementation already out there in your language of choice. Then just use http://lorebook.lotro.com/api.php as the API URL and read anything you want. I do also have some code that I wrote to parse the tooltip files from the Lorebook and create a CSV of all items w/ names, IDs, and stats, plus an extra text field with any proc effects. If this is useful I'll try my darnedest to remember next time at work, but I am a total scatterbrain.

  7. #7

    Re: List of IDs for all items from data.lotro.com

    The mediawiki APi sounds very promissing, ill take a look. If I can avoid scraping that'd be great as scraping code always tends to be fragile.

    And any code you'd be willing to share would help loads im sure.

  8. #8
    Join Date
    May 2008
    Location
    Australia
    Posts
    101

    Re: List of IDs for all items from data.lotro.com

    Quote Originally Posted by Dalthyn View Post
    Sorry, I completely forgot to send you my code while I was at work today. Anyway, no need to reinvent the wheel, and no need to do any scraping, as the Lorebook is just a mediawiki and hence you can use the standard Mediawiki API to do this. There should be a MW API implementation already out there in your language of choice. Then just use http://lorebook.lotro.com/api.php as the API URL and read anything you want. I do also have some code that I wrote to parse the tooltip files from the Lorebook and create a CSV of all items w/ names, IDs, and stats, plus an extra text field with any proc effects. If this is useful I'll try my darnedest to remember next time at work, but I am a total scatterbrain.
    Ahh very interesting. It would definitely be better to use something that is documented, rather than something that isn't and can change.
    Want to experiment with your character's equipment? try [URL="http://lotchi.grimblingandgrambling.com"]lotchi[/URL]

  9. #9

    Re: List of IDs for all items from data.lotro.com

    Hi - just wanted to say thanks again for the info - it really helped.

    I looked into the mediawiki api but wasn't able to get anything running on Google App Engine (my back end) so have gone the scraping route for now. Seems to work ok.

    Here's the site I have so far - still working on it but thought Id share an early version incase anyone had some interesting feedback/ideas;

    http://lotrogearwhore.appspot.com/

    (Note: Internet Explorer 7 or less is buggy atm)

    Cheers again

  10. #10
    Join Date
    Oct 2010
    Posts
    2

    Re: List of IDs for all items from data.lotro.com

    Thanks for sharing your website. Nice job!

  11. #11
    Join Date
    Dec 1969
    Posts
    1

    Re: List of IDs for all items from data.lotro.com

    Very nice job on the website! Thanks for posting it.

    I'm currently trying to do something similar to your site, but to combine everything into a total package to help make a complete build - armour, weapons, jewellery and traits. I'm having an issue connecting to lotro.com to get the item lists though. Any help you can give would be immensly appreciated.

    I'm working with the DotNetWikiBot Framework API at the moment, but I'm not restricted as I have a linux box as well. Do I still have to request an ID for the data.lotro.com site?

  12. #12

    Re: List of IDs for all items from data.lotro.com

    Hiya

    Yeh, you'll need a key to get access to the API. You could try sending a pm to Duwis (who's away atm but back in a week or so).

 

 

Posting Permissions

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

This form's session has expired. You need to reload the page.

Reload