Raised This Month: $32 Target: $400
 8% 

[BETA] [PHP] SourceMod Plugin Updater


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
Doggie52
Senior Member
Join Date: Jul 2007
Location: Sweden
Old 08-18-2010 , 07:48   [BETA] [PHP] SourceMod Plugin Updater
Reply With Quote #1

Doggie52 (dG52) PHP SourceMod Plugin Updater

After hours of work I am finally done with what I think can be of great help to server administrators. I would appreciate if someone could test this on their server and report back with suggestions, feedback or problems! I would also appreciate if someone took their time and helped me out with the UI part of the script!

dG52 PHP SourceMod Plugin Updater grabs a list of the plugins (through 'sm plugins list' via RCON) installed on your server. It then queries both the SourceMod plugin search and the AlliedModders forums for the latest version. After having found the URL of the plugin's forum post it saves this in an SQLite database for future searches.

Usage instructions

Download the archive and extract to your webserver's `htdocs` directory.
Configure the script by opening `config.php` in your favorite text-editor and editing the variables listed.
Then, open the `install.php` file in your browser and let it create the database.

You're done! Open `plugins.php` in your browser and let it do its job.

If the plugin can not find a matching forum URL for a certain plugin, it will tell you so. You can then choose to click the affected plugin's name and add the forum URL yourself!

Changelog

The code lies on an SVN repository - the source code changes can be viewed here. If you prefer to have this in feed format, you can access that here.

Notes

Make sure your script is hosted somewhere only YOU can access it. Do NOT put this on a public webserver - bad things can happen.
Please report any issues in the issue tracker!
The script queries the search and forum pages directly - these can take a long time to download so be patient! The script can take around a minute to complete.
The script uses the srcds rcon PHP class by Geert Broekmans.
The script entirely relies on that plugin authors keep their plugin version up-to-date on the forum post.

Download

http://code.google.com/p/dg52-php-sm...downloads/list

Screenshot


Attached Thumbnails
Click image for larger version

Name:	screenshot-r11.jpg
Views:	570
Size:	95.0 KB
ID:	72550  
__________________
Quote:
Originally Posted by Iltafragit View Post
4kg ram i5 processor

Last edited by Doggie52; 03-18-2012 at 17:10.
Doggie52 is offline
HSFighter
Veteran Member
Join Date: Aug 2007
Location: Flensburg - Germany
Old 08-18-2010 , 15:42   Re: [BETA] [PHP] SourceMod Plugin Updater
Reply With Quote #2

Very nice Job

I try to check it tomorrow, and will give you feedback.
__________________



Sorry for my very bad english
Greetings HSFighter
HSFighter is offline
Send a message via ICQ to HSFighter
DeaD_EyE82
AlliedModders Donor
Join Date: Jan 2006
Location: Germany
Old 08-19-2010 , 09:05   Re: [BETA] [PHP] SourceMod Plugin Updater
Reply With Quote #3

Nice Work.
Can you add a function to add the URLS for the Plugins manually?
__________________
German Support for HL2-Servers:

sourceserver.info
DeaD_EyE82 is offline
Send a message via ICQ to DeaD_EyE82
Doggie52
Senior Member
Join Date: Jul 2007
Location: Sweden
Old 08-19-2010 , 11:14   Re: [BETA] [PHP] SourceMod Plugin Updater
Reply With Quote #4

DeaD_EyE82 - that's basically already implemented - simply edit the SQLite database (with something like SQLite DB browser 1.0) and add a row with the plugin's exact name in the `name` field and the corresponding URL in the `url` field. I'll add an easier way to do this in the near future!

EDIT: I have added this functionality in revision 5! Simply click the plugin's name and it will take you to a page where you can add your own URL. The new download is available on the main post.
__________________
Quote:
Originally Posted by Iltafragit View Post
4kg ram i5 processor

Last edited by Doggie52; 08-19-2010 at 19:37.
Doggie52 is offline
HSFighter
Veteran Member
Join Date: Aug 2007
Location: Flensburg - Germany
Old 08-23-2010 , 18:29   Re: [BETA] [PHP] SourceMod Plugin Updater
Reply With Quote #5

Sorry for my late feedback.

All fine, it's working great

It's would be nice if your script watch the new plugins to,
and not only the approved plugins:

PHP Code:
// Match the plugin search page against patterns for URL and author
$searchpattern "/(?:title=\"Approved\")(?:.*?)(?:\")(.*?)(?:\")(?:.*?)(?:<a href=\")(?:.*?)(?:\">)(.*?)(<\/a>)/i"
ELSE very nice Work ^^
__________________



Sorry for my very bad english
Greetings HSFighter

Last edited by HSFighter; 08-23-2010 at 18:34.
HSFighter is offline
Send a message via ICQ to HSFighter
Cleric
Member
Join Date: Feb 2009
Location: Sweden
Old 08-24-2010 , 20:11   Re: [BETA] [PHP] SourceMod Plugin Updater
Reply With Quote #6

This is just great, kudos to you.

Will give this a go on my server in the near future and will hopefully give some feedback.

How about a choice between SQLite and Mysql?
__________________
Cleric is offline
Dravu
Senior Member
Join Date: May 2010
Old 08-24-2010 , 22:16   Re: [BETA] [PHP] SourceMod Plugin Updater
Reply With Quote #7

Did you get permission to have your script crawl and scrape the forum? I already have enough problems accessing it to be honest. Don't need extra load on the server.

Ask nicely and they might even come up with a much more light-weight search feature for finding plugin versions.

Last edited by Dravu; 08-24-2010 at 22:20.
Dravu is offline
Xsinthis
Senior Member
Join Date: Oct 2008
Location: Canadia, eh?
Old 08-24-2010 , 22:37   Re: [BETA] [PHP] SourceMod Plugin Updater
Reply With Quote #8

I'll be up front, i don't know nothing about coding, so i'm purely saying this based on what i've read. By the sounds of it your crawling the forums, why not instead query/crawl the list of plugins they keep on the main pages? (http://www.sourcemod.net/plugins.php)

Also, why not get it to work with HSFighter's Wedadmin package
__________________
Xsinthis is offline
HSFighter
Veteran Member
Join Date: Aug 2007
Location: Flensburg - Germany
Old 08-25-2010 , 13:03   Re: [BETA] [PHP] SourceMod Plugin Updater
Reply With Quote #9

Quote:
Originally Posted by Xsinthis View Post
I'll be up front, i don't know nothing about coding, so i'm purely saying this based on what i've read. By the sounds of it your crawling the forums, why not instead query/crawl the list of plugins they keep on the main pages? (http://www.sourcemod.net/plugins.php)
He get the plugin Version from the forum entrys.
The version appears in the headline of the plugin topic.
But the version doun't be show in a row in the pluginlist.

Quote:
Originally Posted by Xsinthis View Post
Also, why not get it to work with HSFighter's Wedadmin package
If i get the permission from Doggie52 to do this,
i will add this nice function to the Webadmin and give the credits to Doggie52.
__________________



Sorry for my very bad english
Greetings HSFighter
HSFighter is offline
Send a message via ICQ to HSFighter
Doggie52
Senior Member
Join Date: Jul 2007
Location: Sweden
Old 08-25-2010 , 16:49   Re: [BETA] [PHP] SourceMod Plugin Updater
Reply With Quote #10

Hello everyone! Thank you all for the great feedback you've given me - please keep it coming ! I'll try to respond to your posts, bear with me for the wall of text..

Quote:
Originally Posted by HSFighter View Post
Sorry for my late feedback.

All fine, it's working great

It's would be nice if your script watch the new plugins to,
and not only the approved plugins:

PHP Code:
// Match the plugin search page against patterns for URL and author
$searchpattern "/(?:title=\"Approved\")(?:.*?)(?:\")(.*?)(?:\")(?:.*?)(?:<a href=\")(?:.*?)(?:\">)(.*?)(<\/a>)/i"
ELSE very nice Work ^^
The problem is that I then would have to search using something else than SourceMod's own plug-in search (since, AFAIK, it only returns approved plugins. If it can return unapproved plugins, please let me know how this would be done!). If you can recommend a search-tool I am able to GET request then I'd be glad to implement it. It would, however, take some additional time to load!

Quote:
Originally Posted by Cleric View Post
This is just great, kudos to you.

Will give this a go on my server in the near future and will hopefully give some feedback.

How about a choice between SQLite and Mysql?
The ability to select between SQLite and MySQL is on my to-do list . But to be honest, there's no real downside to SQLite in this case. If you're struggling to edit the database, there are a number of tools you can use. One which I use is SQLite Browser 1.1.

Quote:
Originally Posted by Dravu View Post
Did you get permission to have your script crawl and scrape the forum? I already have enough problems accessing it to be honest. Don't need extra load on the server.

Ask nicely and they might even come up with a much more light-weight search feature for finding plugin versions.
What this script does is to simply query a URL for its HTML. When searching for plugins (on www.sourcemod.net) what it downloads is, on average, ~10KB per load - i.e. not too much to worry about. Also, due to the nature of PHP, no concurrent connections are made. What is queried is queried one after another, meaning less stress on the web server than if things happened simultaneously.

I cannot deny, however, that the script does indeed use a quite cumbersome method of obtaining plugin URLs and version. If you have any suggestions as to how I can improve it, please let me know or make a post in the Issue Tracker (linked in my original post). I will speak with the administrators of the site - perhaps they can give me an alternative to what I am using today.

Quote:
Originally Posted by Xsinthis View Post
I'll be up front, i don't know nothing about coding, so i'm purely saying this based on what i've read. By the sounds of it your crawling the forums, why not instead query/crawl the list of plugins they keep on the main pages? (http://www.sourcemod.net/plugins.php)

Also, why not get it to work with HSFighter's Wedadmin package
I'm not sure exactly what you mean in this case - the script is, in fact, crawling that page but with certain GET parameters that search for the plugin's name directly. If you mean that I should use the entire list of plugins (http://www.sourcemod.net/plugins.php...tion=&search=1) to gather my URL's then I must remind you about the following - that list includes all SourceMod-approved plugins and is a far larger (totals at around 800KB) download than 10-15 individual plugin's search pages.

Also, I have implemented a feature that caches each plugin's URL in a local database which means that next time the script is loaded, the SourceMod plugin search won't be queried at all (instead, the cached URL will be used).

What I can not do anything about, however, is the querying of forum pages. For each plugin, the script queries its corresponding forum URL to gather the latest version of the plugin. I have tried in different ways to minimize the HTML that is being downloaded without success:
- cURL's range option doesn't work with AM's server
- using a less intensive forum skin won't render the needed "Plugin Version:"
- only querying the first post (&postcount=1) won't render the "Plugin Version:" field either

I will suggest, to the administrators, some sort of change to the way plugin versions are handled on the site.

About the WebAdmin-package - if HSFighter is interested in obtaining a version of the script for his package he may contact me at any time. I would recommend, however, that this plugin is run by itself and not more than a few times per week due to the nature of what it does. I would, to be honest, prefer to keep the script to myself until it has "taken off" a bit, too (what I mean by that is that I'd prefer to keep my code from being redistributed although yes, I do know that is part of open source software). HSFighter, you may advice users to download the script and use it together with your package, but I would prefer if you sent them to the script's Google Code site for the actual download.
__________________
Quote:
Originally Posted by Iltafragit View Post
4kg ram i5 processor
Doggie52 is offline
Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 06:06.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode