Difference between revisions of "Template:PetRanking"

From NeoDex
Jump to navigation Jump to search
(Instructions on how to update the ranking list easily.)
m
Line 59: Line 59:
If you want to update this list yourself quickly, follow these instructions, otherwise it'll be slow to update each one manually, especially if they change places.
If you want to update this list yourself quickly, follow these instructions, otherwise it'll be slow to update each one manually, especially if they change places.


'''1.''' Go to [http://www.neopets.com/topneopets.phtml?type=percentage_table|http://www.neopets.com/topneopets.phtml?type=percentage_table] and view the source of the page
'''1.''' Go to the [http://www.neopets.com/topneopets.phtml?type=percentage_table Pet Ranking Page] and view the source of the page


'''2.''' Copy from  
'''2.''' Copy from  

Revision as of 19:19, 11 September 2013

This template should be used on a pet species page.

Instructions to update the list

If you want to update this list yourself quickly, follow these instructions, otherwise it'll be slow to update each one manually, especially if they change places.

1. Go to the Pet Ranking Page and view the source of the page

2. Copy from

</tr><tr style="background-color: #EDEDED;">
<td align=center><b>1</b></td>
<td align=center width=90 height=90 border=0><img src='http://images.neopets.com/pets/80by80/shoyru_green_happy.gif' width=80 height=80 border=0></td>
<td align=center><b>Shoyru</b></td>
<td align=center><b>17,268,615</b></td>
<td align=center><b>6.17%</b></td>

all the way down to

</tr><tr style="background-color: #FFFFFF;">
<td align=center><b>54</b></td>
<td align=center width=90 height=90 border=0><img src='http://images.neopets.com/pets/80by80/krawk_blue_happy.gif' width=80 height=80 border=0></td>
<td align=center><b>Krawk</b></td>
<td align=center><b>2,499</b></td>
<td align=center><b>0.00%</b></td>

and paste into Notepad++. Note the exact figures will change, you're basically looking for those bold numbers and the HTML surrounding them. It'll be 324 lines of code to be exact.

3. Use the find and replace feature with Regular Expression selected. (Remove the quote marks)

Find: "</tr>.*?<b>(.*?)</b>.*?<b>(.*?)</b>.*?<b>(.*?)</b>.*?<b>(.*?)</b></td>"

Replace with: "| $2 = $3 \($1<sup>th</sup> - $4\)"

4. Change 1st, 2nd and 3rd places from "1th, 2th, 3th"

5. Replace in current template

Done!