User:Matthew.zellmer: Difference between revisions
Jump to navigation
Jump to search
Line 277: | Line 277: | ||
* three-step process, query to get current data and get edit token, modify data locally, POST data ([https://www.mediawiki.org/wiki/API:Edit API:Edit]) back to server | * three-step process, query to get current data and get edit token, modify data locally, POST data ([https://www.mediawiki.org/wiki/API:Edit API:Edit]) back to server | ||
** perform query and get token happen at the same time (use <code>intoken=edit</code> in the query) | ** perform query and get token happen at the same time (use <code>intoken=edit</code> in the query) | ||
** API tokens can only be asked for using specific queries <code>prop=info&titles=FindThisExactTitle</code> is one of them | |||
*** example: <code>http://en.wikipedia.org/w/api.php?action=query&titles=Foo&prop=info&intoken=edit</code> for obtaining edit token | *** example: <code>http://en.wikipedia.org/w/api.php?action=query&titles=Foo&prop=info&intoken=edit</code> for obtaining edit token | ||
*** the edit token looks like this "a6376ba5c8284f218c935aec5a038032+\\" | *** the edit token looks like this "a6376ba5c8284f218c935aec5a038032+\\" |
Revision as of 15:24, 30 January 2014
My pages
LOTRO Characters
Character | Class | Level | Horse | Main Stat | Armor | Weapons | Jewellery | Resources needed | Cash needed | Crafting | Guild | Adventuring |
---|---|---|---|---|---|---|---|---|---|---|---|---|
Leadweight | Guardian | 50 | Horse | Might, Vitality | 1st Heavy + Heavy Shield 40 + all |
1H, 2H, +(lvl:30) Bow 40+ |
40+ | rich iron ore, prestine leather, glazed med leather | max | Master Metalsmith Artisan Tailor Artisan Prospector |
Brick and Mordor | Misty Mountains |
LeadMable | Champion | 8 | Might | 2nd Heavy (no shield) med 15-19 all |
1H,2H+bow (Lvl:20), +dual wield 30+ purple or blue only |
light, med leather copper ore, barrow iron ore |
5gp | 2nd Expert Forester App. Tailor 2nd Journayman Prospector |
||||
WhiteArizona (T) | Captain | 7 | Might | 3rd Heavy+Shield med 10-19 all, 30+ all, shield 30,40 |
1H, 2H, (no bow) + Halbert USE 2H |
2gp | 3rd App. Forester App. Tailor 3rd App. Prospector |
|||||
WhiteColorado (T) | Champion | 7 | Might | 4th Heavy (no shield) all |
1H,2H+bow (Lvl:20), +dual wield all |
Mule | 1gp | |||||
Suitup | Burglar | 20 | Horse | Agility | 1st Med 25-30+ all, 40+ all |
1H (Not Hammers) 40+ |
20+ all, 30+ all | look for Yew planks all ores |
500sp | 1st Master Forester Expert Tailor 1st Artisan Prospector |
Brotherhood of Shadow | |
Waitforit (T) | Hunter | 20 | Horse | Agility | 2nd Med unknown, 30+ all |
1H+Bow 21+ |
30+ | needs Barrow Iron, Rich Iron, Dwarf iron Yew planks adamant, sahppire, ruby, shards solid ash,hew planks |
max | Expert Weaponsmith Expert Woodworkers Expert Prospector |
||
Tangelia (T) | Hunter | 20 | Horse | Agility | 3rd Med 26+, 40+ all |
1H+Bow 30+ |
26+, 30+, 40+ | Rich Iron, dwarf Irom have chest needs keys needs sapphire shards needs adamant shards |
max | Master Jeweller Artisan Prospector Expert Cook |
||
LeadBirtha | Warden | 7 | Agility, Vitality | 4th Med+ Warden Shield 20+ all, 30+ all |
1H+Javlin all |
? | 4.5g | |||||
Piepjay (T) | Hunter | 10 | Horse | Agility | 5th Med all |
1H+Bow all |
all | Mule | 1gp | |||
WhiteAlaska | Lore-master | 21 | Horse | Will | 1st Light 28-30 all, 30+ all |
Staff Only 30+ |
30+ neck and ear | shards various components |
max | App. Weapons Artisan Scholar App. Farmer |
Brotherhood of Shadow | |
Hearthrob | Mistrial | 20 | Horse | Will | 2nd Light+shield 23-30 gloves, shoulders, 30+ all |
1H (not hammers) 30+ |
10+, 20+, 30( 1 wrist, 1 ear) | 4.5g | Artisan Cook Artisan Farmer Expert Tailor |
Brotherhood of Shadow
| ||
WhiteVirginia | Rune-Keeper | 7 | Will | 3rd Light 20+ all (not head or feet) |
Runes/1H Ax Only 30+ |
20+ all | 4.5g | change to scholar |
Where to Collect Materials
Currently Working List
Odd pages that need to be fixed
Bring Moria zones out of the shadows
- fix on Region page
Main page links are missing Items
- Settlements page is missing anything past Moria
- Area page is missing anything past Moria, needs to have the Cateegories added to it no manual links
- Categories are missing all the towns and settlements as well
- Category Rare Signature is missing tons of baddies
- What is this? Item:Apprentice Scroll Case this should be removed I think
Fixing Wiki-code Lootbox, Lootitems Templates and and updating creatures and Item Drops
- changing lootitems to lootbox
- details for both here Category:General_Wiki_Templates
- and here Template_talk:Lootbox
- removing Has-Location::
- removing item parameter |imgtype
- User talk:Magill has a number of posts about the Lootbox and Lootitems
- removing or fixing "Has Drop", User:RingTailCat was the one working this User:RingTailCat/Sandbox-16
- removing items Loot-from broken box and replace with correct Boilerplate:Item format
- check out User:RingTailCat/Editing and review his sandboxes to find bots
- Can use this page for lootitems to lootbox template changes, quick reference Special:WhatLinksHere (and enter Template:Lootitems) to get a list of what links to the Lootitems template
Wiki API for using HTTP to edit the wiki
- turns out that Robots, bots can only be used with the API so learn about it
- API basics
- API:FAQ
- API homepage for Wikipedia.com
- API homepage for LOTRO, sends requests here to run bots and scripts
- API:Tutorial
API action=query
- Everything you want to do must go thru the API Entry point: API entrypoint for LOTRO, there is where you send requests or bots too
- You might need to log into the API before it allows you to do anything Login examples and Help
- The lotro-wiki is pretty open the User page shows permissions to the write API
- Use a HTTP query string to do things. Not passing any will give you the help page with the autogenerated documentation.
- API query: API query reference
- API Tutorials: Tutorial link
- These tutorials use PHP and the Zend client: PHP Zend Client Tutorial and Use
- Example query SYNTAX:
http://en.wikipedia.org/w/api.php?action=query&titles=San_Francisco&prop=images&imlimit=20&format=jsonfm
- Example query
http://lotro-wiki.com/api.php?action=query&titles=Ered%20Luin&prop=info&format=jsonfm
- Example query
http://lotro-wiki.com/api.php?action=query&titles=User:Matthew.zellmer/testpage&prop=info&format=jsonfm
- Example query
http://lotro-wiki.com/api.php?action=query&titles=The%20Misty%20Mountains&prop=revisions&format=jsonfm
action=query
is used for most read actions, separate action= modules exist for write actions- next will be one of these:
prop=, list=, meta=, title=
titles=
takes one or more titles for the query to operate on (specify pages)- multiple titles with
titles=Foo|Bar|Baz
(This will make multiple calls count as one for the purpose of rate limiting) - This works for pages but not revisions. Read the documentation via the Sandbox or via
api.php
autodocs.
- multiple titles with
list=search (sr)
Perform a full text search API:Search- All about prop=
prop=images
lists the images on a page;- multiple modules with
&prop=images|templates&list=allpages|blocks
- multiple modules with
prop=info
for basic page infoprop=revisions
for page historyprop=revisions&rvprop=content
for page wikitext- generators (kind of like UNIX pipes) with
&titles=Foo&generator=links&prop=revisions
- next will be one of these:
action=parse
for page HTMLlimit=
sets the max # of results. Default is 10, 'max' worksformat=
: xml, json, xmlfm (default), jsonfm (good for debugging). examples of formats formats
- You can specify pages in the following ways:
- By name using the
titles
parameter, e.g.titles=Foo|Bar|Main_Page
- By page ID using the
pageids
parameter, e.g.pageids=123|456|75915
- By revision ID using the
revids
parameter, e.g.revids=478198|54872|54894545
- Most query modules will convert revision ID to the corresponding page ID. Only prop=revisions actually uses the revision ID itself.
- If you want to find sections from the table of contents, use
section=
using theindex
property, and you can call 0 for the wikitext that comes before the first section header.
- By name using the
- get only the content of a page (wikitext)
- If you just want the raw wikitext without any other information whatsoever, it's best to use index.php's action=raw mode instead of the API: http://en.wikipedia.org/w/index.php?**action=raw&title=Main_Page . Note that this'll just output plain wikitext without any formatting.
- To get more information about the page and its latest version, use the API: http://en.wikipedia.org/w/api.php?action=query&prop=revisions&titles=Main_Page .
- You can retrieve 50 pages per API request: http://en.wikipedia.org/w/api.php?action=query&prop=revisions&rvprop=content&titles=Main_Page Articles This also works with generators.
- get the HTML only content of a page
- If you just want the HTML, it's best to use index.php's action=render mode instead of the API: http://en.wikipedia.org/w/index.php?action=render&title=Main_Page .
To get more information distilled from the wikitext at parse time (links, categories, sections, etc.), use the API parse module: http://en.wikipedia.org/w/api.php?action=parse&page=Main_Page . See also the documentation for the API:Parsing wikitext#parse action=parse module.
API action=edit
- Changing wiki content using the
action=edit
to edit a page - three-step process, query to get current data and get edit token, modify data locally, POST data (API:Edit) back to server
- perform query and get token happen at the same time (use
intoken=edit
in the query) - API tokens can only be asked for using specific queries
prop=info&titles=FindThisExactTitle
is one of them- example:
http://en.wikipedia.org/w/api.php?action=query&titles=Foo&prop=info&intoken=edit
for obtaining edit token - the edit token looks like this "a6376ba5c8284f218c935aec5a038032+\\"
- but this token has a +\\ at the end! that’s translated into %2B%5C
- you should return the token like this "a6376ba5c8284f218c935aec5a038032%2B%5C"
- example:
- manipulate the data locally on your computer
- POST back to wiki, POST requests only: Diff between GET and POST
- POST and PHP
- Only way to send POST data is to use a web form
- So you have to have a local webpage that will accept the action=query data into a form then use the form to POST it back to the wiki
- This is what the python scripts do but they do most of the heavy lifting for you
- read the API documentation about action=edit here
- perform query and get token happen at the same time (use
Bots and Robots access the API to perform actions
- before u get to far into bots remember they just use the API over and over again, why cant I just do that manually?
- figure out the API first, ok DONE
- Basic info about Bots
- Category:Bots
- Manual on Bots
- Lotro-Wiki.com:Bots
- Start at the MediaWiki Manual:Bots.
- Most of these scripts are python scripts run using Pywikipediabot
- The Pywikipediabot bots make it so you can manipulate the data the API gives you and easily send it back
- User:Magill/Projects-Index list of Projects and RoBots
- User:Magill-bot/scripts/user-fixes.py
- User:Magill-bot/scripts/replace lotro.py
- User:Magill-bot
- User talk:Magill-bot
- User:RingTailBot
- User:RingTailCat/Sandbox-6 bot examples
- I could use Windows to run the python scripts Basic how-to ut I don't want too
- I want a PHP solution since I am running Windows try a list from here when ready API clients
- My solution: Use HTML forms, PHP, javascript and AJAX
- 1. HTML form to build a GET query, use AJAX to send it to the API and get a XML response
- 2. format the returned response, so that I can select what to keep or throw out
- 3. perform a very specific GET query on each selected item and get an edit token at the same time
- 4. search the returned response and add/edit what I want locally using JavaScript or PHP
- 5. send a POST edit action back to the server with the changes using the edit token received earlier
AJAX fail
- AJAX wont do cross-server http requests, unless you setup apache the right way or IE the right way
- discovered solution, I went with a simple solution since I use IE (in Internet options)
- make lotro-wiki.com a trusted site
- change one of the trusted sites security level zone parameters->Missallenaous to "access data sources across domains"
- Other solutions to the AJAX cross-server issue
- http://httpd.apache.org/docs/2.4/mod/mod_headers.html
- http://www.barneyparker.com/configure-apache-to-accept-cross-site-xmlhttprequests-on-debian/
- http://www.w3schools.com/php/php_ajax_php.asp
- http://www.w3schools.com/tags/ref_httpmessages.asp
- https://en.wikipedia.org/wiki/List_of_HTTP_headers#Requests
- https://en.wikipedia.org/wiki/Cross-origin_resource_sharing
- http://icodeguru.com/WebClient/Ajax-Hacks/0596101694/ID-15118.HeadA.Hack_74.html
- http://hacks.mozilla.org/2009/07/cross-site-xmlhttprequest-with-cors
- http://www.yourhtmlsource.com/javascript/ajax.html
- http://www.w3schools.com/ajax/ajax_examples.asp
- http://msdn.microsoft.com/en-us/library/ie/cc288060(v=vs.85).aspx
- discovered solution, I went with a simple solution since I use IE (in Internet options)
- even with AJAX and Apache setup properly, JavaScript variables refuse to properly translate multi-parameter URL text strings for submission in an API get query.
- problem is with the & amp; JavaScript variables always (not matter the encoding or decoding) change them to an amp;
- several decoding global functions dont fix this: eval(), encodeURIComponent(), encodeURI(), decodeURI(), decodeURIcomponent()escape(), so furtrating
- best solution using AJAX would be to code specific queries in form textboxes with each API query element in its own textbox
- this does not allow dynamic queries LAME
Bot Script Solution Progress
- AJAX has limited use given the cross-domain restrictions, I cant get around them
- building PHP script to perform API query only
- initial coding done, have a working, single use API query script
- design:
- PHP webpage with textbox and form, must know API query language yourself, limited help
- form submits to PHP backend, which performs API query, makes a local copy of the returned XML results
- new page displays the results but you can checkmark the ones you want for further API query
- working here
test wiki site
- test scripts here
- testwiki.skunark.net
- lotroadmin will have to give you bot rights on that.
- I also don't know the status of the test-wiki currently, as it was "munged" as part of the Server switch/upgrade last month.(Dec2013)
adding Regions Named Creatures map and list and adding the maps to the Creature Category Pages
cleaning up the region pages, for people who want easy shard hunting
- North Downs - done
- Evendim - done
- Lone-lands - done
- Trollshaws - done
- The Shire - done
- Bree-land - done
- Forochel - done
- Ered Luin - done
adding maps with POI and a list of them with locs
- Trollshaws
updating the crafting pages and for Game Update 12
- Prospector - done
- changed recipes, ore, ingots etc.
- Metalsmith - started
- Appretience already done
- need to verify product stats
- Journayman - done
- need to verify product stats
- Expert - done
- need to verify product stats
- Artisan - done
- need to verify product stats
- Master - done
- need to verify product stats
- There is a problem with the icons not sure they are right
- DONT change table header Components to anything! The work components is embedded in everything
- update this page Lotro-Wiki.com:Crafting
- add new obsolete item recipes nad their multi-input - done
- use the Other Ingredients Template to make it easier example below
- this can be tricky need to verify all links still work to the new page
- Categorize put into category these new item - done
- add new obsolete item recipes nad their multi-input - done
- there are additional pages
- Heavy Armour (Level 1-21) Index that might need to be adjusted - done
- Shields Index - done
- Appretience already done
updating the crafting recipes and items Game Update 12
- for articles that still need help mark them using one of these stubs Article_Management_Tags/Display
- need to fix deposits pages -
- item and ore pages
- item ingot
- item recipe pages
- lots to do
- Prospector_Recipe_Index page Apprentice section
- Ore update the ore page
- update each individual ore, deposit, ingot and other pages
- change to Tin - done
- removed or added comments to fix Tin: Tin Deposit, Ore, item:Chunk of Tin Ore, item:Tin Ingot, Prospector_Recipe_Index whereelse?
- updated Item:Tin Ingot , Item:Chunk of Tin Ore
- added Item:Piece of Copper-infused Ore and icon
- added other correct new items and changed old
- chang to Khazad - done
- remove and adding fixes for Khazad now:
- fixed the Ore page
- fixed all the individual Deposit pages
- working on Prospector_Recipe_Index page Supreme section
- do the teir 6 receipts that call for Kazad Tin ingots now need just Tin ingots? no Do vendors sell Khazad Tin Ingots? yes
- need to find a way to redirect Kazad to Khazâd for the search tool. Will hold off for now
- added Item:Piece of Khazâd Metal but it needs an icon - added by someone great!
- added new Item:Khazâd Skarn Deposit but then moved it to just Khazâd Skarn Deposit. not sure how to delete the item page I created - now know how to delete
NOT DONE
- A Log of Mallorn Wood is now a Gnarled Ilex Branch that can be used to make Thin Ilex Planks.
- A Treated Mallorn Plank is now a Treated Ilex Wood that can be used to make Solid Ilex Planks.
- An Extraordinary Hide is now an Aged Extraordinary Hide and can be used to make Brushed Extraordinary Leather.
Expertise Tolkens and how they work
- Every crafting job and Tier has a Crafting Expertise recipe that uses crafting expertise tokens
- Skirmish-Crafting
- does this still work? - yes
- why were only the apprentice recipes added? Verify in-game if I can buy these recipes and then use one of them - this works ingame
- problem is I don't remember the exact name need to write down and then add missing content here