SVN Update Notifications

This is a small menu plugin that searches your addon folder for addons that use SVN and checks if they need to be updated. If an addon needs to be updated, a notification pops up telling you to do so.

Screenshot

http://images.overvprojects.nl/SVN_update_checker(2).png

Installation

Paste this into a .lua file in garrysmod/garrysmod/lua/menu_plugins. Create the directory if it doesn’t exist yet.

[lua]local addons = file.FindDir( “addons/*”, true )
local path, properties, current, latest, name

for _, addon in ipairs( addons ) do
path = “addons/” … addon … “/.svn/entries”
if ( file.Exists( path, true ) ) then
properties = string.Explode( "
", file.Read( path, true ) )
current = tonumber( properties[4] )

	http.Get( "http://83.84.23.31/dev/get.php?url=" .. properties[5], "", function( contents )
		latest = tonumber( string.match( contents, "Revision ([0-9]+)" ) )
		
		if ( current and latest and current < latest ) then
			name = KeyValuesToTable( file.Read( "addons/" .. addon .. "/info.txt", true ) )["name"]
			
			notification.AddLegacy( ( name or addon ) .. " needs to be updated!", NOTIFY_UNDO, 60 )
		end
	end )
end

end[/lua]

[sp]The proxy is needed because http.Get doesn’t support SSL, which is what SVN requires for the web interface.[/sp]

Enjoy!

Why the spoiler tags for something that isn’t really a spoiler?

Very nice. You got my download.

[editline]12th March 2011[/editline]

Or copy-paste, I dunno what you guys might call it.

Nice.

Thats pretty cool overv

I hate always having to check if my svns are upto date.

Overv you beast you… Always creating useless shit, Nah im joking :stuck_out_tongue: Im definitely going to use this!

LOL
http://83.84.23.31/dev/get.php?url=
thx

Haha nice try, asshole

-snip I shouldn’t post when I’m tired-

Click it, then you’ll understand.

[lua]local addons = file.FindDir( “addons/*”, true )
local path, properties, current, latest, name

for _, addon in ipairs( addons ) do
path = “addons/” … addon … “/.svn/entries”
if ( file.Exists( path, true ) ) then
properties = string.Explode( "
", file.Read( path, true ) )
current = tonumber( properties[4] )

    http.Get( "http://www.gmodsvns.net/svn/get_revision.php?url=" .. properties[5], "", function( contents )
        latest = tonumber( string.match( contents, "Revision ([0-9]+)" ) )
         
        if ( current and latest and current < latest ) then
            name = KeyValuesToTable( file.Read( "addons/" .. addon .. "/info.txt", true ) )["name"]
             
            notification.AddLegacy( ( name or addon ) .. " needs to be updated!", NOTIFY_UNDO, 60 )
        end
    end )
end

end[/lua]

Feel free to use the link in mine as well if the above one for some reason doesn’t work because some ISP’s block you from browsing to an IP.

It would be easier to just use my domain.

http://ip.overvprojects.nl/

Is it possible to do this but on the server? Server check the availability of addons, and told if something is outdated or addon not found.

This sure is smart. No need to attemp to update my SVNs all the time.

Using this now.

Thanks, didn’t realise you had released this yet lol!

Very useful.

ISPs blocking IPs? Do you have any idea how DNS (or the internet at all) works?

Yes I do and it IS possible that ISP’s block http://IPADDRESS HERE.
Not IP addresses globally.

I don’t think that’s even possible. It’s translated to the server’s IP on your computer and that’s what your browser connects with.

I guess you run the SSL proxy on your home connection? (*.dynamic.ziggo.nl)
It’s offline for some reason.

Best would be if http.get had SSL.

Whoops damn iPhone touch, I meant to agree.