formatting formatting

Go Back   MyMMOGames.net - Multiplayer Gaming and Media Community > MyMMOGames > Wiki Discussion > Trickster Online Wiki

Reply
 
LinkBack (1) Thread Tools Display Modes
Old 09-04-2008   #121 (permalink)
Administrator
 
Medoria's Avatar
 
Join Date: Jun 2008
Posts: 376
Wiki Edits: 919
Blog Entries: 4
iTrader: (0)
Medoria will become famous soon enoughMedoria will become famous soon enough

Administrator
Wiki Sysop

IGN: Medoria
Class: Sorceress to_sheep
Level: 2X
Guild: Kitty Empire

MyMMOGames.net Supporter
Default

Quote:
Originally Posted by OrangeJuice View Post
Thanks Adipiciu for the reply.
>.<; I ran into some other problems.
http://i224.photobucket.com/albums/d...OCTEA/wiki.jpg
^ So here I was trying to edit the Category page so that it said Category: TO Use. Is where I put the TO in the picture the correct place for the namespace?

2nd question: I was looking through the Masterlist of Nameless namespaces. I can't seem to find which are the ones needed to be changed. The ones with -TO by them are already labled Tricksdter Online and then the ones that are just bolded all seem to lead to a deleted page. It was deleted by Chesters, so I assume it's supposed to be, or am I suppose to recreate it? o-o..
First off, yes, that TO link looks correct
Secondly, that list is horribly outdated so i wouldn't go by it. ^^"
__________________
Faith, Trust, and Pixie Dust!
Medoria is offline   Reply With Quote

<a href="http://www.game-advertising-online.com/" target=_blank>Game Advertising Online</a><br> banner requires iframes
Want to get rid of this advertisement? Register for our community!

Old 09-04-2008   #122 (permalink)
VIP
 
Join Date: Jun 2008
Posts: 62
Wiki Edits: 14,836
iTrader: (0)
adipiciu is on a distinguished road

Admin Award


Default

Quote:
Originally Posted by Medoria View Post
sounds awesome adipiciu. I look forward to seeing the code.
The bot is done! How to name the bot? I want to make a special page on the wiki to report malfunctions or new ideas and also a thread on the forum.

Info about the code.
The code is made in php. The code behind does all the work (connecting, reading, editing, saving, etc) and all you need to to is adding new function like this, where $content contains tha code from the page. You will work only with the content of the page and search for particular strings to delete, rename or add new content. Example (the only function available for now):


function renameCategory($content){
$content = trim($content);

//This can be done probably using just one regular expression, but didn't had time to do it ^^
$pattern = '|(\[\[:Category(?!TO)|';
$replacement = "[[:Category:TO ${2}";
$content = preg_replace ($pattern, $replacement, $content);

$pattern1 = '|(\[\[Category(?!TO)|';
$replacement1 = "[[Category:TO ${2}";
$content = preg_replace ($pattern1, $replacement1, $content);

return $content;
}


I started the bot and i'm monitoring for the next 1h. It checks 3 pages per minute so it doesn't load the server.

Last edited by adipiciu; 09-04-2008 at 08:34 PM.
adipiciu is offline   Reply With Quote
Old 09-05-2008   #123 (permalink)
VIP
 
Join Date: Jun 2008
Posts: 62
Wiki Edits: 14,836
iTrader: (0)
adipiciu is on a distinguished road

Admin Award


Default

I have named the bot MOG Bot and it can do the following things:
1. Renaming categories (e.g. Category:Use to Category:TO Use)
2. Renaming templates (e.g. {{Use to {{TO Use)
3. Fixing links (adding the NAMESPACE to the links) (the hardest part)

The bot is now running for tests and will do aprox 800 edits. The total amount of pages that need to be fixed is ~10,000.

I still wait for new functions and how to implement them like correcting the template names (from {{TO Cards to {{TO Card or from Category:TO Equip to Category:TO Equipment)

I didn't implement the renaming for images from Image: to Image:TO because i don't know the status of uploaded images.

I'm waiting for responses.

PHP Code:
function maintenance($content){
    
$content trim($content);

    
$pattern '|(\[\[:Category:)(?!TO)|';
    
$replacement "[[:Category:TO ${2}";
    
$content preg_replace ($pattern$replacement$content);

    
$pattern1 '|(\[\[Category:)(?!TO)|';
    
$replacement1 "[[Category:TO ${2}";
    
$content preg_replace ($pattern1$replacement1$content);

    
$pattern2 '|(\{\{)(?!TO\s)(\w+)(?=\s)|';
    
$replacement2 '{{TO ${2}';
    
$content preg_replace ($pattern2$replacement2$content);

    
$pattern3 '/(\[\[)(?!:|Image|Trickster|Category|\{\{)([^|\]]*)(\]\])/';
    
$replacement3 '[[{{NAMESPACE}}:${2}|${2}]]';
    
$content preg_replace ($pattern3$replacement3$content);

    
$pattern4 '/(\[\[)(?!:|Image|Trickster|Category|\{\{)([^|]+)([|])([^|]+)(?=\]\])/';
    
$replacement4 '${1}{{NAMESPACE}}:${2}${3}${4}';
    
$content preg_replace ($pattern4$replacement4$content);

    return 
$content;

adipiciu is offline   Reply With Quote
Old 09-07-2008   #124 (permalink)
VIP
 
Dread's Avatar
 
Join Date: Jun 2008
Posts: 155
Wiki Edits: 1,053
iTrader: (0)
Dread is on a distinguished road
Class: GeassGundam to_champion
Default

So should I wait until bots clean up before editing or will it edit the stuff again if i change an edited page?Also it changed some {{Trickster Online:???}} into templates should i changed them into templates instead or keep it like before i don't know.
Dread is offline   Reply With Quote
Old 09-07-2008   #125 (permalink)
VIP
 
Join Date: Jun 2008
Posts: 62
Wiki Edits: 14,836
iTrader: (0)
adipiciu is on a distinguished road

Admin Award


Default

Quote:
Originally Posted by Dread View Post
So should I wait until bots clean up before editing or will it edit the stuff again if i change an edited page?
You can edit when you want. You don't need to wait for the bot.


Quote:
Originally Posted by Dread View Post
Also it changed some {{Trickster Online:???}} into templates should i changed them into templates instead or keep it like before i don't know.
Corrected. If you know where the bot changed the {{Trickster Online:???}} to template, change it back. They aren't many places i think.
adipiciu is offline   Reply With Quote
Old 09-08-2008   #126 (permalink)
Hurricane Kick
 
Sirnaq's Avatar
 
Join Date: Jun 2008
Posts: 96
Wiki Edits: 7,446
iTrader: (0)
Sirnaq is on a distinguished road

Content Manager

Class: Cat to_primadonna
Default

Your bot just roxx and saves the day, simply! Thats amazing how much work it has done in a fistfull of days.

Btw the search engine needs a little fix somehow, is it scheduled ? It's quite a useful feature, I use it often and I'm not the only one. Thx.

Now just a suggestion, if some "little helpers" are still willing to give a hand with the wiki: we need a few volunteers to update the pictures. Yea it's easy, but that's a lot of work. You can get most of them via the old wiki, or using Vix if you feel like it. "Together everyone wins" like they said ;o
Sirnaq is offline   Reply With Quote
Old 09-08-2008   #127 (permalink)
MMOG's #1 Idol
 
NoeJeko's Avatar
 
Join Date: Jun 2008
Location: San Jose, CA
Posts: 2,137
Wiki Edits: 60
Blog Entries: 20
iTrader: (0)
NoeJeko has a spectacular aura aboutNoeJeko has a spectacular aura about

Site Management
Wiki Sysop

Send a message via AIM to NoeJeko Send a message via MSN to NoeJeko
IGN: NoeJeko
Class: Warrior lt_warrior
Level: 23
Guild: Kirameki

MyMMOGames.net Supporter
Default

The new revision of the site has a Google search across all aspects of the site. On the wiki in particular, there's still a link to the wiki search if people want to just search the wiki. If there are any tweaks I can do to the wiki search engine, please let me know.
__________________
Read my latest blog! New Blogging Features
[Forum Rules][NoeJeko's Blog][IRC Stats][Guide Guide][TO Training Guide]
k0n: Explaining anything to ignorant people is the same as trying to teach a turtle to sing. At some point, it's just hopeless.

NoeJeko is online now   Reply With Quote
Old 09-09-2008   #128 (permalink)
Reality to tear apart.
 
Chesters's Avatar
 
Join Date: Jun 2008
Location: USA
Posts: 1,049
Wiki Edits: 5,338
Blog Entries: 1
iTrader: (1)
Chesters will become famous soon enoughChesters will become famous soon enough

Wiki Sysop

Send a message via MSN to Chesters
IGN: Chesters
Class: Messer Forscher lt_explorer
Level: 40
Guild: SOS Brigade/Empire

Default

The search doesn't need a 'fix', it's just slightly inconvenient at the time if you aren't aware of the search preferences. (what those boxes are at the bottom of the search, and in your preferences)

However, what Noe said ^ should remove this problem.
__________________

Chesters is online now   Reply With Quote
Old 09-09-2008   #129 (permalink)
VIP
 
Join Date: Jul 2008
Posts: 85
Wiki Edits: 956
iTrader: (0)
OrangeJuice is on a distinguished road

Default

Quote:
Originally Posted by Sirnaq View Post
Your bot just roxx and saves the day, simply! Thats amazing how much work it has done in a fistfull of days.

Btw the search engine needs a little fix somehow, is it scheduled ? It's quite a useful feature, I use it often and I'm not the only one. Thx.

Now just a suggestion, if some "little helpers" are still willing to give a hand with the wiki: we need a few volunteers to update the pictures. Yea it's easy, but that's a lot of work. You can get most of them via the old wiki, or using Vix if you feel like it. "Together everyone wins" like they said ;o
(^o^) Yeah, very nice bot, Adi! (o-o;; it sounds so confusing to me lol..).

>.<;Um for re-uloading the pictures, do we load the pictures on our photobucket first? We won't have a problem with bandwith (ex. when the image won't show due to exceeded bandwith.)?
OrangeJuice is offline   Reply With Quote
Old 09-09-2008   #130 (permalink)
Reality to tear apart.
 
Chesters's Avatar
 
Join Date: Jun 2008
Location: USA
Posts: 1,049
Wiki Edits: 5,338
Blog Entries: 1
iTrader: (1)
Chesters will become famous soon enoughChesters will become famous soon enough

Wiki Sysop

Send a message via MSN to Chesters
IGN: Chesters
Class: Messer Forscher lt_explorer
Level: 40
Guild: SOS Brigade/Empire

Default

Quote:
Originally Posted by OrangeJuice View Post
(^o^) Yeah, very nice bot, Adi! (o-o;; it sounds so confusing to me lol..).

>.<;Um for re-uloading the pictures, do we load the pictures on our photobucket first? We won't have a problem with bandwith (ex. when the image won't show due to exceeded bandwith.)?
All images must be saved to the Wiki. (the image links are already there if the image doesn't exist)
__________________

Chesters is online now   Reply With Quote
Old 09-09-2008   #131 (permalink)
Hurricane Kick
 
Sirnaq's Avatar
 
Join Date: Jun 2008
Posts: 96
Wiki Edits: 7,446
iTrader: (0)
Sirnaq is on a distinguished road

Content Manager

Class: Cat to_primadonna
Default

Quote:
Originally Posted by NoeJeko View Post
The new revision of the site has a Google search across all aspects of the site. On the wiki in particular, there's still a link to the wiki search if people want to just search the wiki. If there are any tweaks I can do to the wiki search engine, please let me know.
About the search engine (the one that is already implemented), the problem is that we deleted a few of the "original" pages, those without the "Trickster Online:" prefix. As a result, just try to search for "Confession Letter": it will work and show you the page. Now with "Abiox". The page doesn't exist anymore. However, if you type "Trickster Online:Abiox", it's pretty long and inconvenient (and I doubt random users will think of adding the prefix in their research), still it works (and hopefully such capricious pages are a minority)...

Uploading images to the wiki is a piece of cake: the "Upload file" option is at the bottom of the left menu. Just don't forget to add the prefix before any image filename:
* Confession_Letter.gif -> Bad!!
* TO_Confession_Letter.gif -> Good
Sirnaq is offline   Reply With Quote
Old 09-09-2008   #132 (permalink)
Reality to tear apart.
 
Chesters's Avatar
 
Join Date: Jun 2008
Location: USA
Posts: 1,049
Wiki Edits: 5,338
Blog Entries: 1
iTrader: (1)
Chesters will become famous soon enoughChesters will become famous soon enough

Wiki Sysop

Send a message via MSN to Chesters
IGN: Chesters
Class: Messer Forscher lt_explorer
Level: 40
Guild: SOS Brigade/Empire

Default

You need to check the boxes at the bottom of the search page. The search works, however, most people don't realize you need to specifiy namespaces. (you can set the defaults of your search in your preferences on the wiki)

However, again, this won't be a problem later anyway.
__________________

Chesters is online now   Reply With Quote
Old 09-09-2008   #133 (permalink)
VIP
 
Join Date: Jul 2008
Posts: 85
Wiki Edits: 956
iTrader: (0)
OrangeJuice is on a distinguished road

Default

Quote:
Uploading images to the wiki is a piece of cake: the "Upload file" option is at the bottom of the left menu. Just don't forget to add the prefix before any image filename:
* Confession_Letter.gif -> Bad!!
* TO_Confession_Letter.gif -> Good
Alright, I did these for the filename. Should I add TO_ in front of the source (aka when I save an image to my comp. to upload), as well? (I did it for some, but only for the ones that didn't have an image at all).
OrangeJuice is offline   Reply With Quote
Old 09-09-2008   #134 (permalink)
Reality to tear apart.
 
Chesters's Avatar
 
Join Date: Jun 2008
Location: USA
Posts: 1,049
Wiki Edits: 5,338
Blog Entries: 1
iTrader: (1)
Chesters will become famous soon enoughChesters will become famous soon enough

Wiki Sysop

Send a message via MSN to Chesters
IGN: Chesters
Class: Messer Forscher lt_explorer
Level: 40
Guild: SOS Brigade/Empire

Default

Quote:
Originally Posted by OrangeJuice View Post
Alright, I did these for the filename. Should I add TO_ in front of the source (aka when I save an image to my comp. to upload), as well? (I did it for some, but only for the ones that didn't have an image at all).
The name of your image (on your computer) does not affect anything when you upload it to the Wiki. ~ (besides extension, but that's not exactly the 'name' of it anyway)
__________________

Chesters is online now   Reply With Quote
Old 09-09-2008   #135 (permalink)
VIP
 
Join Date: Jul 2008
Posts: 85
Wiki Edits: 956
iTrader: (0)
OrangeJuice is on a distinguished road

Default

Oh ok. Thanks very much for quick reply =]
OrangeJuice is offline   Reply With Quote
Old 09-09-2008   #136 (permalink)
어머나!
 
Kudaranai's Avatar
 
Join Date: Jun 2008
Location: NYC
Posts: 2,097
Wiki Edits: 1,881
Blog Entries: 7