Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-07-28 22:44:56

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

asv_plugin_installer (based off of rss_pluginstaller)

The Big Picture
When Rob wrote rss_pluginstaller, he hit on a great concept. Instead of having developers upload their plugins into some central repository, they could manage them on their own. I wanted to start distributing my plugins this way as well. There are two components to this concept: a feed that the developer makes available (asv_plugin_distributor) and a backend where users can access and download the plugins (asv_plugin_installer).

You can download the latest builds at http://asv-plugins.googlecode.com/svn/trunk/asv_plugin_installer/

asv_plugin_distributor
This is all in the early stages but here’s the idea I have implemented so far. This plugin will create a rss feed of plugins that can be read by the installer. It takes files you’ve uploaded through TXP and categorized as “pluginfeed”. Right now it assumes that the files in this category are a compiled plugin (txt file). Obviously there’s a lot of work to do around this, but you can see an example here

asv_plugin_installer
This is 99% Rob’s plugin with a couple modifications. One modification is that you can now specify the feed you want to check (by default it connects to Rob’s feed). Right now you can only check one feed at a time, but try using http://www.amitvaria.com/?pluginfeed=1 as the source to test it out.

What’s to come?
This is all pretty early in the making, but I’m imagining that developers will have feeds for their plugins and we can have a simple website that links to all of these feeds. You’ll be able to easily find plugins and be notified of updates. I’m going to work on expanding on this concept, but right now I just wanted to see what developers and users thought of this.

Offline

#2 2007-07-30 15:07:11

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: asv_plugin_installer (based off of rss_pluginstaller)

Hi Amit

I’ve been hoping to see someone expand on Rob’s plugin! Thanks.

fwiw in case it helps you and for those (like myself) who don’t stop and think it through first: :)

I received the following error when ASV’s version of plugin-installer was enabled AND Rob’s version was enabled. Disabling Rob’s allows ASV’s version to work. (A reah “duh! moment for me :”> )

Error Message Received:
Fatal error: Cannot redeclare rss_fetchurl() (previously declared in /pathway/textpattern/lib/txplib_misc.php(534) : eval()’d code:170) in /pathway/textpattern/lib/txplib_misc.php(534) : eval()’d code on line 229

Mike

Last edited by maverick (2007-08-03 23:09:15)

Offline

#3 2007-08-07 06:58:11

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: asv_plugin_installer (based off of rss_pluginstaller)

Nice idea.

One concern: the plugin does not appear to prevent abuse/innocent over-use. I’m concerned about my server getting hammered, particularly with my popular plugins. I would recommend the use of caching of some form. There are a few different ways to do it, not necessarily complicated or difficult.

You can fix the “cannot redeclare” error either by placing the rss_fetchurl() function inside an if (!function_exists('rss_fetchurl')) { ... } or renaming the function call and declaration to something else.

Offline

#4 2007-08-07 07:03:23

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

Re: asv_plugin_installer (based off of rss_pluginstaller)

Mary,

That’s a good idea about the cache. I wrote some code that cached Amazon responses that I can adapt to this installer, but the cache would still be on your server. Since it would just be a static file, it shouldn’t consume many resources. If there’s a better place to store the cache let me know.

Thanks!

Offline

#5 2007-08-07 08:03:13

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: asv_plugin_installer (based off of rss_pluginstaller)

What I would recommend is caching the check results for the user. Maybe in the database, say a table like the following:

plugin (VARCHAR)
version (VARCHAR)
check (DATETIME)

Before checking the author’s feed, the plugin checks to see if the plugin of concern is listed in the table.
** If it isn’t, that means it hasn’t been checked for an update yet, so do all that. Once the check is done, enter the data into the table.
** If it is (this is the same db query as the very first one above), make sure that a reasonable amount of time has passed since the last check.
*** If it has, proceed with the check.
*** If it hasn’t, proceed using data from table.

That’s a basic overview of one way of doing it.

Offline

#6 2007-08-07 15:13:17

Manfre
Plugin Author
From: North Carolina
Registered: 2004-05-22
Posts: 588
Website

Re: asv_plugin_installer (based off of rss_pluginstaller)

Very nice. I just found out about rob’s plugin a few days ago and had started the motions of creating a generic one. Looks like you beat me to it.

Offline

#7 2007-08-08 05:12:20

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

Re: asv_plugin_installer (based off of rss_pluginstaller)

Mary,

Since we can’t check a single plugin at a time, that table would have to be:
  • pluginfeedurl (varchar)
  • check (datetime)

At that point, we could have it update a local cache of the pluginfeed rss on a timely basis.

@Manfre – If a programmer with your skills wants to get involved, I don’t think I have an issue with that. :)

Offline

#8 2007-08-08 13:31:02

Manfre
Plugin Author
From: North Carolina
Registered: 2004-05-22
Posts: 588
Website

Re: asv_plugin_installer (based off of rss_pluginstaller)

I’d love to help out. Feel free to IM (check profile).

Offline

#9 2007-08-08 22:16:47

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

Re: asv_plugin_installer (based off of rss_pluginstaller)

So here’s a question – Rob created an rss feed for his pluginfeed, but is there a reason to use RSS? I mean if we want to stick with a standard would ATOM be better? I want to use a format that will allow use room to grow and include more data as needed.

Offline

#10 2007-08-09 02:43:03

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: asv_plugin_installer (based off of rss_pluginstaller)

Any reason to use a standard format, rather than a custom one (plain XML rather than RSS or Atom)? If people want to have a plugin feed for a feed reader, that’s easy enough to setup already. Right now the output is invalid anyway.

Last edited by Mary (2013-01-24 17:32:26)

Offline

#11 2007-08-10 04:22:06

variaas
Plugin Author
From: Chicago
Registered: 2005-01-16
Posts: 402
Website

Re: asv_plugin_installer (based off of rss_pluginstaller)

I’m going to see if I can get Rob in on this discussion to see if he had any reasons to use RSS when he wrote his plugin. Otherwise, I think custom xml would be the best option.

Offline

#12 2007-12-28 18:53:01

maverick
Member
From: Southeastern Michigan, USA
Registered: 2005-01-14
Posts: 976
Website

Re: asv_plugin_installer (based off of rss_pluginstaller)

Something strange:

I had not updated plugins using the updater in a while. In the past I have switched between asv’s feed and wilshire’s feed. I had left it set for the wilshire feed.

Today, when I went to check for updates, asv_plugin_installer is giving me the following warning:

Warning: MagpieRSS: Failed to parse RSS file. (Mismatched tag at line 11, column 12) in /my/web/server/textpattern/magpie/rss_fetch.inc on line 238
Could not connect to wilshire|one.

I haven’t changed anything with the plugin itself since I last checked for updates, when it worked as it should. If I disable the asv_ version and enable Rob’s original version, Rob’s works fine.

I’m puzzled. System-wise, I have added plugins, and updated to the latest svn of Txp. I suppose the problem might lie there, but am doubtful since Rob’s version works. I’ll knock around some more, but thought I’d check to see if anyone else had any problems.

Also, while I am thinking of it . . . I know there were some initial plans to develop this plugin more, maybe collaborate with Manfre, possibly use custom xml feeds, protect servers from overuse, etc. Are any of those plans still in the works?

Thanks

Mike

Last edited by maverick (2007-12-28 20:45:12)

Offline

Board footer

Powered by FluxBB