Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Commit

Permalink
Merge branch '2.4'
Browse files Browse the repository at this point in the history
  • Loading branch information
daveaiello committed Feb 11, 2013
2 parents 3c73594 + e1e1e12 commit ddd489d
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 32 deletions.
8 changes: 3 additions & 5 deletions README.md
Expand Up @@ -4,22 +4,20 @@ Reblog is a Movable Type plugin that parses Atom and RSS feeds and transforms fe

# Dependencies

Reblog Version 2.3 supports the following versions of Movable Type:
Reblog Version 2.4 supports the following versions of Movable Type:

* Movable Type 4.25 or later
* Movable Type 5.0x
* Movable Type 5.1x
* Movable Type 5.2.x

Note: There is currently a [reported problem with Reblog 2.3 and Movable Type 5](https://github.com/movabletype/mt-plugin-reblog/issues/5) that may be a bug in the Movable Type core.

## Additional Perl Module Requirements

In addition to the [System Requirements](http://www.movabletype.org/documentation/system-requirements.html) for Movable Type, Reblog requires the following Perl modules:

* [DateTime](http://search.cpan.org/~drolsky/DateTime-0.78/lib/DateTime.pm)
* [Date::Parse](http://search.cpan.org/~gbarr/TimeDate-1.20/lib/Date/Parse.pm)
* [Switch](http://search.cpan.org/~rgarcia/Switch-2.16/Switch.pm)
* [Switch](http://search.cpan.org/~rgarcia/Switch-2.16/Switch.pm) is no longer required in version 2.4 and later.

## Optional Perl Modules

Expand Down Expand Up @@ -70,7 +68,7 @@ The Reblog concept was initially developed at [Reblog.org](http://www.reblog.org

# Copyright

Copyright © 2007 - 2012, Six Apart Ltd. All Rights Reserved.
Copyright © 2007 - 2013, Six Apart Ltd. All Rights Reserved.

Enhancements to update frequencies and hierarchical category support, additional documentation, Copyright © 2011-2013, After6 Services LLC. All Rights Reserved.

Expand Down
2 changes: 1 addition & 1 deletion plugins/reblog/config.yaml
@@ -1,7 +1,7 @@
name: Reblog
id: reblog
key: reblog
version: 2.3
version: 2.4
schema_version: 2.952
description: Plugin for automatic syndication with attribution.
author_name: Six Apart, Ltd., After6 Services LLC, and 601am LLC, et. al.; original Reblog by Eyebeam & Stamen
Expand Down
55 changes: 29 additions & 26 deletions plugins/reblog/lib/Reblog/Import.pm
Expand Up @@ -563,7 +563,7 @@ sub import_entries {

# If we're updating an old reblogged row, we need this entry but
# can't use MT::Object join for this circumstance, so do it manually
my (@rb_data) = Reblog::ReblogData->load( { guid => $guid },
my (@rb_data) = Reblog::ReblogData->load( { guid => "$guid" },
{ sort => 'created_on', direction => 'ascend' } );
my $rb_data;
foreach my $rbd (@rb_data) {
Expand Down Expand Up @@ -729,31 +729,34 @@ sub import_entries {

sub determine_file_type {
my $url = shift;
use Switch;
my $type = 'unknown';
switch ($url) {
case /^.*\.mp3$/i { $type = 'audio/mpeg'; }
case /^.*\.m4a$/i { $type = 'audio/mp4'; }
case /^.*\.wma$/i { $type = 'audio/wma'; }
case /^.*\.midi$/i { $type = 'audio/midi'; }
case /^.*\.aa$/i { $type = 'audio/aa'; }
case /^.*\.wav$/i { $type = 'audio/wav'; }
case /^.*\.ogg$/i { $type = 'application/ogg'; }
case /^.*\.torrent$/i { $type = 'application/x-bittorrent'; }
case /^.*\.exe$/i { $type = 'application/octet-stream'; }
case /^.*\.bmp$/i { $type = 'image/bmp'; }
case /^.*\.jpe?g$/i { $type = 'image/jpeg'; }
case /^.*\.gif$/i { $type = 'image/gif'; }
case /^.*\.tiff?$/i { $type = 'image/tiff'; }
case /^.*\.png$/i { $type = 'image/png'; }
case /^.*\.mp4/i { $type = 'video/mp4'; }
case /^.*\.mp4v/i { $type = 'video/mp4'; }
case /^.*\.mpeg$/i { $type = 'video/mpeg'; }
case /^.*\.avi$/i { $type = 'video/msvideo'; }
case /^.*\.mov$/i { $type = 'video/quicktime'; }
case /^.*\.wmv$/i { $type = 'video/x-ms-wmv'; }
}
return $type;
my ($ext) = $url =~ m/\.(\w+)$/;
$ext = lc $ext;
my %listing = (
mp3 => 'audio/mpeg',
m4a => 'audio/mp4',
wma => 'audio/wma',
midi => 'audio/midi',
aa => 'audio/aa',
wav => 'audio/wav',
ogg => 'application/ogg',
torrent => 'application/x-bittorrent',
exe => 'application/octet-stream',
bmp => 'image/bmp',
jpg => 'image/jpeg',
jpeg => 'image/jpeg',
gif => 'image/gif',
tiff => 'image/tiff',
tif => 'image/tiff',
png => 'image/png',
mp4 => 'video/mp4',
mp4v => 'video/mp4',
mpeg => 'video/mpeg',
avi => 'video/msvideo',
mov => 'video/quicktime',
wmv => 'video/x-ms-wmv',
);
return $listing{$ext} || 'unknown';

}

sub _clean_html {
Expand Down

0 comments on commit ddd489d

Please sign in to comment.