repo
string
commit
string
message
string
diff
string
monde/mms2r
67f30fdb0b466b565d7458d492a1541c2c9b4b9c
md formatting
diff --git a/README.md b/README.md index aa10f18..9979230 100644 --- a/README.md +++ b/README.md @@ -1,219 +1,227 @@ # mms2r https://github.com/monde/mms2r ## DESCRIPTION MMS2R by Mike Mondragon -https://github.com/monde/mms2r -https://rubygems.org/gems/mms2r -http://peepcode.com/products/mms2r-pdf + +* https://github.com/monde/mms2r +* https://rubygems.org/gems/mms2r +* http://peepcode.com/products/mms2r-pdf MMS2R is a library that decodes the parts of a MMS message to disk while stripping out advertising injected by the mobile carriers. MMS messages are multipart email and the carriers often inject branding into these messages. Use MMS2R if you want to get at the real user generated content from a MMS without having to deal with the cruft from the carriers. If MMS2R is not aware of a particular carrier no extra processing is done to the MMS other than decoding and consolidating its media. MMS2R can be used to process any multipart email to conveniently access the parts the mail is comprised of. Contact the author to add additional carriers to be processed by the library. Suggestions and patches appreciated and welcomed! [![tip for next commit](http://tip4commit.com/projects/198.svg)](http://tip4commit.com/projects/198) ### Corpus of carriers currently processed by MMS2R: * 1nbox/Idea: 1nbox.net * 3 Ireland: mms.3ireland.ie * Alltel: mms.alltel.com * AT&T/Cingular/Legacy: mms.att.net, mm.att.net, txt.att.net, mmode.com, mms.mycingular.com, cingularme.com, mobile.mycingular.com pics.cingularme.com * Bell Canada: txt.bell.ca * Bell South / Suncom / SBC Global: bellsouth.net, sbcglobal.net * Cricket Wireless: mms.mycricket.com * Dobson/Cellular One: mms.dobson.net * Helio: mms.myhelio.com * Hutchison 3G UK Ltd: mms.three.co.uk * INDOSAT M2: mobile.indosat.net.id * LUXGSM S.A.: mms.luxgsm.lu * Maroc Telecom / mms.mobileiam.ma * MTM South Africa: mms.mtn.co.za * NetCom (Norway): mms.netcom.no * Nextel: messaging.nextel.com * O2 Germany: mms.o2online.de * O2 UK: mediamessaging.o2.co.uk * Orange & Regional Oranges: orangemms.net, mmsemail.orange.pl, orange.fr * PLSPICTURES.COM mms hosting: waw.plspictures.com * PXT New Zealand: pxt.vodafone.net.nz * Rogers of Canada: rci.rogers.com * SaskTel: sasktel.com, sms.sasktel.com, cdma.sasktel.com * Sprint: pm.sprint.com, messaging.sprintpcs.com, sprintpcs.com * T-Mobile: tmomail.net, mmsreply.t-mobile.co.uk, tmo.blackberry.net * TELUS Corporation (Canada): mms.telusmobility.com, msg.telus.com * U.S. Cellular: mms.uscc.net * UAE MMS: mms.ae * Unicel: unicel.com, info2go.com (note: mobile number is tucked away in a text/plain part for unicel.com) * Verizon: vzwpix.com, vtext.com, labwig.net * Virgin Mobile: vmpix.com, pixmbl.com, vmobl.com, yrmobl.com * Virgin Mobile of Canada: vmobile.ca * Vodacom: mms.vodacom4me.co.za * Cincinnati Bell: mms.gocbw.com ### Corpus of smart phones known to MMS2R: * Apple iPhone variants * Blackberry / Research In Motion variants * Casio variants * Droid variants * Google / Nexus One variants * HTC variants (T-Mobile Dash, Sprint HERO) * LG Electronics variants * Motorola variants * Pantech variants * Qualcom variants * Samsung variants * Sprint variants * UTStarCom variants ### As Seen On The Internets - sites known to be using MMS2R in some fashion -* twitpic.com[http://www.twitpic.com/] -* Simplton[http://simplton.com/] -* fanchatter.com[http://www.fanchatter.com/] -* camura.com[http://www.camura.com/] -* eachday.com[http://www.eachday.com/] -* beenup2.com[http://www.beenup2.com/] -* snapmylife.com[http://www.snapmylife.com/] +* twitpic.com - http://www.twitpic.com/ +* Simplton - http://simplton.com/ +* fanchatter.com - http://www.fanchatter.com/ +* camura.com - [http://www.camura.com/ +* eachday.com - [http://www.eachday.com/ +* beenup2.com - [http://www.beenup2.com/ +* snapmylife.com - [http://www.snapmylife.com/ * email the author to be listed here ## FEATURES * #default_media and #default_text methods return a File that can be used in attachment_fu or Paperclip * #process supports blocks for enumerating over the content of the MMS * #process can be made lazy when :process => :lazy is passed to new * logging is enabled when :logger => your_logger is passed to new * an mms instance acts like a Mail object, any methods not defined on the instance are delegated to it's underlying Mail object * #device_type? returns a symbol representing a device or smartphone type. Known smartphones thus far: iPhone, BlackBerry, T-Mobile Dash, Droid, Samsung ## BOOKS MMS2R, Making email useful + http://peepcode.com/products/mms2r-pdf ## SYNOPSIS +```ruby begin require 'mms2r' rescue LoadError require 'rubygems' require 'mms2r' end # required for the example require 'fileutils' mail = MMS2R::Media.new(Mail.read('some_saved_mail.file')) puts "mail has default carrier subject" if mail.subject.empty? # access the sender's phone number puts "mail was from phone #{mail.number}" # most mail are either image or video, default_media will return the largest # (non-advertising) video or image found file = mail.default_media puts "mail had a media: #{file.inspect}" unless file.nil? # finds the largest (non-advertising) text found file = mail.default_text puts "mail had some text: #{file.inspect}" unless file.nil? # mail.media is a hash that is indexed by mime-type. # The mime-type key returns an array of filepaths # to media that were extract from the mail and # are of that type mail.media['image/jpeg'].each {|f| puts "#{f}"} mail.media['text/plain'].each {|f| puts "#{f}"} # print the text (assumes mail had text) text = IO.readlines(mail.media['text/plain'].first).join puts text # save the image (assumes mail had a jpeg) FileUtils.cp mail.media['image/jpeg'].first, '/some/where/useful', :verbose => true puts "does the mail have quicktime video? #{!mail.media['video/quicktime'].nil?}" puts "plus run anything that Mail provides, e.g. #{mail.to.inspect}" # check if the mail is from a mobile phone puts "mail is from a mobile phone #{mail.is_mobile?}" # determine the device type of the phone puts "mail is from a mobile phone of type #{mail.device_type?}" # inspect default media's exif data if exifr gem is installed and default # media is a jpeg or tiff puts "mail's default media's exif data is:" puts mail.exif.inspect # Block support, process and receive all media types of video. mail.process do |media_type, files| # assumes a Clip model that is an AttachmentFu Clip.create(:uploaded_data => files.first, :title => "From phone") if media_type =~ /video/ end # Another AttachmentFu example, Picture model is an AttachmentFu picture = Picture.new picture.title = mail.subject picture.uploaded_data = mail.default_media picture.save! #remove all the media that was put to temporary disk mail.purge +``` ## REQUIREMENTS * Mail (mail) * Nokogiri (nokogiri) * UUIDTools (uuidtools) * EXIF Reader (exif) ## INSTALL -* sudo gem install mms2r +``` +sudo gem install mms2r +``` ## SOURCE +``` git clone git://github.com/monde/mms2r.git +``` ## AUTHORS -Copyright (c) 2007-2012 by Mike Mondragon blog[http://plasti.cx/] +Copyright (c) 2007-2012 by Mike Mondragon blog http://plasti.cx/ -MMS2R's {Flickr page}[http://www.flickr.com/photos/8627919@N05/] +MMS2R's Flickr page http://www.flickr.com/photos/8627919@N05/ ## CONTRIBUTORS -* Luke Francl - blog[http://railspikes.com/] -* Will Jessup - blog[http://www.willjessup.com/] -* Shane Vitarana - blog[http://www.shanesbrain.net/] -* Layton Wedgeworth - company[http://www.beenup2.com/] -* Jason Haruska - blog[http://software.haruska.com/] -* Dave Myron - company[http://contentfree.com/] +* Luke Francl - http://railspikes.com/ +* Will Jessup - http://www.willjessup.com/ +* Shane Vitarana - http://www.shanesbrain.net/ +* Layton Wedgeworth - http://www.beenup2.com/ +* Jason Haruska - http://software.haruska.com/ +* Dave Myron - http://contentfree.com/ * Vijay Yellapragada -* Jesse Dp - {github profile}[http://github.com/jessedp] +* Jesse Dp - http://github.com/jessedp * David Alm * Jeremy Wilkins -* Matt Conway - {github profile}[http://github.com/wr0ngway] +* Matt Conway - http://github.com/wr0ngway * Kai Kai * Michael DelGaudio -* Sai Emrys - blog[http://saizai.com] -* Brendan Lim - {github profile}[http://github.com/brendanlim] -* Scott Taylor - {github profile}[http://github.com/smtlaissezfaire] -* Jaap van der Meer - {github profile}[http://github.com/japetheape] -* Karl Baum - {github profile}[http://github.com/kbaum] -* James McGrath - blog[http://jamespmcgrath.com] +* Sai Emrys - http://saizai.com/ +* Brendan Lim - http://github.com/brendanlim +* Scott Taylor - http://github.com/smtlaissezfaire +* Jaap van der Meer - http://github.com/japetheape +* Karl Baum - http://github.com/kbaum +* James McGrath - http://jamespmcgrath.com/
monde/mms2r
8aa36ad9e13b5029a1aac8341713d6e4c16a2e24
psych hack is only for ruby 1.9
diff --git a/Gemfile.lock b/Gemfile.lock index 3cf6db1..1aefdba 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,48 +1,48 @@ PATH remote: . specs: - mms2r (3.9.1) + mms2r (3.9.2) exifr (>= 1.0.3) json (>= 1.6.0) mail (>= 2.4.0) nokogiri (>= 1.5.0) rake GEM remote: https://rubygems.org/ specs: exifr (1.1.3) i18n (0.6.1) json (1.7.5) mail (2.4.4) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) metaclass (0.0.1) mime-types (1.19) mocha (0.13.0) metaclass (~> 0.0.1) multi_json (1.3.7) nokogiri (1.5.5) polyglot (0.3.3) rake (10.0.1) rdoc (3.12) json (~> 1.4) simplecov (0.7.1) multi_json (~> 1.0) simplecov-html (~> 0.7.1) simplecov-html (0.7.1) test-unit (2.5.2) treetop (1.4.12) polyglot polyglot (>= 0.3.1) PLATFORMS ruby DEPENDENCIES mms2r! mocha rdoc simplecov test-unit diff --git a/History.txt b/History.txt index 97ff367..387267c 100644 --- a/History.txt +++ b/History.txt @@ -1,466 +1,471 @@ +### 3.9.2 / 2013-09-15 (Abigail Remeltindrinc - record producer) + +* 1 minor enhancement + * psych hack is only for ruby 1.9 + ### 3.9.1 / 2012-11-15 (#216 - Klokateer afflicted with dwarfism) * 1 minor enhancement * remove rake 0.9.2.2 dependency ### 3.9.0 / 2012-10-18 (Jean-Pierre - A French chef) * 1 minor enhancement * refined character encoding capability with 1.8 rubies and 1.9 rubies. ### 3.8.2 / 2012-08-21 (Seth - Pickles The Drummer's brother) * 2 minor enhancements * Broadened handling of generic "Sent from" footers in smart phones * Add ability to process HTC Sensation footer ### 3.8.1 / 2012-07-22 (Calvert - Pickles The Drummer's dad) * 1 major enhancement * Support for Cincinnati Bell - mms.gocbw.com - James McGrath ### 3.8.0 / 2012-07-04 (Dr. Donald Gorfield – Comedy specialist) * 1 major enhancement * Handle MMS from Sprint that have their media attached rather than CDN'd ### 3.7.1 / 2012-06-04 (Abrigail Remeltindtdrinc - The Record Cleaner) * 2 minor enhancements * Improve processing of Sprint media - James McGrath * RDoc format documentation - James McGrath ### 3.7.0 / 2012-05-31 (The Teenager - Edgar's brother via Eric's face) * 2 major enhancements * Improve processing of Sprint media - James McGrath * Remove Hoe and gemcutter dependencies ### 3.6.4 / 2012-04-22 (Molly - Pickles' mother) * 1 minor enhancement * strip a variation of the iphone default footer ### 3.6.3 / 2012-03-25 (Dethklok Minute Host - host of The Dethklok Minute) * 1 minor enhancement * strip Windows phone default footer ### 3.6.2 / 2012-02-12 (Mr. Gojira - Owner Mr. Gojira's Driving School - retake driver's exam) * 1 minor enhancement * Change user agent given to Sprint so it returns a properly sized image. ### 3.6.1 / 2012-02-11 (Mr. Gojira - Owner Mr. Gojira's Driving School) * 1 minor enhancement * use Net::HTTP#get2 to fetch Sprint content ### 3.6.0 / 2012-01-19 (Agent 216 - assassin, master of infiltration and sabotage) * 1 major enhancement * Ruby 1.8.7, 1.9.2, and 1.9.3 compatible * 1 bug fix * A fix for the utf-8 encoding issue with ruby 1.9.2 - minimul / Christian ### 3.5.1 / 2011-12-11 (Mashed Potato Johnson - oldest living blues guitarist in the world) * 1 bug fix * A fix for the utf-8 encoding issue with ruby 1.9.2 - James McGrath ### 3.5.0 / 2011-12-01 (Dr. Milminiman Lamilim Swimwambli - Marriage expert) * 1 major bug fix * In Ruby 1.9.X MMS2R::Media::Sprint was not fetching content from Sprint's CDN correctly because the implementation of Net::HTTP in 1.9.X passes a User-Agent header of "Ruby" to which Sprint responds with a fake 500 - with help from James McGrath ### 3.4.1 / 2011-11-06 (Fatty Ding-Dongs, Dethklok foster child) * 2 major enhancements * Additional means to detect android, iphone, motorola, nokia, palm handsets * Additional known SMS/MMS domains mm.att.net, labwig.net, cdma.sasktel.com ### 3.4.0 / 2011-10-31 (Serveta Skwigelf, Skwisgaar's hot mom) * 2 major enhancements * regexp's in yaml configs are store as a ruby regexp and not a string that is evaled. * character encoding capability with 1.8 rubies and 1.9 rubies. ### 3.3.1 / 2011-01-01 (Reverend Aslaug Wartooth (deceased), Toki's dad) * 2 minor enhancements * new method #default_html returns the default html attachment * #body will return the default plain text, or default stripped html text ### 3.3.0 / 2010-12-31 (Charles Foster Offdensen - CFO, dethklok) * 1 major enhancement * MMS2R::Media::Sprint is now a module that is extended in for processing Sprint content rather than being child class of MMS2R::Media Extension is the strategy to use for overwriting template methods now * 1 minor enhancement * process new Sprint subject - Jason Hooper * new SaskTel mms/sms domain alias sasktel.com * new Virgin Mobile mms/sms domain alias yrmobl.com ### 3.2.0 / 2010-08-17 (Antonio "Tony" DiMarco Thunderbottom - bassist) * 3 minor enhancements * updated readme with latest sites known to use mms2r * bundler assimilated * loading rubygems only if it's required, like rake ### 3.1.0 / 2010-07-09 (Dick "Magic Ears" Knubbler - music producer) * 8 minor enhancements * Detects additional Bell/AT&T domain sbcglobal.net as a handset * Detects additional Virgin mobile domains pixmbl.com vmobl.com as a handset * Expanded mobile phone detection for handset makers by : Casio, Google Nexus One, LG Electronics, Motorola, Pantech, Qualcom, Samsung, Sprint, UTStarCom * EXIF Reader (exifr) is integral to MMS2R and is now a required gem * upgrade Mail to 2.2.5 * depend on latest gems * corrected example - Jason Hooper * added As Seen On The Internet to README that lists sites known to be using MMS2R in some fashion ### 3.0.1 / 2010-03-28 (Lavona Succuboso - leader of "Succuboso Explosion") * 1 minor enhancement * support for U.S. Cellular ### 3.0.0 / 2010-02-24 (General Crozier - Chairman of the Joint Chiefs of Staff) * 1 new feature * dependence upon Mail gem rather than TMail gem ### 2.4.1 / 2010-02-07 (Vater Orlaag - political and spiritual specialist) * 3 minor enhancements * make sure filename is free of new lines - laurynas * recognize HTC HERO200 as a smart phone * recognize HTC Eris as a smart phone ### 2.4.0 / 2009-12-20 (Dr. Nanemiltred Philtendrieden - specialist on celebrity death) * 1 new feature * replace Hpricot with Nokogiri for html parsing of Sprint data * 3 minor enhancements * smartphone identities stored in conf/mms2r_media.yml * identify Motorola Droid as a smartphone * identify T-Mobile Dash as a smartphone * use uuidtools for naming temp directories - kbaum ### 2.3.0 / 2009-08-30 (Snakes 'n' Barrels Greatest Hits) * 5 new features * detect smartphone status/type based on model metadata from jpeg and tiff exif data using exifr gem, access exif data with MMS2R::Media#exif * make MMS2R Rails gem packaging friendly with an init.rb - Scott Taylor, smtlaissezfaire * delegate missing methods to mms2r's tmail object so that mms2r behaves as if it were a tmail object - Sai Emrys, saizai * default_media can return an attachment of application content type - Brendan Lim, brendanlim * MMS2R.parse(raw_mail) convenience class method that parses and returns an mms2r from a mail file - saizai * 4 minor enhancements * make examples more 'mail' specific to enforce the fact that an mms is a multipart email - saizai * update for text in vzwpix.com default carrier message * detecting smartphone (blackberries and iphones for now) is more versatile from reading mail headers * expanded filtering of carrier advertising text in mms from smartphones ### 2.2.0 / 2009-01-04 (Rikki Kixx - owner of a franchise of rehab centers) * 3 new features * MMS2R::Media#is_mobile? best guess if the sender was a mobile device * MMS2R::Media#device_type? best guess of the mobile device type. Simple heuristics thus far for :blackberry :iphone :handset :unknown could be expanded for exif probing or additinal shifting of mail header * from array in conf/from.yml to provide granularity to determine carrier domain (caused by tmo.blackberry.net) * 4 minor enhancements * support for Virgin Canada messaging service vmobile.ca * support for text service messaging.sprintpcs.com * additional BlackBerry coverage from T-Mobile tmo.blackberry.net provider * legacy support for mobile.mycingular.com, pics.cingularme.com * 3 bug fixes * iPhone default subject - jesse dp http://rubyforge.org/tracker/?func=detail&atid=11789&aid=22951&group_id=3065 * add sprintpcs.com to pm.sprint.com aliases * fix OS X long filename issues - Matt Conway ### 2.1.3 / 2008-11-06 (Dr. Ramonolith Chesterfield - Military pharmaceutical psychotropic drug manufacturing expert * 1 minor enhancement * added mms.ae support ### 2.1.2 / 2008-10-21 (Toki's mom, Anja Wartooth) * 2 minor enhancments * Sprint subject update - jesse dp * Virgin Mobile support vmpix.com ### 2.1.1 / 2008-09-24 (Lavona Succuboso, Nathan Explosion uber-groupie) * 4 minor enhancments * Bell Canada support txt.bell.ca - Matt Conway / Snap My Life - http://github.com/wr0ngway, http://github.com/sml * Unicel support unicel.com - Michael DelGaudio * info2go.com support / Unicel * TELUS Corporation support mms.telusmobility.com, msg.telus.com * add test to check that gem builds correctly as a github gem * 1 bug fix * Iconv utf8 fix - Kai Kai ### 2.1.0 / 2008-07-30 (Dr. Gibbons – Birthday expert and Murderface expert) * 1 major enhancement: * opens up TMail for improved query method patterned code in MMS2R * 2 minor enhancements: * UK O2 support mediamessaging.o2.co.uk - Jeremy Wilkins * Write non text files with binary bit set on Windows - David Alm * source hosted on github: git clone git://github.com/monde/mms2r.git ### 2.0.5 / 2008-07-17 (Dr. Ralphus Galkensmelter - Psychological death expert) * Deal with Apple Mail multipart/appledouble - jesse dp ### 2.0.4 / 2008-04-28 (Mr. Selatcia - elder member of The Tribunal) * updated mms.vodacom4me.co.za Vodacom South Africa - Vijay Yellapragada * 1nbox.net / Idea cellular 1nbox.net - Vijay Yellapragada * mms.3ireland.ie / 3 Ireland - Vijay Yellapragada * mms.alltel.com / Alltel (reverted message.alltel.com) - Vijay Yellapragada * mms.mobileiam.ma / Maroc Telecom - Vijay Yellapragada * mms.mtn.co.za / MTM South Africa - Vijay Yellapragada * rci.rogers.com / Rogers of Canada - Vijay Yellapragada * mmsreply.t-mobile.co.uk / T-Mobile UK - Vijay Yellapragada * waw.plspictures.com / PLSPICTURES.COM mms hosting service ### 2.0.3 / 2008-04-15 (Enter Taxman - The 1040 MMS Form) * fix case when part is image/jpeg declared 'application/octet-stream' * trim dangling image/jpeg text from blackberry messages * file extensions added to filenames that are missing extensions in part headers * anonymize images in fixtures to reduce gem size * T-Mobile update - jesse dp * AT&T/T-Mobile Blackberrry update - Dave Myron ### 2.0.2 / 2008-02-22 (The Jomfru Brothers - proprietors of diefordethklok.com) * added support for mms.vodacom4me.co.za Vodacom South Africa - Jason Haruska * added support for bellsouth.net - Jason Haruska * added support for mms.mycricket.com * Improved Blackberry and iPhone suport - Jason Haruska * added :number key to configuration to provide rules for specifying alternative phone number location * return sender's phone number for mobile.indosat.net.id * return sender's phone number for mms.luxgsm.lu * return sender's phone number for mms.vodacom4me.co.za ### 2.0.1 / 2008-02-08 (Professor Jerry Gustav Munndig - Child control expert) * strip out common blackberry and iPhone signatures * handle carriers that use external mail services such as Yahoo! as the From address * Add support for mobile.indosat.net.id (and yahoo.co.id) - Jason Haruska * Add support for sms.sasktel.com - Jason Haruska ### 2.0.0 / 2008-01-23 (Skwisgaar Skwigelf - fastest guitarist alive) * added support for pxt.vodafone.net.nz PXT New Zealand * added support for mms.o2online.de O2 Germany * added support for orangemms.net Orange UK * added support for txt.att.net AT&T * added support for mms.luxgsm.lu LUXGSM S.A. * added support for mms.netcom.no NetCom (Norway) * added support for mms.three.co.uk Hutchison 3G UK Ltd * removed deprecated #get_number use #number * removed deprecated #get_subject use #subject * removed deprecated #get_body use #body * removed deprecated #get_media use #default_media * removed deprecated #get_text use #default_text * removed deprecated #get_attachment use #attachment * fixed error when Sprint content server responds 500 * better yaml configs * moved TMail dependency from Rails ActionMailer SVN to 'official' Gem * ::new greedily processes MMS unless otherwise specified as an initialize option :process => :lazy * logger moved to initialize option :logger => some_logger * testing using mocks and stubs instead of duck raped Net::HTTP * fixed typo in name of method #attachement to #attachment * fixed broken downloading of Sprint videos ### 1.1.12 / 2007-10-21 (Dr. Ronald von Moldenberg - Endorsement specialist) * fetch original images from Sprint content server (Layton Wedgeworth) * ignore Sprint messages when requested content has been purged from their content server ### 1.1.11 / 2007-10-20 (Dr. Armand Skagerakk Frederickshaven - Mythology expert) * minor fix for attachment_fu where it might call #path on the cgi temp file that is returned by get_attachment * renamed a_t_t_media.rb to att_media.rb to make it autotest happy * masthead.jpg misplaced in mms2r_t_mobile_media_ignore.yml (Layton Wedgeworth) * overridden SprintMedia#process failed to accept block (Layton Wedgeworth) * added method_deprecated to help mark methods that are going to be deprecated in preparation of 1.2.x release * #get_number marked deprecated, use #number instead * #get_subject marked deprecated, use #subject instead * #get_body marked deprecated, use #body instead * #get_text marked deprecated, use #default_text instead * #get_attachment marked deprecated, use #attachment instead * #get_media marked deprecated, use #default_media instead ### 1.1.10 / 2007-09-30 (Face Bones) * fixed a case for a nil match on From in the create method (Luke Francl) * added support for Alltel message.alltel.com (Ben Wood) ### 1.1.9 / 2007-09-08 (Rebecca Nightrod - controlling girlfriend of Nathan Explosion) * fixed broken support for act_as_attachment and attachment_fu ### 1.1.8 / 2007-09-08 (James Grishnack - Head of Behemoth Productions, producer of Blood Ocean) * Added support for Orange of France, Orange orange.fr (Julian Biard) * purge in the process block removed, purge must be called explicitly after processing to clean up extracted temporary media files. ### 1.1.7 / 2007-08-25 (Adam Nergal, friend of Skwisgaar, but not Pickles) * Added support for Orange of Poland, Orange mmsemail.orange.pl (Zbigniew Sobiecki) * Cleaned up documentation modifiers * Cleaned out non-Ruby code idioms ### 1.1.6 / 2007-08-11 (Mustakrakish, the Lake Troll part 2) * Redo of release mistake of 1.1.5 ### 1.1.5 / 2007-08-11 (Mustakrakish, the Lake Troll) * AT&T => mms.att.net not clearing out default "multimedia message" subject to nil (Will Jessup) * Ignore case on default subject for all carriers in corresponding conf/mms2r_XXX_media_subject.yml ### 1.1.4 / 2007-08-07 (Dr. Rockso) * AT&T => mms.att.net support (thanks Mike Chen and Dave Myron) * get_body returns nil when there is not user text (sorry Will!) ### 1.1.3 / 2007-07-10 (Charles Foster Ofdensen) * Helio support by Will Jessup * get_subject returns nil on default carrier subjects ### 1.1.2 / 2007-06-13 (Dethklok roadie #2) * placed versioned hpricot dependency in Hoe's extra_deps (an attempt to appease firebrigade gods or not cause Gem::RemoteInstallationCancelled whichever you prefer) ### 1.1.1 / 2007-06-11 (Dethklok roadie) * rescue rcov non-dependency in Rakefile to make firebrigade happy ### 1.1.0 / 2007-06-08 (Toki Wartooth) * get_body to return body text (Luke Francl) * get_subject returns "" for default subjects now * default subjects listed in yaml by carrier in conf directory * added granularity to Cingular, Sprint, and Verizon carrier services (Will Jessup) * refactored Sprint instance to process all media (Will Jessup + Mike) * optimized text transformations (Will Jessup) * properly handle ISO-8859-1 and UTF-8 text (Will Jessup) * autotest powers activate! (ZenTest autotest discovery enabled) * configuration file ignores, transforms, and subjects all store Regexp's * Put vendor Text::Format & TMail::Mail as an external subversion dependency to the 1.2 stable branch of Rails ActionMailer * added get_number method to return the phone number associated with this MMS * get_media and get_text attachment_fu helper return the largest piece of media of that type if the more than one exits in the media (Luke Francl) * added block support to process() method (Shane Vitarana) ### 1.0.7 / 2007-04-27 (Senator Stampingston) * patch submitted by Luke Francl * added a get_subject method that returns nil when any MMS has a default carrier subject * get_subject returns nil for '', 'Multimedia message', '(no subject)', 'You have new Picture Mail!' ### 1.0.6 / 2007-04-24 (Pickles the Drummer) * patch submitted by Luke Francl * added support for mms.dobson.net (Dobson aka Cellular One) (Luke) * DRY'd up unit tests (Luke) * added get_media instance method that returns first video or image as File (Luke) * File from get_media can be used by/with attachment_fu (Luke) * added get_text instance method that returns first non advertising text * File from get_text can be used by/with attachment_fu ### 1.0.5 / 2007-04-10 (William Murderface) * patch submitted by Luke Francl * made ignore_media? start its text check from the start of the file (Luke) * added new text transform for Verizon messages (Luke) * updated Nextel ignore conf (Luke) * added additional samples and tests for T-Mobile & Verizon (Luke) * cleaned up MMS2R::Media documentation * added Sprint broken image test for when media goes stale on their content server * fixed teardown typo in lots of plases * added tests for 4 three samples of unique variants of Sprint/Nextel text * 100% test coverage! ### 1.0.4 / 2007-04-09 (Metalocalypse) * fix teardown in test_mms2r_sprint.rb (shanesbrain.net) * clean up Net::HTTP in MMS2R::SprintMedia (shanesbrain.net) * added accessor MMS2R::Media.media_dir * fixed a nil issue with underlying tmp working dir * added exception handling around Net::HTTP in MMS2R::SprintMedia ### 1.0.3 / 2007-04-05 (Paper Cut) * Cleaned up packaging and errors in example found by Shane V. http://shanesbrain.net/ ### 1.0.2 / 2007-03-07 * Reorganized tests and fixtures * Added carriers: * Cingular => cingularme.com * Nextel => messaging.nextel.com * Verizon => vtext.com ### 1.0.1 / 2007-03-07 * Flubbed RubyForge release ... do not use this. ### 1.0.0 / 2007-03-06 * Birthday! * AT&T/Cingular => mmode.com * Cingular => mms.mycingular.com * Sprint => pm.sprint.com * Sprint => messaging.sprintpcs.com * T-Mobile => tmomail.net * Verizon => vzwpix.com diff --git a/lib/mms2r.rb b/lib/mms2r.rb index 1a8b044..b02cb6a 100644 --- a/lib/mms2r.rb +++ b/lib/mms2r.rb @@ -1,131 +1,131 @@ #-- # Copyright (c) 2007-2012 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ module MMS2R ## # A hash of MMS2R processors keyed by MMS carrier domain. CARRIERS = {} ## # Registers a class as a processor for a MMS domain. Should only be # used in special cases such as MMS2R::Media::Sprint for 'pm.sprint.com' def self.register(domain, processor_class) MMS2R::CARRIERS[domain] = processor_class end ## # A hash of file extensions for common mime-types EXT = { 'text/plain' => 'text', 'text/plain' => 'txt', 'text/html' => 'html', 'image/png' => 'png', 'image/gif' => 'gif', 'image/jpeg' => 'jpeg', 'image/jpeg' => 'jpg', 'video/quicktime' => 'mov', 'video/3gpp2' => '3g2' } class MMS2R::Media ## # Spoof User-Agent, primarily for the Sprint CDN USER_AGENT = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.120 Safari/535.2" end ## # Simple convenience function to make it a one-liner: # MMS2R.parse raw_mail or # MMS2R.parse File.load(file) # MMS2R.parse File.load(path_to_file) # Combined w/ the method_missing delegation, this should behave as an enhanced Mail object, more or less. def self.parse thing, options = {} mail = case when File.exist?(thing); Mail.new(open(thing).read) when thing.respond_to?(:read); Mail.new(thing.read) else Mail.new(thing) end MMS2R::Media.new(mail, options) end ## # Compare original MMS2R results with original mail values and other metrics. # # Takes a file path, mms2r object, mail object, or mail text blob. def self.debug(thing, options = {}) mms = case thing when MMS2R::Media; thing when Mail::Message; MMS2R::Media.new(thing, options) else self.parse(thing, options) end <<OUT #{'-' * 80} original mail #{'from:'.ljust(15)} #{mms.mail.from} #{'to:'.ljust(15)} #{mms.mail.to} #{'subject:'.ljust(15)} #{mms.mail.subject} mms2r #{'from:'.ljust(15)} #{mms.from} #{'to:'.ljust(15)} #{mms.to} #{'subject:'.ljust(15)} #{mms.subject} #{'number:'.ljust(15)} #{mms.number} default media #{mms.default_media.inspect} default text #{mms.default_text.inspect} #{mms.default_text.read if mms.default_text} all plain text #{(mms.media['text/plain']||[]).each {|t| open(t).read}.join("\n\n")} media hash #{mms.media.inspect} OUT end end %W{ yaml mail fileutils pathname tmpdir yaml digest/sha1 exifr }.each do |g| begin require g rescue LoadError require 'rubygems' require g end end -if RUBY_VERSION >= "1.9" +if RUBY_VERSION == "1.9" && RUBY_VERSION < "2.0" begin require 'psych' YAML::ENGINE.yamler= 'syck' if defined?(YAML::ENGINE) rescue LoadError end end require File.join(File.dirname(__FILE__), 'ext/mail') require File.join(File.dirname(__FILE__), 'ext/object') require File.join(File.dirname(__FILE__), 'mms2r/media') require File.join(File.dirname(__FILE__), 'mms2r/media/sprint') MMS2R.register('pm.sprint.com', MMS2R::Media::Sprint) diff --git a/lib/mms2r/version.rb b/lib/mms2r/version.rb index c4e42fd..eade85b 100644 --- a/lib/mms2r/version.rb +++ b/lib/mms2r/version.rb @@ -1,25 +1,25 @@ module MMS2R class Version def self.major 3 end def self.minor 9 end def self.patch - 1 + 2 end def self.pre nil end def self.to_s [major, minor, patch, pre].compact.join('.') end end end diff --git a/test/test_helper.rb b/test/test_helper.rb index df698cf..3573adf 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,103 +1,103 @@ if ENV['COVERAGE'] require 'simplecov' SimpleCov.start do add_filter 'test' end end # do it like rake http://ozmm.org/posts/do_it_like_rake.html -%W{ test/unit set net/http net/https pp tempfile mocha }.each do |g| +%W{ test/unit set net/http net/https pp tempfile mocha/setup }.each do |g| begin require g rescue LoadError require 'rubygems' require g end end require File.join(File.expand_path(File.dirname(__FILE__)), '..', 'lib', 'mms2r') module MMS2R module TestHelper def assert_file_size(file, size) assert_not_nil(file, "file was nil") assert(File::exist?(file), "file #{file} does not exist") assert(File::size(file) == size, "file #{file} is #{File::size(file)} bytes, not #{size} bytes") end def fixture(file) File.join(File.expand_path(File.dirname(__FILE__)), "fixtures", file) end def fixture_data(name) open(fixture(name)).read end def mail_fixture(file) fixture(file) end def mail(name) Mail.read(mail_fixture(name)) end def smart_phone_mock(make_text = 'Apple', model_text = 'iPhone', software_text = nil, jpeg = true) mail = stub('mail', :from => ['[email protected]'], :return_path => '<[email protected]>', :message_id => 'abcd0123', :multipart? => true, :header => {}) part = stub('part', :part_type? => "image/#{jpeg ? 'jpeg' : 'tiff'}", :body => Mail::Body.new('abc'), :multipart? => false, :filename => "foo.#{jpeg ? 'jpg' : 'tif'}" ) mail.stubs(:parts).returns([part]) exif = stub('exif', :make => make_text, :model => model_text, :software => software_text) if jpeg EXIFR::JPEG.expects(:new).at_least_once.returns(exif) else EXIFR::TIFF.expects(:new).at_least_once.returns(exif) end mail end end end class Hash def except(*keys) rejected = Set.new(respond_to?(:convert_key) ? keys.map { |key| convert_key(key) } : keys) reject { |key,| rejected.include?(key) } end def except!(*keys) replace(except(*keys)) end end # monkey patch Net::HTTP so un caged requests don't go over the wire module Net #:nodoc: class HTTP #:nodoc: alias :old_net_http_request :request alias :old_net_http_connect :connect def request(req, body = nil, &block) uri_cls = use_ssl ? URI::HTTPS : URI::HTTP query = req.path.split('?',2) opts = {:host => self.address, :port => self.port, :path => query[0]} opts[:query] = query[1] if query[1] uri = uri_cls.build(opts) raise ArgumentError.new("#{req.method} method to #{uri} not being handled in testing") end def connect raise ArgumentError.new("connect not being handled in testing") end end end
monde/mms2r
b8422f7956dee09f4de09dfda277deb5d7852fce
Remove hard rake dependency and release version 3.9.1.
diff --git a/Gemfile.lock b/Gemfile.lock index 02c06fd..3cf6db1 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,48 +1,48 @@ PATH remote: . specs: - mms2r (3.8.2) + mms2r (3.9.1) exifr (>= 1.0.3) json (>= 1.6.0) mail (>= 2.4.0) nokogiri (>= 1.5.0) - rake (= 0.9.2.2) + rake GEM remote: https://rubygems.org/ specs: exifr (1.1.3) - i18n (0.6.0) - json (1.7.3) + i18n (0.6.1) + json (1.7.5) mail (2.4.4) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) metaclass (0.0.1) mime-types (1.19) - mocha (0.11.4) + mocha (0.13.0) metaclass (~> 0.0.1) - multi_json (1.3.5) + multi_json (1.3.7) nokogiri (1.5.5) polyglot (0.3.3) - rake (0.9.2.2) + rake (10.0.1) rdoc (3.12) json (~> 1.4) - simplecov (0.6.4) + simplecov (0.7.1) multi_json (~> 1.0) - simplecov-html (~> 0.5.3) - simplecov-html (0.5.3) - test-unit (2.4.8) - treetop (1.4.10) + simplecov-html (~> 0.7.1) + simplecov-html (0.7.1) + test-unit (2.5.2) + treetop (1.4.12) polyglot polyglot (>= 0.3.1) PLATFORMS ruby DEPENDENCIES mms2r! mocha rdoc simplecov test-unit diff --git a/History.txt b/History.txt index 16467a3..97ff367 100644 --- a/History.txt +++ b/History.txt @@ -1,461 +1,466 @@ +### 3.9.1 / 2012-11-15 (#216 - Klokateer afflicted with dwarfism) + +* 1 minor enhancement + * remove rake 0.9.2.2 dependency + ### 3.9.0 / 2012-10-18 (Jean-Pierre - A French chef) * 1 minor enhancement * refined character encoding capability with 1.8 rubies and 1.9 rubies. ### 3.8.2 / 2012-08-21 (Seth - Pickles The Drummer's brother) * 2 minor enhancements * Broadened handling of generic "Sent from" footers in smart phones * Add ability to process HTC Sensation footer ### 3.8.1 / 2012-07-22 (Calvert - Pickles The Drummer's dad) * 1 major enhancement * Support for Cincinnati Bell - mms.gocbw.com - James McGrath ### 3.8.0 / 2012-07-04 (Dr. Donald Gorfield – Comedy specialist) * 1 major enhancement * Handle MMS from Sprint that have their media attached rather than CDN'd ### 3.7.1 / 2012-06-04 (Abrigail Remeltindtdrinc - The Record Cleaner) * 2 minor enhancements * Improve processing of Sprint media - James McGrath * RDoc format documentation - James McGrath ### 3.7.0 / 2012-05-31 (The Teenager - Edgar's brother via Eric's face) * 2 major enhancements * Improve processing of Sprint media - James McGrath * Remove Hoe and gemcutter dependencies ### 3.6.4 / 2012-04-22 (Molly - Pickles' mother) * 1 minor enhancement * strip a variation of the iphone default footer ### 3.6.3 / 2012-03-25 (Dethklok Minute Host - host of The Dethklok Minute) * 1 minor enhancement * strip Windows phone default footer ### 3.6.2 / 2012-02-12 (Mr. Gojira - Owner Mr. Gojira's Driving School - retake driver's exam) * 1 minor enhancement * Change user agent given to Sprint so it returns a properly sized image. ### 3.6.1 / 2012-02-11 (Mr. Gojira - Owner Mr. Gojira's Driving School) * 1 minor enhancement * use Net::HTTP#get2 to fetch Sprint content ### 3.6.0 / 2012-01-19 (Agent 216 - assassin, master of infiltration and sabotage) * 1 major enhancement * Ruby 1.8.7, 1.9.2, and 1.9.3 compatible * 1 bug fix * A fix for the utf-8 encoding issue with ruby 1.9.2 - minimul / Christian ### 3.5.1 / 2011-12-11 (Mashed Potato Johnson - oldest living blues guitarist in the world) * 1 bug fix * A fix for the utf-8 encoding issue with ruby 1.9.2 - James McGrath ### 3.5.0 / 2011-12-01 (Dr. Milminiman Lamilim Swimwambli - Marriage expert) * 1 major bug fix * In Ruby 1.9.X MMS2R::Media::Sprint was not fetching content from Sprint's CDN correctly because the implementation of Net::HTTP in 1.9.X passes a User-Agent header of "Ruby" to which Sprint responds with a fake 500 - with help from James McGrath ### 3.4.1 / 2011-11-06 (Fatty Ding-Dongs, Dethklok foster child) * 2 major enhancements * Additional means to detect android, iphone, motorola, nokia, palm handsets * Additional known SMS/MMS domains mm.att.net, labwig.net, cdma.sasktel.com ### 3.4.0 / 2011-10-31 (Serveta Skwigelf, Skwisgaar's hot mom) * 2 major enhancements * regexp's in yaml configs are store as a ruby regexp and not a string that is evaled. * character encoding capability with 1.8 rubies and 1.9 rubies. ### 3.3.1 / 2011-01-01 (Reverend Aslaug Wartooth (deceased), Toki's dad) * 2 minor enhancements * new method #default_html returns the default html attachment * #body will return the default plain text, or default stripped html text ### 3.3.0 / 2010-12-31 (Charles Foster Offdensen - CFO, dethklok) * 1 major enhancement * MMS2R::Media::Sprint is now a module that is extended in for processing Sprint content rather than being child class of MMS2R::Media Extension is the strategy to use for overwriting template methods now * 1 minor enhancement * process new Sprint subject - Jason Hooper * new SaskTel mms/sms domain alias sasktel.com * new Virgin Mobile mms/sms domain alias yrmobl.com ### 3.2.0 / 2010-08-17 (Antonio "Tony" DiMarco Thunderbottom - bassist) * 3 minor enhancements * updated readme with latest sites known to use mms2r * bundler assimilated * loading rubygems only if it's required, like rake ### 3.1.0 / 2010-07-09 (Dick "Magic Ears" Knubbler - music producer) * 8 minor enhancements * Detects additional Bell/AT&T domain sbcglobal.net as a handset * Detects additional Virgin mobile domains pixmbl.com vmobl.com as a handset * Expanded mobile phone detection for handset makers by : Casio, Google Nexus One, LG Electronics, Motorola, Pantech, Qualcom, Samsung, Sprint, UTStarCom * EXIF Reader (exifr) is integral to MMS2R and is now a required gem * upgrade Mail to 2.2.5 * depend on latest gems * corrected example - Jason Hooper * added As Seen On The Internet to README that lists sites known to be using MMS2R in some fashion ### 3.0.1 / 2010-03-28 (Lavona Succuboso - leader of "Succuboso Explosion") * 1 minor enhancement * support for U.S. Cellular ### 3.0.0 / 2010-02-24 (General Crozier - Chairman of the Joint Chiefs of Staff) * 1 new feature * dependence upon Mail gem rather than TMail gem ### 2.4.1 / 2010-02-07 (Vater Orlaag - political and spiritual specialist) * 3 minor enhancements * make sure filename is free of new lines - laurynas * recognize HTC HERO200 as a smart phone * recognize HTC Eris as a smart phone ### 2.4.0 / 2009-12-20 (Dr. Nanemiltred Philtendrieden - specialist on celebrity death) * 1 new feature * replace Hpricot with Nokogiri for html parsing of Sprint data * 3 minor enhancements * smartphone identities stored in conf/mms2r_media.yml * identify Motorola Droid as a smartphone * identify T-Mobile Dash as a smartphone * use uuidtools for naming temp directories - kbaum ### 2.3.0 / 2009-08-30 (Snakes 'n' Barrels Greatest Hits) * 5 new features * detect smartphone status/type based on model metadata from jpeg and tiff exif data using exifr gem, access exif data with MMS2R::Media#exif * make MMS2R Rails gem packaging friendly with an init.rb - Scott Taylor, smtlaissezfaire * delegate missing methods to mms2r's tmail object so that mms2r behaves as if it were a tmail object - Sai Emrys, saizai * default_media can return an attachment of application content type - Brendan Lim, brendanlim * MMS2R.parse(raw_mail) convenience class method that parses and returns an mms2r from a mail file - saizai * 4 minor enhancements * make examples more 'mail' specific to enforce the fact that an mms is a multipart email - saizai * update for text in vzwpix.com default carrier message * detecting smartphone (blackberries and iphones for now) is more versatile from reading mail headers * expanded filtering of carrier advertising text in mms from smartphones ### 2.2.0 / 2009-01-04 (Rikki Kixx - owner of a franchise of rehab centers) * 3 new features * MMS2R::Media#is_mobile? best guess if the sender was a mobile device * MMS2R::Media#device_type? best guess of the mobile device type. Simple heuristics thus far for :blackberry :iphone :handset :unknown could be expanded for exif probing or additinal shifting of mail header * from array in conf/from.yml to provide granularity to determine carrier domain (caused by tmo.blackberry.net) * 4 minor enhancements * support for Virgin Canada messaging service vmobile.ca * support for text service messaging.sprintpcs.com * additional BlackBerry coverage from T-Mobile tmo.blackberry.net provider * legacy support for mobile.mycingular.com, pics.cingularme.com * 3 bug fixes * iPhone default subject - jesse dp http://rubyforge.org/tracker/?func=detail&atid=11789&aid=22951&group_id=3065 * add sprintpcs.com to pm.sprint.com aliases * fix OS X long filename issues - Matt Conway ### 2.1.3 / 2008-11-06 (Dr. Ramonolith Chesterfield - Military pharmaceutical psychotropic drug manufacturing expert * 1 minor enhancement * added mms.ae support ### 2.1.2 / 2008-10-21 (Toki's mom, Anja Wartooth) * 2 minor enhancments * Sprint subject update - jesse dp * Virgin Mobile support vmpix.com ### 2.1.1 / 2008-09-24 (Lavona Succuboso, Nathan Explosion uber-groupie) * 4 minor enhancments * Bell Canada support txt.bell.ca - Matt Conway / Snap My Life - http://github.com/wr0ngway, http://github.com/sml * Unicel support unicel.com - Michael DelGaudio * info2go.com support / Unicel * TELUS Corporation support mms.telusmobility.com, msg.telus.com * add test to check that gem builds correctly as a github gem * 1 bug fix * Iconv utf8 fix - Kai Kai ### 2.1.0 / 2008-07-30 (Dr. Gibbons – Birthday expert and Murderface expert) * 1 major enhancement: * opens up TMail for improved query method patterned code in MMS2R * 2 minor enhancements: * UK O2 support mediamessaging.o2.co.uk - Jeremy Wilkins * Write non text files with binary bit set on Windows - David Alm * source hosted on github: git clone git://github.com/monde/mms2r.git ### 2.0.5 / 2008-07-17 (Dr. Ralphus Galkensmelter - Psychological death expert) * Deal with Apple Mail multipart/appledouble - jesse dp ### 2.0.4 / 2008-04-28 (Mr. Selatcia - elder member of The Tribunal) * updated mms.vodacom4me.co.za Vodacom South Africa - Vijay Yellapragada * 1nbox.net / Idea cellular 1nbox.net - Vijay Yellapragada * mms.3ireland.ie / 3 Ireland - Vijay Yellapragada * mms.alltel.com / Alltel (reverted message.alltel.com) - Vijay Yellapragada * mms.mobileiam.ma / Maroc Telecom - Vijay Yellapragada * mms.mtn.co.za / MTM South Africa - Vijay Yellapragada * rci.rogers.com / Rogers of Canada - Vijay Yellapragada * mmsreply.t-mobile.co.uk / T-Mobile UK - Vijay Yellapragada * waw.plspictures.com / PLSPICTURES.COM mms hosting service ### 2.0.3 / 2008-04-15 (Enter Taxman - The 1040 MMS Form) * fix case when part is image/jpeg declared 'application/octet-stream' * trim dangling image/jpeg text from blackberry messages * file extensions added to filenames that are missing extensions in part headers * anonymize images in fixtures to reduce gem size * T-Mobile update - jesse dp * AT&T/T-Mobile Blackberrry update - Dave Myron ### 2.0.2 / 2008-02-22 (The Jomfru Brothers - proprietors of diefordethklok.com) * added support for mms.vodacom4me.co.za Vodacom South Africa - Jason Haruska * added support for bellsouth.net - Jason Haruska * added support for mms.mycricket.com * Improved Blackberry and iPhone suport - Jason Haruska * added :number key to configuration to provide rules for specifying alternative phone number location * return sender's phone number for mobile.indosat.net.id * return sender's phone number for mms.luxgsm.lu * return sender's phone number for mms.vodacom4me.co.za ### 2.0.1 / 2008-02-08 (Professor Jerry Gustav Munndig - Child control expert) * strip out common blackberry and iPhone signatures * handle carriers that use external mail services such as Yahoo! as the From address * Add support for mobile.indosat.net.id (and yahoo.co.id) - Jason Haruska * Add support for sms.sasktel.com - Jason Haruska ### 2.0.0 / 2008-01-23 (Skwisgaar Skwigelf - fastest guitarist alive) * added support for pxt.vodafone.net.nz PXT New Zealand * added support for mms.o2online.de O2 Germany * added support for orangemms.net Orange UK * added support for txt.att.net AT&T * added support for mms.luxgsm.lu LUXGSM S.A. * added support for mms.netcom.no NetCom (Norway) * added support for mms.three.co.uk Hutchison 3G UK Ltd * removed deprecated #get_number use #number * removed deprecated #get_subject use #subject * removed deprecated #get_body use #body * removed deprecated #get_media use #default_media * removed deprecated #get_text use #default_text * removed deprecated #get_attachment use #attachment * fixed error when Sprint content server responds 500 * better yaml configs * moved TMail dependency from Rails ActionMailer SVN to 'official' Gem * ::new greedily processes MMS unless otherwise specified as an initialize option :process => :lazy * logger moved to initialize option :logger => some_logger * testing using mocks and stubs instead of duck raped Net::HTTP * fixed typo in name of method #attachement to #attachment * fixed broken downloading of Sprint videos ### 1.1.12 / 2007-10-21 (Dr. Ronald von Moldenberg - Endorsement specialist) * fetch original images from Sprint content server (Layton Wedgeworth) * ignore Sprint messages when requested content has been purged from their content server ### 1.1.11 / 2007-10-20 (Dr. Armand Skagerakk Frederickshaven - Mythology expert) * minor fix for attachment_fu where it might call #path on the cgi temp file that is returned by get_attachment * renamed a_t_t_media.rb to att_media.rb to make it autotest happy * masthead.jpg misplaced in mms2r_t_mobile_media_ignore.yml (Layton Wedgeworth) * overridden SprintMedia#process failed to accept block (Layton Wedgeworth) * added method_deprecated to help mark methods that are going to be deprecated in preparation of 1.2.x release * #get_number marked deprecated, use #number instead * #get_subject marked deprecated, use #subject instead * #get_body marked deprecated, use #body instead * #get_text marked deprecated, use #default_text instead * #get_attachment marked deprecated, use #attachment instead * #get_media marked deprecated, use #default_media instead ### 1.1.10 / 2007-09-30 (Face Bones) * fixed a case for a nil match on From in the create method (Luke Francl) * added support for Alltel message.alltel.com (Ben Wood) ### 1.1.9 / 2007-09-08 (Rebecca Nightrod - controlling girlfriend of Nathan Explosion) * fixed broken support for act_as_attachment and attachment_fu ### 1.1.8 / 2007-09-08 (James Grishnack - Head of Behemoth Productions, producer of Blood Ocean) * Added support for Orange of France, Orange orange.fr (Julian Biard) * purge in the process block removed, purge must be called explicitly after processing to clean up extracted temporary media files. ### 1.1.7 / 2007-08-25 (Adam Nergal, friend of Skwisgaar, but not Pickles) * Added support for Orange of Poland, Orange mmsemail.orange.pl (Zbigniew Sobiecki) * Cleaned up documentation modifiers * Cleaned out non-Ruby code idioms ### 1.1.6 / 2007-08-11 (Mustakrakish, the Lake Troll part 2) * Redo of release mistake of 1.1.5 ### 1.1.5 / 2007-08-11 (Mustakrakish, the Lake Troll) * AT&T => mms.att.net not clearing out default "multimedia message" subject to nil (Will Jessup) * Ignore case on default subject for all carriers in corresponding conf/mms2r_XXX_media_subject.yml ### 1.1.4 / 2007-08-07 (Dr. Rockso) * AT&T => mms.att.net support (thanks Mike Chen and Dave Myron) * get_body returns nil when there is not user text (sorry Will!) ### 1.1.3 / 2007-07-10 (Charles Foster Ofdensen) * Helio support by Will Jessup * get_subject returns nil on default carrier subjects ### 1.1.2 / 2007-06-13 (Dethklok roadie #2) * placed versioned hpricot dependency in Hoe's extra_deps (an attempt to appease firebrigade gods or not cause Gem::RemoteInstallationCancelled whichever you prefer) ### 1.1.1 / 2007-06-11 (Dethklok roadie) * rescue rcov non-dependency in Rakefile to make firebrigade happy ### 1.1.0 / 2007-06-08 (Toki Wartooth) * get_body to return body text (Luke Francl) * get_subject returns "" for default subjects now * default subjects listed in yaml by carrier in conf directory * added granularity to Cingular, Sprint, and Verizon carrier services (Will Jessup) * refactored Sprint instance to process all media (Will Jessup + Mike) * optimized text transformations (Will Jessup) * properly handle ISO-8859-1 and UTF-8 text (Will Jessup) * autotest powers activate! (ZenTest autotest discovery enabled) * configuration file ignores, transforms, and subjects all store Regexp's * Put vendor Text::Format & TMail::Mail as an external subversion dependency to the 1.2 stable branch of Rails ActionMailer * added get_number method to return the phone number associated with this MMS * get_media and get_text attachment_fu helper return the largest piece of media of that type if the more than one exits in the media (Luke Francl) * added block support to process() method (Shane Vitarana) ### 1.0.7 / 2007-04-27 (Senator Stampingston) * patch submitted by Luke Francl * added a get_subject method that returns nil when any MMS has a default carrier subject * get_subject returns nil for '', 'Multimedia message', '(no subject)', 'You have new Picture Mail!' ### 1.0.6 / 2007-04-24 (Pickles the Drummer) * patch submitted by Luke Francl * added support for mms.dobson.net (Dobson aka Cellular One) (Luke) * DRY'd up unit tests (Luke) * added get_media instance method that returns first video or image as File (Luke) * File from get_media can be used by/with attachment_fu (Luke) * added get_text instance method that returns first non advertising text * File from get_text can be used by/with attachment_fu ### 1.0.5 / 2007-04-10 (William Murderface) * patch submitted by Luke Francl * made ignore_media? start its text check from the start of the file (Luke) * added new text transform for Verizon messages (Luke) * updated Nextel ignore conf (Luke) * added additional samples and tests for T-Mobile & Verizon (Luke) * cleaned up MMS2R::Media documentation * added Sprint broken image test for when media goes stale on their content server * fixed teardown typo in lots of plases * added tests for 4 three samples of unique variants of Sprint/Nextel text * 100% test coverage! ### 1.0.4 / 2007-04-09 (Metalocalypse) * fix teardown in test_mms2r_sprint.rb (shanesbrain.net) * clean up Net::HTTP in MMS2R::SprintMedia (shanesbrain.net) * added accessor MMS2R::Media.media_dir * fixed a nil issue with underlying tmp working dir * added exception handling around Net::HTTP in MMS2R::SprintMedia ### 1.0.3 / 2007-04-05 (Paper Cut) * Cleaned up packaging and errors in example found by Shane V. http://shanesbrain.net/ ### 1.0.2 / 2007-03-07 * Reorganized tests and fixtures * Added carriers: * Cingular => cingularme.com * Nextel => messaging.nextel.com * Verizon => vtext.com ### 1.0.1 / 2007-03-07 * Flubbed RubyForge release ... do not use this. ### 1.0.0 / 2007-03-06 * Birthday! * AT&T/Cingular => mmode.com * Cingular => mms.mycingular.com * Sprint => pm.sprint.com * Sprint => messaging.sprintpcs.com * T-Mobile => tmomail.net * Verizon => vzwpix.com diff --git a/lib/mms2r/version.rb b/lib/mms2r/version.rb index 0a8ef7f..c4e42fd 100644 --- a/lib/mms2r/version.rb +++ b/lib/mms2r/version.rb @@ -1,25 +1,25 @@ module MMS2R class Version def self.major 3 end def self.minor 9 end def self.patch - 0 + 1 end def self.pre nil end def self.to_s [major, minor, patch, pre].compact.join('.') end end end diff --git a/mms2r.gemspec b/mms2r.gemspec index 23e4244..9a3c56a 100644 --- a/mms2r.gemspec +++ b/mms2r.gemspec @@ -1,33 +1,33 @@ $:.unshift File.expand_path("../lib", __FILE__) require "mms2r/version" Gem::Specification.new do |gem| - gem.add_dependency 'rake', ['= 0.9.2.2'] + gem.add_dependency 'rake' gem.add_dependency 'nokogiri', ['>= 1.5.0'] gem.add_dependency 'mail', ['>= 2.4.0'] gem.add_dependency 'exifr', ['>= 1.0.3'] gem.add_dependency 'json', ['>= 1.6.0'] gem.add_development_dependency "rdoc" gem.add_development_dependency "simplecov" gem.add_development_dependency 'test-unit' gem.add_development_dependency 'mocha' gem.name = "mms2r" gem.version = MMS2R::Version.to_s gem.platform = Gem::Platform::RUBY gem.authors = ["Mike Mondragon"] gem.email = ["[email protected]"] gem.homepage = "https://github.com/monde/mms2r" gem.summary = "Extract user media from MMS (and not carrier cruft)" gem.description = "MMS2R is a library that decodes the parts of a MMS message to disk while stripping out advertising injected by the mobile carriers." gem.rubyforge_project = "mms2r" gem.rubygems_version = ">= 1.3.6" gem.files = `git ls-files`.split("\n") gem.require_path = ['lib'] gem.rdoc_options = ["--main", "README.rdoc"] gem.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.TMail.txt", "README.rdoc"] gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") end
monde/mms2r
764a62abd845e9c794e159c1565b79e9ab9ae1bb
refined character encoding capability with 1.8 rubies and 1.9 rubies.
diff --git a/History.txt b/History.txt index 32744d5..16467a3 100644 --- a/History.txt +++ b/History.txt @@ -1,456 +1,461 @@ +### 3.9.0 / 2012-10-18 (Jean-Pierre - A French chef) + +* 1 minor enhancement + * refined character encoding capability with 1.8 rubies and 1.9 rubies. + ### 3.8.2 / 2012-08-21 (Seth - Pickles The Drummer's brother) * 2 minor enhancements * Broadened handling of generic "Sent from" footers in smart phones * Add ability to process HTC Sensation footer ### 3.8.1 / 2012-07-22 (Calvert - Pickles The Drummer's dad) * 1 major enhancement * Support for Cincinnati Bell - mms.gocbw.com - James McGrath ### 3.8.0 / 2012-07-04 (Dr. Donald Gorfield – Comedy specialist) * 1 major enhancement * Handle MMS from Sprint that have their media attached rather than CDN'd ### 3.7.1 / 2012-06-04 (Abrigail Remeltindtdrinc - The Record Cleaner) * 2 minor enhancements * Improve processing of Sprint media - James McGrath * RDoc format documentation - James McGrath ### 3.7.0 / 2012-05-31 (The Teenager - Edgar's brother via Eric's face) * 2 major enhancements * Improve processing of Sprint media - James McGrath * Remove Hoe and gemcutter dependencies ### 3.6.4 / 2012-04-22 (Molly - Pickles' mother) * 1 minor enhancement * strip a variation of the iphone default footer ### 3.6.3 / 2012-03-25 (Dethklok Minute Host - host of The Dethklok Minute) * 1 minor enhancement * strip Windows phone default footer ### 3.6.2 / 2012-02-12 (Mr. Gojira - Owner Mr. Gojira's Driving School - retake driver's exam) * 1 minor enhancement * Change user agent given to Sprint so it returns a properly sized image. ### 3.6.1 / 2012-02-11 (Mr. Gojira - Owner Mr. Gojira's Driving School) * 1 minor enhancement * use Net::HTTP#get2 to fetch Sprint content ### 3.6.0 / 2012-01-19 (Agent 216 - assassin, master of infiltration and sabotage) * 1 major enhancement * Ruby 1.8.7, 1.9.2, and 1.9.3 compatible * 1 bug fix * A fix for the utf-8 encoding issue with ruby 1.9.2 - minimul / Christian ### 3.5.1 / 2011-12-11 (Mashed Potato Johnson - oldest living blues guitarist in the world) * 1 bug fix * A fix for the utf-8 encoding issue with ruby 1.9.2 - James McGrath ### 3.5.0 / 2011-12-01 (Dr. Milminiman Lamilim Swimwambli - Marriage expert) * 1 major bug fix * In Ruby 1.9.X MMS2R::Media::Sprint was not fetching content from Sprint's CDN correctly because the implementation of Net::HTTP in 1.9.X passes a User-Agent header of "Ruby" to which Sprint responds with a fake 500 - with help from James McGrath ### 3.4.1 / 2011-11-06 (Fatty Ding-Dongs, Dethklok foster child) * 2 major enhancements * Additional means to detect android, iphone, motorola, nokia, palm handsets * Additional known SMS/MMS domains mm.att.net, labwig.net, cdma.sasktel.com ### 3.4.0 / 2011-10-31 (Serveta Skwigelf, Skwisgaar's hot mom) * 2 major enhancements * regexp's in yaml configs are store as a ruby regexp and not a string that is evaled. * character encoding capability with 1.8 rubies and 1.9 rubies. ### 3.3.1 / 2011-01-01 (Reverend Aslaug Wartooth (deceased), Toki's dad) * 2 minor enhancements * new method #default_html returns the default html attachment * #body will return the default plain text, or default stripped html text ### 3.3.0 / 2010-12-31 (Charles Foster Offdensen - CFO, dethklok) * 1 major enhancement * MMS2R::Media::Sprint is now a module that is extended in for processing Sprint content rather than being child class of MMS2R::Media Extension is the strategy to use for overwriting template methods now * 1 minor enhancement * process new Sprint subject - Jason Hooper * new SaskTel mms/sms domain alias sasktel.com * new Virgin Mobile mms/sms domain alias yrmobl.com ### 3.2.0 / 2010-08-17 (Antonio "Tony" DiMarco Thunderbottom - bassist) * 3 minor enhancements * updated readme with latest sites known to use mms2r * bundler assimilated * loading rubygems only if it's required, like rake ### 3.1.0 / 2010-07-09 (Dick "Magic Ears" Knubbler - music producer) * 8 minor enhancements * Detects additional Bell/AT&T domain sbcglobal.net as a handset * Detects additional Virgin mobile domains pixmbl.com vmobl.com as a handset * Expanded mobile phone detection for handset makers by : Casio, Google Nexus One, LG Electronics, Motorola, Pantech, Qualcom, Samsung, Sprint, UTStarCom * EXIF Reader (exifr) is integral to MMS2R and is now a required gem * upgrade Mail to 2.2.5 * depend on latest gems * corrected example - Jason Hooper * added As Seen On The Internet to README that lists sites known to be using MMS2R in some fashion ### 3.0.1 / 2010-03-28 (Lavona Succuboso - leader of "Succuboso Explosion") * 1 minor enhancement * support for U.S. Cellular ### 3.0.0 / 2010-02-24 (General Crozier - Chairman of the Joint Chiefs of Staff) * 1 new feature * dependence upon Mail gem rather than TMail gem ### 2.4.1 / 2010-02-07 (Vater Orlaag - political and spiritual specialist) * 3 minor enhancements * make sure filename is free of new lines - laurynas * recognize HTC HERO200 as a smart phone * recognize HTC Eris as a smart phone ### 2.4.0 / 2009-12-20 (Dr. Nanemiltred Philtendrieden - specialist on celebrity death) * 1 new feature * replace Hpricot with Nokogiri for html parsing of Sprint data * 3 minor enhancements * smartphone identities stored in conf/mms2r_media.yml * identify Motorola Droid as a smartphone * identify T-Mobile Dash as a smartphone * use uuidtools for naming temp directories - kbaum ### 2.3.0 / 2009-08-30 (Snakes 'n' Barrels Greatest Hits) * 5 new features * detect smartphone status/type based on model metadata from jpeg and tiff exif data using exifr gem, access exif data with MMS2R::Media#exif * make MMS2R Rails gem packaging friendly with an init.rb - Scott Taylor, smtlaissezfaire * delegate missing methods to mms2r's tmail object so that mms2r behaves as if it were a tmail object - Sai Emrys, saizai * default_media can return an attachment of application content type - Brendan Lim, brendanlim * MMS2R.parse(raw_mail) convenience class method that parses and returns an mms2r from a mail file - saizai * 4 minor enhancements * make examples more 'mail' specific to enforce the fact that an mms is a multipart email - saizai * update for text in vzwpix.com default carrier message * detecting smartphone (blackberries and iphones for now) is more versatile from reading mail headers * expanded filtering of carrier advertising text in mms from smartphones ### 2.2.0 / 2009-01-04 (Rikki Kixx - owner of a franchise of rehab centers) * 3 new features * MMS2R::Media#is_mobile? best guess if the sender was a mobile device * MMS2R::Media#device_type? best guess of the mobile device type. Simple heuristics thus far for :blackberry :iphone :handset :unknown could be expanded for exif probing or additinal shifting of mail header * from array in conf/from.yml to provide granularity to determine carrier domain (caused by tmo.blackberry.net) * 4 minor enhancements * support for Virgin Canada messaging service vmobile.ca * support for text service messaging.sprintpcs.com * additional BlackBerry coverage from T-Mobile tmo.blackberry.net provider * legacy support for mobile.mycingular.com, pics.cingularme.com * 3 bug fixes * iPhone default subject - jesse dp http://rubyforge.org/tracker/?func=detail&atid=11789&aid=22951&group_id=3065 * add sprintpcs.com to pm.sprint.com aliases * fix OS X long filename issues - Matt Conway ### 2.1.3 / 2008-11-06 (Dr. Ramonolith Chesterfield - Military pharmaceutical psychotropic drug manufacturing expert * 1 minor enhancement * added mms.ae support ### 2.1.2 / 2008-10-21 (Toki's mom, Anja Wartooth) * 2 minor enhancments * Sprint subject update - jesse dp * Virgin Mobile support vmpix.com ### 2.1.1 / 2008-09-24 (Lavona Succuboso, Nathan Explosion uber-groupie) * 4 minor enhancments * Bell Canada support txt.bell.ca - Matt Conway / Snap My Life - http://github.com/wr0ngway, http://github.com/sml * Unicel support unicel.com - Michael DelGaudio * info2go.com support / Unicel * TELUS Corporation support mms.telusmobility.com, msg.telus.com * add test to check that gem builds correctly as a github gem * 1 bug fix * Iconv utf8 fix - Kai Kai ### 2.1.0 / 2008-07-30 (Dr. Gibbons – Birthday expert and Murderface expert) * 1 major enhancement: * opens up TMail for improved query method patterned code in MMS2R * 2 minor enhancements: * UK O2 support mediamessaging.o2.co.uk - Jeremy Wilkins * Write non text files with binary bit set on Windows - David Alm * source hosted on github: git clone git://github.com/monde/mms2r.git ### 2.0.5 / 2008-07-17 (Dr. Ralphus Galkensmelter - Psychological death expert) * Deal with Apple Mail multipart/appledouble - jesse dp ### 2.0.4 / 2008-04-28 (Mr. Selatcia - elder member of The Tribunal) * updated mms.vodacom4me.co.za Vodacom South Africa - Vijay Yellapragada * 1nbox.net / Idea cellular 1nbox.net - Vijay Yellapragada * mms.3ireland.ie / 3 Ireland - Vijay Yellapragada * mms.alltel.com / Alltel (reverted message.alltel.com) - Vijay Yellapragada * mms.mobileiam.ma / Maroc Telecom - Vijay Yellapragada * mms.mtn.co.za / MTM South Africa - Vijay Yellapragada * rci.rogers.com / Rogers of Canada - Vijay Yellapragada * mmsreply.t-mobile.co.uk / T-Mobile UK - Vijay Yellapragada * waw.plspictures.com / PLSPICTURES.COM mms hosting service ### 2.0.3 / 2008-04-15 (Enter Taxman - The 1040 MMS Form) * fix case when part is image/jpeg declared 'application/octet-stream' * trim dangling image/jpeg text from blackberry messages * file extensions added to filenames that are missing extensions in part headers * anonymize images in fixtures to reduce gem size * T-Mobile update - jesse dp * AT&T/T-Mobile Blackberrry update - Dave Myron ### 2.0.2 / 2008-02-22 (The Jomfru Brothers - proprietors of diefordethklok.com) * added support for mms.vodacom4me.co.za Vodacom South Africa - Jason Haruska * added support for bellsouth.net - Jason Haruska * added support for mms.mycricket.com * Improved Blackberry and iPhone suport - Jason Haruska * added :number key to configuration to provide rules for specifying alternative phone number location * return sender's phone number for mobile.indosat.net.id * return sender's phone number for mms.luxgsm.lu * return sender's phone number for mms.vodacom4me.co.za ### 2.0.1 / 2008-02-08 (Professor Jerry Gustav Munndig - Child control expert) * strip out common blackberry and iPhone signatures * handle carriers that use external mail services such as Yahoo! as the From address * Add support for mobile.indosat.net.id (and yahoo.co.id) - Jason Haruska * Add support for sms.sasktel.com - Jason Haruska ### 2.0.0 / 2008-01-23 (Skwisgaar Skwigelf - fastest guitarist alive) * added support for pxt.vodafone.net.nz PXT New Zealand * added support for mms.o2online.de O2 Germany * added support for orangemms.net Orange UK * added support for txt.att.net AT&T * added support for mms.luxgsm.lu LUXGSM S.A. * added support for mms.netcom.no NetCom (Norway) * added support for mms.three.co.uk Hutchison 3G UK Ltd * removed deprecated #get_number use #number * removed deprecated #get_subject use #subject * removed deprecated #get_body use #body * removed deprecated #get_media use #default_media * removed deprecated #get_text use #default_text * removed deprecated #get_attachment use #attachment * fixed error when Sprint content server responds 500 * better yaml configs * moved TMail dependency from Rails ActionMailer SVN to 'official' Gem * ::new greedily processes MMS unless otherwise specified as an initialize option :process => :lazy * logger moved to initialize option :logger => some_logger * testing using mocks and stubs instead of duck raped Net::HTTP * fixed typo in name of method #attachement to #attachment * fixed broken downloading of Sprint videos ### 1.1.12 / 2007-10-21 (Dr. Ronald von Moldenberg - Endorsement specialist) * fetch original images from Sprint content server (Layton Wedgeworth) * ignore Sprint messages when requested content has been purged from their content server ### 1.1.11 / 2007-10-20 (Dr. Armand Skagerakk Frederickshaven - Mythology expert) * minor fix for attachment_fu where it might call #path on the cgi temp file that is returned by get_attachment * renamed a_t_t_media.rb to att_media.rb to make it autotest happy * masthead.jpg misplaced in mms2r_t_mobile_media_ignore.yml (Layton Wedgeworth) * overridden SprintMedia#process failed to accept block (Layton Wedgeworth) * added method_deprecated to help mark methods that are going to be deprecated in preparation of 1.2.x release * #get_number marked deprecated, use #number instead * #get_subject marked deprecated, use #subject instead * #get_body marked deprecated, use #body instead * #get_text marked deprecated, use #default_text instead * #get_attachment marked deprecated, use #attachment instead * #get_media marked deprecated, use #default_media instead ### 1.1.10 / 2007-09-30 (Face Bones) * fixed a case for a nil match on From in the create method (Luke Francl) * added support for Alltel message.alltel.com (Ben Wood) ### 1.1.9 / 2007-09-08 (Rebecca Nightrod - controlling girlfriend of Nathan Explosion) * fixed broken support for act_as_attachment and attachment_fu ### 1.1.8 / 2007-09-08 (James Grishnack - Head of Behemoth Productions, producer of Blood Ocean) * Added support for Orange of France, Orange orange.fr (Julian Biard) * purge in the process block removed, purge must be called explicitly after processing to clean up extracted temporary media files. ### 1.1.7 / 2007-08-25 (Adam Nergal, friend of Skwisgaar, but not Pickles) * Added support for Orange of Poland, Orange mmsemail.orange.pl (Zbigniew Sobiecki) * Cleaned up documentation modifiers * Cleaned out non-Ruby code idioms ### 1.1.6 / 2007-08-11 (Mustakrakish, the Lake Troll part 2) * Redo of release mistake of 1.1.5 ### 1.1.5 / 2007-08-11 (Mustakrakish, the Lake Troll) * AT&T => mms.att.net not clearing out default "multimedia message" subject to nil (Will Jessup) * Ignore case on default subject for all carriers in corresponding conf/mms2r_XXX_media_subject.yml ### 1.1.4 / 2007-08-07 (Dr. Rockso) * AT&T => mms.att.net support (thanks Mike Chen and Dave Myron) * get_body returns nil when there is not user text (sorry Will!) ### 1.1.3 / 2007-07-10 (Charles Foster Ofdensen) * Helio support by Will Jessup * get_subject returns nil on default carrier subjects ### 1.1.2 / 2007-06-13 (Dethklok roadie #2) * placed versioned hpricot dependency in Hoe's extra_deps (an attempt to appease firebrigade gods or not cause Gem::RemoteInstallationCancelled whichever you prefer) ### 1.1.1 / 2007-06-11 (Dethklok roadie) * rescue rcov non-dependency in Rakefile to make firebrigade happy ### 1.1.0 / 2007-06-08 (Toki Wartooth) * get_body to return body text (Luke Francl) * get_subject returns "" for default subjects now * default subjects listed in yaml by carrier in conf directory * added granularity to Cingular, Sprint, and Verizon carrier services (Will Jessup) * refactored Sprint instance to process all media (Will Jessup + Mike) * optimized text transformations (Will Jessup) * properly handle ISO-8859-1 and UTF-8 text (Will Jessup) * autotest powers activate! (ZenTest autotest discovery enabled) * configuration file ignores, transforms, and subjects all store Regexp's * Put vendor Text::Format & TMail::Mail as an external subversion dependency to the 1.2 stable branch of Rails ActionMailer * added get_number method to return the phone number associated with this MMS * get_media and get_text attachment_fu helper return the largest piece of media of that type if the more than one exits in the media (Luke Francl) * added block support to process() method (Shane Vitarana) ### 1.0.7 / 2007-04-27 (Senator Stampingston) * patch submitted by Luke Francl * added a get_subject method that returns nil when any MMS has a default carrier subject * get_subject returns nil for '', 'Multimedia message', '(no subject)', 'You have new Picture Mail!' ### 1.0.6 / 2007-04-24 (Pickles the Drummer) * patch submitted by Luke Francl * added support for mms.dobson.net (Dobson aka Cellular One) (Luke) * DRY'd up unit tests (Luke) * added get_media instance method that returns first video or image as File (Luke) * File from get_media can be used by/with attachment_fu (Luke) * added get_text instance method that returns first non advertising text * File from get_text can be used by/with attachment_fu ### 1.0.5 / 2007-04-10 (William Murderface) * patch submitted by Luke Francl * made ignore_media? start its text check from the start of the file (Luke) * added new text transform for Verizon messages (Luke) * updated Nextel ignore conf (Luke) * added additional samples and tests for T-Mobile & Verizon (Luke) * cleaned up MMS2R::Media documentation * added Sprint broken image test for when media goes stale on their content server * fixed teardown typo in lots of plases * added tests for 4 three samples of unique variants of Sprint/Nextel text * 100% test coverage! ### 1.0.4 / 2007-04-09 (Metalocalypse) * fix teardown in test_mms2r_sprint.rb (shanesbrain.net) * clean up Net::HTTP in MMS2R::SprintMedia (shanesbrain.net) * added accessor MMS2R::Media.media_dir * fixed a nil issue with underlying tmp working dir * added exception handling around Net::HTTP in MMS2R::SprintMedia ### 1.0.3 / 2007-04-05 (Paper Cut) * Cleaned up packaging and errors in example found by Shane V. http://shanesbrain.net/ ### 1.0.2 / 2007-03-07 * Reorganized tests and fixtures * Added carriers: * Cingular => cingularme.com * Nextel => messaging.nextel.com * Verizon => vtext.com ### 1.0.1 / 2007-03-07 * Flubbed RubyForge release ... do not use this. ### 1.0.0 / 2007-03-06 * Birthday! * AT&T/Cingular => mmode.com * Cingular => mms.mycingular.com * Sprint => pm.sprint.com * Sprint => messaging.sprintpcs.com * T-Mobile => tmomail.net * Verizon => vzwpix.com diff --git a/lib/mms2r.rb b/lib/mms2r.rb index 66e9651..1a8b044 100644 --- a/lib/mms2r.rb +++ b/lib/mms2r.rb @@ -1,131 +1,131 @@ #-- # Copyright (c) 2007-2012 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ module MMS2R ## # A hash of MMS2R processors keyed by MMS carrier domain. CARRIERS = {} ## # Registers a class as a processor for a MMS domain. Should only be # used in special cases such as MMS2R::Media::Sprint for 'pm.sprint.com' def self.register(domain, processor_class) MMS2R::CARRIERS[domain] = processor_class end ## # A hash of file extensions for common mime-types EXT = { 'text/plain' => 'text', 'text/plain' => 'txt', 'text/html' => 'html', 'image/png' => 'png', 'image/gif' => 'gif', 'image/jpeg' => 'jpeg', 'image/jpeg' => 'jpg', 'video/quicktime' => 'mov', 'video/3gpp2' => '3g2' } class MMS2R::Media ## # Spoof User-Agent, primarily for the Sprint CDN USER_AGENT = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.120 Safari/535.2" end ## # Simple convenience function to make it a one-liner: # MMS2R.parse raw_mail or # MMS2R.parse File.load(file) # MMS2R.parse File.load(path_to_file) # Combined w/ the method_missing delegation, this should behave as an enhanced Mail object, more or less. def self.parse thing, options = {} mail = case when File.exist?(thing); Mail.new(open(thing).read) when thing.respond_to?(:read); Mail.new(thing.read) else Mail.new(thing) end MMS2R::Media.new(mail, options) end ## # Compare original MMS2R results with original mail values and other metrics. # # Takes a file path, mms2r object, mail object, or mail text blob. def self.debug(thing, options = {}) mms = case thing when MMS2R::Media; thing when Mail::Message; MMS2R::Media.new(thing, options) else self.parse(thing, options) end <<OUT #{'-' * 80} original mail #{'from:'.ljust(15)} #{mms.mail.from} #{'to:'.ljust(15)} #{mms.mail.to} #{'subject:'.ljust(15)} #{mms.mail.subject} mms2r #{'from:'.ljust(15)} #{mms.from} #{'to:'.ljust(15)} #{mms.to} #{'subject:'.ljust(15)} #{mms.subject} #{'number:'.ljust(15)} #{mms.number} default media #{mms.default_media.inspect} default text #{mms.default_text.inspect} #{mms.default_text.read if mms.default_text} all plain text #{(mms.media['text/plain']||[]).each {|t| open(t).read}.join("\n\n")} media hash #{mms.media.inspect} OUT end end -%W{ yaml mail fileutils pathname tmpdir yaml digest/sha1 iconv exifr }.each do |g| +%W{ yaml mail fileutils pathname tmpdir yaml digest/sha1 exifr }.each do |g| begin require g rescue LoadError require 'rubygems' require g end end if RUBY_VERSION >= "1.9" begin require 'psych' YAML::ENGINE.yamler= 'syck' if defined?(YAML::ENGINE) rescue LoadError end end require File.join(File.dirname(__FILE__), 'ext/mail') require File.join(File.dirname(__FILE__), 'ext/object') require File.join(File.dirname(__FILE__), 'mms2r/media') require File.join(File.dirname(__FILE__), 'mms2r/media/sprint') MMS2R.register('pm.sprint.com', MMS2R::Media::Sprint) diff --git a/lib/mms2r/media.rb b/lib/mms2r/media.rb index 50d86e2..15156df 100644 --- a/lib/mms2r/media.rb +++ b/lib/mms2r/media.rb @@ -1,860 +1,860 @@ #-- # Copyright (c) 2007-2012 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ ## # = Synopsis # # MMS2R is a library to collect media files from MMS messages. MMS messages # are multipart emails and mobile carriers often inject branding into these # messages. MMS2R strips the advertising from an MMS leaving the actual user # generated media. # # The Tracker for MMS2R is located at # http://rubyforge.org/tracker/?group_id=3065 # Please submit bugs and feature requests using the Tracker. # # If MMS from a carrier not known by MMS2R is encountered please submit a # sample to the author for inclusion in this project. # # == Stand Alone Example # # begin # require 'mms2r' # rescue LoadError # require 'rubygems' # require 'mms2r' # end # mail = Mail.read("sample-MMS.file") # mms = MMS2R::Media.new(mail) # subject = mms.subject # number = mms.number # file = mms.default_media # mms.purge # # == Rails ActionMailer#receive w/ AttachmentFu Example # # def receive(mail) # mms = MMS2R::Media.new(mail) # picture = Picture.new # picture is an attachemnt_fu model # picture.title = mms.subject # picture.uploaded_data = mms.default_media # picture.save! # mms.purge # end # # == More Examples # # See the README.rdoc file for more examples # # == Built In Configuration # # A custom configuration can be created for processing the MMS from carriers # that are not currently known by MMS2R. In the conf/ directory create a # YAML file named by combining the domain name of the MMS sender plus a .yml # extension. For instance the configuration of senders from AT&T's cellular # service with a Sender pattern of [email protected] have a configuration # named conf/mms.att.net.yml # # The YAML configuration contains a Hash with instructions for determining what # is content generated by the user and what is content inserted by the carrier. # # The root hash itself has two hashes under the keys 'ignore' and 'transform', # and an array under the 'number' key. # Each hash is itself keyed by mime-type. The value pointed to by the mime-type # key is an array. The ignore arrays are first inspected as regular expressions # else are used as a equality for a string filename. Ignores # work by filename # for the multi-part of the MMS that is being inspected. The array pointed to # by the 'number' key represents an alternate mail header where the sender's # number can be found with a regular expression and replacement value for a # gsub. # # The transform arrays are themselves an array of two element arrays. The elements # are regexp parameters for gsub. # # Ignore instructions are honored first then transform instructions. In the sample, # masthead.jpg is ignored as a regular expression, and spacer.gif is ignored as a # filename comparison. The transform has a match and a replacement, see the gsub # documentation for more information about match and replace. # # -- # ignore: # image/jpeg: # - /^masthead.jpg$/i # image/gif: # - spacer.gif # text/plain: # - /\AThis message was sent using PIX-FLIX Messaging service from .*/m # transform: # text/plain: # - - /\A(.+?)\s+This message was sent using PIX-FLIX Messaging .*/m # - "\1" # number: # - from # - /^([^\s]+)\s.*/ # - "\1" # # Carriers often provide their services under many different domain names. # The conf/aliases.yml is a YAML file with a hash that maps alternative or # legacy carrier names to the most common name of their service. For example # in terms of MMS2R txt.att.net is an alias for mms.att.net. Therefore when # an MMS with a Sender of txt.att.net is processed MMS2R will use the # mms.att.net configuration to process the message. module MMS2R class MMS2R::Media # Pass off everything we don't do to the Mail object # TODO: refactor to explicit addition a la http://blog.jayfields.com/2008/02/ruby-replace-methodmissing-with-dynamic.html def method_missing method, *args, &block mail.send method, *args, &block end ## # Mail object that the media files were derived from. attr_reader :mail ## # media returns the hash of media. The media hash is keyed by mime-type # such as 'text/plain' and the value mapped to the key is an array of # media that are of that type. attr_reader :media ## # Carrier is the domain name of the carrier. If the carrier is not known # the carrier will be set to 'mms2r.media' attr_reader :carrier ## # Base working dir where media for a unique mms message are dropped attr_reader :media_dir ## # Determine if return-path or from is going to be used to desiginate the # origin carrier. If the domain in the From header is listed in # conf/from.yaml then that is the carrier domain. Else if there is a # Return-Path header its address's domain is the carrier doamin, else # use From header's address domain. def self.domain(mail) return_path = case when mail.return_path mail.return_path ? mail.return_path.split('@').last : '' else '' end from_domain = case when mail.from && mail.from.first mail.from.first.split('@').last else '' end f = File.expand_path(File.join(self.conf_dir(), "from.yml")) from = YAML::load_file(f) ret = case when from.include?(from_domain) from_domain when return_path.present? return_path else from_domain end ret end ## # Initialize a new MMS2R::Media comprised of a mail. # # Specify options to initialize with: # :logger => some_logger for logging # :process => :lazy, for non-greedy processing upon initialization # # #process will have to be called explicitly if the lazy process option # is chosen. def initialize(mail, opts={}) @mail = mail @logger = opts[:logger] log("#{self.class} created", :info) @carrier = self.class.domain(mail) @dir_count = 0 sha = Digest::SHA1.hexdigest("#{@carrier}-#{Time.now.to_i}-#{rand}") @media_dir = File.expand_path( File.join(self.tmp_dir(), "#{self.safe_message_id(@mail.message_id)}_#{sha}")) @media = {} @was_processed = false @number = nil @subject = nil @body = nil @exif = nil @default_media = nil @default_text = nil @default_html = nil f = File.expand_path(File.join(self.conf_dir(), "aliases.yml")) @aliases = YAML::load_file(f) conf = "#{@aliases[@carrier] || @carrier}.yml" f = File.expand_path(File.join(self.conf_dir(), conf)) c = File.exist?(f) ? YAML::load_file(f) : {} @config = self.class.initialize_config(c) processor_module = MMS2R::CARRIERS[@carrier] extend processor_module if processor_module lazy = (opts[:process] == :lazy) rescue false self.process() unless lazy end ## # Get the phone number associated with this MMS if it exists. The value # returned is simplistic, it is just the user name of the from address # before the @ symbol. Validation of the number is left to you. Most # carriers are using the real phone number as the username. def number unless @number params = config['number'] if params && params.any? && (header = mail.header[params[0]]) @number = header.to_s.gsub(params[1], params[2]) end if @number.nil? || @number.blank? @number = mail.from.first.split(/@|\//).first rescue "" end end @number end ## # Return the Subject for this message, returns "" for default carrier # subject such as 'Multimedia message' for ATT&T carrier. def subject unless @subject subject = mail.subject.strip rescue "" ignores = config['ignore']['text/plain'] if ignores && ignores.detect{|s| s == subject} @subject = "" else @subject = transform_text('text/plain', subject).last end end @subject end # Convenience method that returns a string including all the text of the # default text/plain file found. If the plain text is blank then it returns # stripped down version of the title and body of default text/html. Returns # empty string if no body text is found. def body text_file = default_text - @body = text_file ? IO.readlines(text_file.path).join.strip : "" - @body.force_encoding("ISO-8859-1") if RUBY_VERSION >= "1.9" && @body.encoding == "ASCII-8BIT" - begin - ic = Iconv.new('UTF-8', 'ISO-8859-1' ) + if RUBY_VERSION < "1.9" + @body = text_file ? IO.read(text_file.path).strip : "" + require 'iconv' + ic = Iconv.new('UTF-8', 'ISO-8859-1') @body = ic.iconv(@body) @body << ic.iconv(nil) ic.close - rescue Exception => e + else + @body = text_file ? IO.read(text_file.path, :mode => "rb").strip : "" + @body = @body.chars.select{|i| i.valid_encoding?}.join end - if @body.blank? && html_file = default_html + if @body.blank? && + html_file = default_html html = Nokogiri::HTML(IO.read(html_file.path)) @body = (html.xpath("//head/title").map(&:text) + html.xpath("//body/*").map(&:text)).join(" ") end @body end # Returns a File with the most likely candidate for the user-submitted # media. Given that most MMS messages only have one file attached, this # method will try to return that file. Singleton methods are added to # the File object so it can be used in place of a CGI upload (local_path, # original_filename, size, and content_type) such as in conjunction with # AttachementFu. The largest file found in terms of bytes is returned. # # Returns nil if there are not any video or image Files found. def default_media @default_media ||= attachment(['video', 'image', 'application', 'text']) end # Returns a File with the most likely candidate that is text, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_text @default_text ||= attachment(['text/plain']) end # Returns a File with the most likely candidate that is html, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_html @default_html ||= attachment(['text/html']) end ## # process is a template method and collects all the media in a MMS. # Override helper methods to this template to clean out advertising and/or # ignore media that are advertising. This method should not be overridden # unless there is an extreme special case in processing the media of a MMS # (like Sprint) # # Helper methods for the process template: # * ignore_media? -- true if the media contained in a part should be ignored. # * process_media -- retrieves media to temporary file, returns path to file. # * transform_text -- called by process_media, strips out advertising. # * temp_file -- creates a temporary filepath based on information from the part. # # Block support: # Call process() with a block to automatically iterate through media. # For example, to process and receive only media of video type: # mms.process do |media_type, file| # results << file if media_type =~ /video/ # end # # note: purge must be explicitly called to remove the media files # mms2r extracts from an mms message. def process # :yields: media_type, file unless @was_processed log("#{self.class} processing", :info) parts = self.folded_parts(mail) parts.each do |part| if part.part_type? == 'text/html' process_html_part(part) else process_part(part) end end @was_processed = true end # when process acts upon a block if block_given? media.each do |k, v| yield(k, v) end end end ## # Helper for process template method to determine if media contained in a # part should be ignored. Producers should override this method to return # true for media such as images that are advertising, carrier logos, etc. # See the ignore section in the discussion of the built-in configuration. def ignore_media?(type, part) ignores = config['ignore'][type] || [] ignore = ignores.detect{ |test| filename?(part) == test} ignore ||= ignores.detect{ |test| filename?(part) =~ test if test.is_a?(Regexp) } ignore ||= ignores.detect{ |test| part.body.decoded.strip =~ test if test.is_a?(Regexp) } ignore ||= (part.body.decoded.strip.size == 0 ? true : nil) ignore.nil? ? false : true end ## # Helper for process template method to decode the part based on its type # and write its content to a temporary file. Returns path to temporary # file that holds the content. Parts with a main type of text will have # their contents transformed with a call to transform_text # # Producers should only override this method if the parts of the MMS need # special treatment besides what is expected for a normal mime part (like # Sprint). # # Returns a tuple of content type, file path def process_media(part) # Mail body auto-magically decodes quoted # printable for text/html type. file = temp_file(part) if part.part_type? =~ /^text\// || part.part_type? == 'application/smil' type, content = transform_text_part(part) - mode = 'wb' else if part.part_type? == 'application/octet-stream' type = type_from_filename(filename?(part)) else type = part.part_type? end content = part.body.decoded - mode = 'wb' # open with binary bit for Windows for non text end return type, nil if content.nil? || content.empty? log("#{self.class} writing file #{file}", :info) - File.open(file, mode){ |f| f.write(content) } + File.open(file, 'wb'){ |f| f.write(content) } return type, file end ## # Helper to decide if a part should be kept or ignored def process_part(part) return if ignore_media?(part.part_type?, part) type, file = process_media(part) add_file(type, file) unless type.nil? || file.nil? end ## # Helper to decide if a html part should be kept or ignored. # We are defining it here primarily for the benefit so that Sprint # can override a special case for processing. def process_html_part(part) process_part(part) end ## # Helper for process_media template method to transform text. # See the transform section in the discussion of the built-in # configuration. - def transform_text(type, text, original_encoding = 'ISO-8859-1') + def transform_text(type, text) return type, text if !config['transform'] || !(transforms = config['transform'][type]) - begin - ic = Iconv.new('UTF-8', original_encoding ) - utf_t = ic.iconv(text) - utf_t << ic.iconv(nil) + if RUBY_VERSION < "1.9" + require 'iconv' + ic = Iconv.new('UTF-8', 'ISO-8859-1') + text = ic.iconv(text) + text << ic.iconv(nil) ic.close - rescue Exception => e - utf_t = text end transforms.each do |transform| next unless transform.size == 2 p = transform.first r = transform.last - utf_t = utf_t.gsub(p, r) rescue utf_t + text = text.gsub(p, r) rescue text end - return type, utf_t + return type, text end ## # Helper for process_media template method to transform text. def transform_text_part(part) type = part.part_type? text = part.body.decoded.strip transform_text(type, text) end ## # Helper for process template method to name a temporary filepath based on # information in the part. This version attempts to honor the name of the # media as labeled in the part header and creates a unique temporary # directory for writing the file so filename collision does not occur. # Consumers of this method expect the directory structure to the file # exists, if the method is overridden it is mandatory that this behavior is # retained. def temp_file(part) file_name = filename?(part) File.expand_path(File.join(msg_tmp_dir(),File.basename(file_name))) end ## # Purges the unique MMS2R::Media.media_dir directory created # for this producer and all of the media that it contains. def purge log("#{self.class} purging #{@media_dir} and all its contents", :info) FileUtils.rm_rf(@media_dir) end ## # Helper to add a file to the media hash. def add_file(type, file) media[type] = [] unless media[type] media[type] << file end ## # Helper to temp_file to create a unique temporary directory that is a # child of tmp_dir This version is based on the message_id of the mail. def msg_tmp_dir @dir_count += 1 dir = File.expand_path(File.join(@media_dir, "#{@dir_count}")) FileUtils.mkdir_p(dir) dir end ## # returns a filename declared for a part, or a default if its not defined def filename?(part) name = part.filename if (name.nil? || name.empty?) if part.content_id && (matched = /^<(.+)>$/.match(part.content_id)) name = matched[1] else name = "#{Time.now.to_f}.#{self.default_ext(part.part_type?)}" end end # FIXME FWIW, janky look for dot extension 1 to 4 chars long name = (name =~ /\..{1,4}$/ ? name : "#{name}.#{self.default_ext(part.part_type?)}").strip # handle excessively large filenames if name.size > 255 ext = File.extname(name) base = File.basename(name, ext) name = "#{base[0, 255 - ext.size]}#{ext}" end name end def aliases @aliases end ## # Best guess of the mobile device type. Simple heuristics thus far by # inspecting mail headers and jpeg/tiff exif metadata, and file name. # Known smart phone types thus far are # # * :blackberry # * :dash # * :droid # * :htc # * :iphone # * :lge # * :motorola # * :nokia # * :palm # * :pantech # * :samsung # # If the message is from a carrier known to MMS2R, and not a smart phone # its type is returned as :handset # Otherwise device type is :unknown def device_type? file = attachment(['image']) if file original = file.original_filename @exif = case original when /\.je?pg$/i EXIFR::JPEG.new(file) when /\.tiff?$/i EXIFR::TIFF.new(file) end if @exif models = config['device_types']['models'] rescue {} models.each do |type, regex| return type if @exif.model =~ regex end makes = config['device_types']['makes'] rescue {} makes.each do |type, regex| return type if @exif.make =~ regex end software = config['device_types']['software'] rescue {} software.each do |type, regex| return type if @exif.software =~ regex end end end headers = config['device_types']['headers'] rescue {} headers.keys.each do |header| if mail.header[header] # headers[header] refers to a hash of smart phone types with regex values # that if they match, the header signals the type should be returned headers[header].each do |type, regex| return type if mail.header[header].decoded =~ regex field = mail.header.fields.detect { |field| field.name == header } return type if field && field.to_s =~ regex end end end file = attachment(['image']) if file original_filename = file.original_filename filenames = config['device_types']['filenames'] rescue {} filenames.each do |type, regex| return type if original_filename =~ regex end end file = attachment(['video']) if file original_filename = file.original_filename filenames = config['device_types']['filenames'] rescue {} filenames.each do |type, regex| return type if original_filename =~ regex end end boundary = mail.boundary boundaries = config['device_types']['boundary'] rescue {} boundaries.each do |type, regex| return type if boundary =~ regex end return :handset if File.exist?( File.expand_path( File.join(self.conf_dir, "#{self.aliases[self.carrier] || self.carrier}.yml") ) ) :unknown end ## # exif object on default image from exifr gem def exif device_type? unless @exif @exif end ## # The source of the MMS was some sort of mobile or smart phone def is_mobile? self.device_type? != :unknown end ## # Get the temporary directory where media files are written to. def self.tmp_dir @@tmp_dir ||= File.expand_path(File.join(Dir.tmpdir, (ENV['USER'].nil? ? '':ENV['USER']), 'mms2r')) end ## # Set the temporary directory where media files are written to. def self.tmp_dir=(d) @@tmp_dir=d end ## # Get the directory where conf files are stored. def self.conf_dir @@conf_dir ||= File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'conf')) end ## # Set the directory where conf files are stored. def self.conf_dir=(d) @@conf_dir=d end ## # Helper to create a safe directory path element based on the mail message # id. def self.safe_message_id(mid) mid.nil? ? "#{Time.now.to_i}" : mid.gsub(/\$|<|>|@|\./, "") end ## # Returns a default file extension based on a content type def self.default_ext(content_type) if MMS2R::EXT[content_type] MMS2R::EXT[content_type] elsif content_type content_type.split('/').last end end ## # Joins the generic mms2r configuration with the carrier specific # configuration. def self.initialize_config(c) f = File.expand_path(File.join(self.conf_dir(), "mms2r_media.yml")) conf = YAML::load_file(f) conf['ignore'] ||= {} unless conf['ignore'] conf['transform'] = {} unless conf['transform'] conf['number'] = [] unless conf['number'] return conf unless c kinds = ['ignore', 'transform'] kinds.each do |kind| if c[kind] c[kind].each do |type,array| conf[kind][type] = [] unless conf[kind][type] conf[kind][type] += array end end end conf['number'] = c['number'] if c['number'] conf end def log(message, level = :info) @logger.send(level, message) unless @logger.nil? end ## # convenience accessor for self.class.conf_dir def conf_dir self.class.conf_dir end ## # convenience accessor for self.class.conf_dir def tmp_dir self.class.tmp_dir end ## # convenience accessor for self.class.default_ext def default_ext(type) self.class.default_ext(type) end ## # convenience accessor for self.class.safe_message_id def safe_message_id(message_id) self.class.safe_message_id(message_id) end ## # convenience accessor for self.class.initialize_confg def initialize_config(config) self.class.initialize_config(config) end protected ## # accessor for the config def config @config end ## # guess content type from filename def type_from_filename(filename) ext = filename.split('.').last ent = MMS2R::EXT.detect{|k,v| v == ext} ent.nil? ? nil : ent.first end ## # Helper to fold all the parts of multipart mail down into a flat array. # multipart/related and multipart/alternative parts can have child parts. def folded_parts(parts) return folded_parts([parts]) unless parts.respond_to?(:each) result = [] # NOTE could use #tap but want 1.8.7 compat parts.each do |part| result << (part.multipart? ? folded_parts(part.parts) : part) end result.flatten end ## # used by #default_media and #text to return the biggest attachment type # listed in the types array def attachment(types) # get all the files that are of the major types passed in files = [] types.each do |type| media.keys.find_all{|k| type.include?("/") ? k == type : k.index(type) == 0 }.each do |key| files += media[key] end end return nil if files.empty? # set temp holders file = nil # explicitly declare the file and size size = 0 mime_type = nil #get the largest file files.each do |path| next unless File.exist?(path) if File.size(path) > size size = File.size(path) file = File.new(path) media.each do |type,_files| mime_type = type if _files.detect{ |_path| _path == path } end end end return nil if file.nil? # These singleton methods implement the interface necessary to be used # as a drop-in replacement for files uploaded with CGI.rb. # This helps if you want to use the files with, for example, # attachment_fu. def file.local_path self.path end def file.original_filename File.basename(self.path) end def file.size File.size(self.path) end # this one is kind of confusing because it needs a closure. class << file self end.send(:define_method, :content_type) { mime_type } file end end end diff --git a/lib/mms2r/version.rb b/lib/mms2r/version.rb index 448c31d..0a8ef7f 100644 --- a/lib/mms2r/version.rb +++ b/lib/mms2r/version.rb @@ -1,25 +1,25 @@ module MMS2R class Version def self.major 3 end def self.minor - 8 + 9 end def self.patch - 2 + 0 end def self.pre nil end def self.to_s [major, minor, patch, pre].compact.join('.') end end end diff --git a/test/fixtures/sprint-ajax-response-success.json b/test/fixtures/sprint-ajax-response-success.json index 8feb749..8344941 100644 --- a/test/fixtures/sprint-ajax-response-success.json +++ b/test/fixtures/sprint-ajax-response-success.json @@ -1 +1 @@ -{"totalMediaItems":2,"shareType":"normal","nomediaItem":"false","isOnlyVideo":null,"creationDate":"May 31, 2012","from":"(513)545-0000","offset":null,"externalMessageId":"XXXXXXXXXXXXXXXXXX","Results":[{"elementID":"0","hasVoiceCaption":false,"URL":{"elementID":"0","indexCount":0,"audio":null,"thumb":"\/retailers\/PCSNEXTEL\/ui-refresh\/images\/background\/slide_no_media_90x90.gif","annotationVoiceID":null,"image":"\/retailers\/PCSNEXTEL\/ui-refresh\/images\/background\/slide_no_media_90x90.gif","video":null},"description":"First text content. ","mediaItemNum":0,"isDRMProtected":false,"externalMessageId":"XXXXXXXXXXXXXXXXXX","mediaType":"TEXT","restOperation":"false","folderFullName":"\/RECIPIENT"},{"elementID":"3","hasVoiceCaption":false,"URL":{"elementID":"3","indexCount":1,"audio":"","thumb":"http:\/\/pictures.sprintpcs.com:80\/mmps\/048_0736849c3f1a9d27_1\/3.jpg?partExt=.jpg&&&outquality=90&ext=.jpg&&size=40,40&squareoutput=255,255,255&aspectcrop=0.5,0.5,1.0,1.0,1.0","annotationVoiceID":null,"image":"http:\/\/pictures.sprintpcs.com:80\/mmps\/048_0736849c3f1a9d27_1\/3.jpg?partExt=.jpg&&&outquality=90&ext=.jpg","video":""},"description":"Second text content. ","mediaItemNum":1,"isDRMProtected":false,"externalMessageId":"XXXXXXXXXXXXXXXXXX","mediaType":"IMAGE","restOperation":"false","folderFullName":"\/RECIPIENT"}],"invite":null,"tmemo":null,"toAddress":"[email protected]","mediaIndex":0,"subject":"New Message","isDRMProtected":false,"expirationDate":"Expires in 57 Days","voiceURL":null,"guest":"true","folderFullName":"\/RECIPIENT"} +{"totalMediaItems":2,"shareType":"normal","nomediaItem":"false","isOnlyVideo":null,"creationDate":"May 31, 2012","from":"(513)545-0000","offset":null,"externalMessageId":"XXXXXXXXXXXXXXXXXX","Results":[{"elementID":"0","hasVoiceCaption":false,"URL":{"elementID":"0","indexCount":0,"audio":null,"thumb":"\/retailers\/PCSNEXTEL\/ui-refresh\/images\/background\/slide_no_media_90x90.gif","annotationVoiceID":null,"image":"\/retailers\/PCSNEXTEL\/ui-refresh\/images\/background\/slide_no_media_90x90.gif","video":null},"description":"First text content.","mediaItemNum":0,"isDRMProtected":false,"externalMessageId":"XXXXXXXXXXXXXXXXXX","mediaType":"TEXT","restOperation":"false","folderFullName":"\/RECIPIENT"},{"elementID":"3","hasVoiceCaption":false,"URL":{"elementID":"3","indexCount":1,"audio":"","thumb":"http:\/\/pictures.sprintpcs.com:80\/mmps\/048_0736849c3f1a9d27_1\/3.jpg?partExt=.jpg&&&outquality=90&ext=.jpg&&size=40,40&squareoutput=255,255,255&aspectcrop=0.5,0.5,1.0,1.0,1.0","annotationVoiceID":null,"image":"http:\/\/pictures.sprintpcs.com:80\/mmps\/048_0736849c3f1a9d27_1\/3.jpg?partExt=.jpg&&&outquality=90&ext=.jpg","video":""},"description":"Second text content. ","mediaItemNum":1,"isDRMProtected":false,"externalMessageId":"XXXXXXXXXXXXXXXXXX","mediaType":"IMAGE","restOperation":"false","folderFullName":"\/RECIPIENT"}],"invite":null,"tmemo":null,"toAddress":"[email protected]","mediaIndex":0,"subject":"New Message","isDRMProtected":false,"expirationDate":"Expires in 57 Days","voiceURL":null,"guest":"true","folderFullName":"\/RECIPIENT"} diff --git a/test/test_invalid_byte_seq_outlook.rb b/test/test_invalid_byte_seq_outlook.rb index 75a6b6a..ad91587 100644 --- a/test/test_invalid_byte_seq_outlook.rb +++ b/test/test_invalid_byte_seq_outlook.rb @@ -1,27 +1,15 @@ require "test_helper" class TestInvalidByteSeqOutlook < Test::Unit::TestCase include MMS2R::TestHelper def test_bad_outlook mail = mail('invalid-byte-seq-outlook.mail') mms = MMS2R::Media.new(mail) - body = mms.body -=begin - assert_equal "+919812345678", mms.number - assert_equal "1nbox.net", mms.carrier - assert_equal 2, mms.media.size - - assert_not_nil mms.media['text/plain'] - assert_equal 1, mms.media['text/plain'].size - assert_equal "testing123456789012", open(mms.media['text/plain'].first).read - - assert_not_nil mms.media['image/jpeg'] - assert_equal 1, mms.media['text/plain'].size - assert_match(/@003\.jpg$/, mms.media['image/jpeg'].first) -=end + assert_equal "RE: Issue 14794:Don M. says.. Aaron - I completed RNS Test Question 3, which was done as a 'Cargo Control Number' query. H", mms.subject + assert_match /Don Doe said less than a minute ago/im, mms.body mms.purge end end diff --git a/test/test_messaging_sprintpcs_com.rb b/test/test_messaging_sprintpcs_com.rb index a967ff7..14fc88b 100644 --- a/test/test_messaging_sprintpcs_com.rb +++ b/test/test_messaging_sprintpcs_com.rb @@ -1,22 +1,22 @@ require "test_helper" class TestMessagingSprintpcsCom < Test::Unit::TestCase include MMS2R::TestHelper def test_simple_text mail = mail('sprint-pcs-text-01.mail') mms = MMS2R::Media.new(mail) assert_equal "2068675309", mms.number assert_equal "messaging.sprintpcs.com", mms.carrier assert_equal 1, mms.media.size assert_not_nil mms.media['text/plain'] file = mms.media['text/plain'][0] assert_not_nil file assert File::exist?(file), "file #{file} does not exist" - text = IO.readlines("#{file}").join + text = IO.read("#{file}") assert_match(/hello world/, text) mms.purge end end diff --git a/test/test_mms2r_media.rb b/test/test_mms2r_media.rb index 54e5317..e4367c5 100644 --- a/test/test_mms2r_media.rb +++ b/test/test_mms2r_media.rb @@ -1,761 +1,757 @@ # encoding: UTF-8 require "test_helper" class TestMms2rMedia < Test::Unit::TestCase include MMS2R::TestHelper def use_temp_dirs MMS2R::Media.tmp_dir = @tmpdir MMS2R::Media.conf_dir = @confdir end def setup @oldtmpdir = MMS2R::Media.tmp_dir || File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") @oldconfdir = MMS2R::Media.conf_dir || File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") FileUtils.mkdir_p(@oldtmpdir) FileUtils.mkdir_p(@oldconfdir) @tmpdir = File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") FileUtils.mkdir_p(@tmpdir) @confdir = File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") FileUtils.mkdir_p(@confdir) end def teardown FileUtils.rm_rf(@tmpdir) FileUtils.rm_rf(@confdir) MMS2R::Media.tmp_dir = @oldtmpdir MMS2R::Media.conf_dir = @oldconfdir end def stub_mail(vals = {}) attrs = { :from => '[email protected]', :to => '[email protected]', :subject => 'This is a test email', :body => 'a', }.merge(vals) Mail.new do from attrs[:from] to attrs[:to] subject attrs[:subject] body attrs[:body] end end def test_faux_user_agent assert_equal "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.120 Safari/535.2", MMS2R::Media::USER_AGENT end def test_class_parse mms = mail('generic.mail') assert_equal ['[email protected]'], mms.from end def temp_text_file(text) tf = Tempfile.new("test" + rand.to_s) tf.puts(text) tf.close tf.path end def test_tmp_dir use_temp_dirs() MMS2R::Media.tmp_dir = @tmpdir assert_equal @tmpdir, MMS2R::Media.tmp_dir end def test_conf_dir use_temp_dirs() MMS2R::Media.conf_dir = @confdir assert_equal @confdir, MMS2R::Media.conf_dir end def test_safe_message_id mid1_b="1234abcd" mid1_a="1234abcd" mid2_b="<01234567.0123456789012.JavaMail.fooba@foo-bars999>" mid2_a="012345670123456789012JavaMailfoobafoo-bars999" assert_equal mid1_a, MMS2R::Media.safe_message_id(mid1_b) assert_equal mid2_a, MMS2R::Media.safe_message_id(mid2_b) end def test_default_ext assert_equal nil, MMS2R::Media.default_ext(nil) assert_equal 'text', MMS2R::Media.default_ext('text') assert_equal 'txt', MMS2R::Media.default_ext('text/plain') assert_equal 'test', MMS2R::Media.default_ext('example/test') end def test_base_initialize_config_tries_to_open_default_config_yaml f = File.join(MMS2R::Media.conf_dir, 'mms2r_media.yml') YAML.expects(:load_file).once.with(f).returns({}) config = MMS2R::Media.initialize_config(nil) end def test_base_initialize_config config = MMS2R::Media.initialize_config(nil) # test defaults shipped in mms2r_media.yml assert_not_nil config assert_equal true, config['ignore'].is_a?(Hash) assert_equal true, config['transform'].is_a?(Hash) assert_equal true, config['number'].is_a?(Array) end def test_instance_initialize_config mms = MMS2R::Media.new stub_mail config = mms.initialize_config(nil) # test defaults shipped in mms2r_media.yml assert_not_nil config assert_equal true, config['ignore'].is_a?(Hash) assert_equal true, config['transform'].is_a?(Hash) assert_equal true, config['number'].is_a?(Array) end def test_initialize_config_contatenation c = {'ignore' => {'text/plain' => [/A TEST/]}, 'transform' => {'text/plain' => [/FOO/, '']}, 'number' => ['from', /^([^\s]+)\s.*/, '\1'] } config = MMS2R::Media.initialize_config(c) assert_not_nil config['ignore']['text/plain'].detect{|v| v == /A TEST/} assert_not_nil config['transform']['text/plain'].detect{|v| v == /FOO/} assert_not_nil config['number'].first == 'from' end def test_aliased_new_returns_default_processor_instance mms = MMS2R::Media.new stub_mail assert_not_nil mms assert_equal true, mms.respond_to?(:process) assert_equal MMS2R::Media, mms.class end def test_lazy_process_option mms = MMS2R::Media.new stub_mail, :process => :lazy mms.expects(:process).never end def test_logger_option logger = mock() logger.expects(:info).at_least_once mms = MMS2R::Media.new stub_mail, :logger => logger end def test_default_processor_initialize_tries_to_open_config_for_carrier mms_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'mms2r_media.yml')) aliases_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'aliases.yml')) from_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'from.yml')) example_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'example.com.yml')) YAML.expects(:load_file).at_least_once.with(mms_yaml).returns({}) YAML.expects(:load_file).at_least_once.with(aliases_yaml).returns({}) YAML.expects(:load_file).at_least_once.with(from_yaml).returns([]) YAML.expects(:load_file).never.with(example_yaml) mms = MMS2R::Media.new stub_mail end def test_mms_phone_number mail = stub_mail mail.stubs(:from).returns(['[email protected]']) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number end def test_mms_phone_number_from_config mail = stub_mail(:from => '"+2068675309" <[email protected]>') mms = MMS2R::Media.new(mail) mms.expects(:config).once.returns({'number' => ['from', /^([^\s]+)\s.*/, '\1']}) assert_equal '+2068675309', mms.number end def test_mms_phone_number_with_errors mail = stub_mail mail.stubs(:from).returns(nil) mms = MMS2R::Media.new(mail) assert_nothing_raised do assert_equal '', mms.number end end def test_transform_text_plain mail = stub_mail mail.stubs(:from).returns(nil) mms = MMS2R::Media.new(mail) type = 'test/type' text = 'hello' # no match in the config result = [type, text] assert_equal result, mms.transform_text(type, text) # testing the default config assert_equal ['text/plain', ''], mms.transform_text('text/plain', "From my HTC Sensation 4G on T-Mobile. The first nationwide 4G network") assert_equal ['text/plain', ''], mms.transform_text('text/plain', "Sent from my Windows Phone") assert_equal ['text/plain', ''], mms.transform_text('text/plain', "Sent via BlackBerry from T-Mobile") assert_equal ['text/plain', ''], mms.transform_text('text/plain', "Sent from my Verizon Wireless BlackBerry") assert_equal ['text/plain', ''], mms.transform_text('text/plain', 'Sent via iPhone') assert_equal ['text/plain', ''], mms.transform_text('text/plain', 'Sent from my iPhone') assert_equal ['text/plain', ''], mms.transform_text('text/plain', 'Sent from your iPhone.') assert_equal ['text/plain', ''], mms.transform_text('text/plain', " \n\nimage/jpeg") # has a bad regexp mms.expects(:config).at_least_once.returns({'transform' => {type => [['(hello)', 'world']]}}) assert_equal result, mms.transform_text(type, text) # matches in config mms.expects(:config).at_least_once.returns({'transform' => {type => [[/(hello)/, 'world']]}}) assert_equal [type, 'world'], mms.transform_text(type, text) mms.expects(:config).at_least_once.returns({'transform' => {type => [[/^Ignore this part, (.+)/, '\1']]}}) assert_equal [type, text], mms.transform_text(type, "Ignore this part, " + text) # chaining transforms mms.expects(:config).at_least_once.returns({'transform' => {type => [[/(hello)/, 'world'], [/(world)/, 'mars']]}}) assert_equal [type, 'mars'], mms.transform_text(type, text) # has a Iconv problem mms.expects(:config).at_least_once.returns({'transform' => {type => [['(hello)', 'world']]}}) assert_equal result, mms.transform_text(type, text) end def test_transform_text_to_utf8 mail = mail('iconv-fr-text-01.mail') mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_equal 1, mms.media['text/plain'].size assert_equal 1, mms.media['text/html'].size file = mms.media['text/plain'][0] assert_not_nil file assert_equal true, File::exist?(file) - text_lines = IO.readlines("#{file}") - text = text_lines.join - - # ASCII-8BIT -> D'ici un mois G\xE9orgie - # UTF-8 -> D'ici un mois Géorgie - if RUBY_VERSION < "1.9" - assert_equal("sample email message Fwd: sub D'ici un mois Géorgie", mms.subject) - assert_equal("D'ici un mois Géorgie body", text_lines.first.strip) + text = IO.read("#{file}") else - assert_equal(Iconv.new('UTF-8', 'ISO-8859-1').iconv("sample email message Fwd: sub D'ici un mois Géorgie"), mms.subject) - assert_equal(Iconv.new('UTF-8', 'ISO-8859-1').iconv("D'ici un mois G\xE9orgie body"), text_lines.first.strip) + text = IO.read("#{file}", :mode => "rb") end + # ASCII-8BIT -> D'ici un mois G\xE9orgie + # UTF-8 -> D'ici un mois Géorgie + + assert_equal("sample email message Fwd: sub D'ici un mois Géorgie", mms.subject) end def test_subject s = 'hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) assert_equal s, mms.subject # second time through shouldn't process the subject again mail.expects(:subject).never assert_equal s, mms.subject end def test_subject_with_bad_mail_subject mail = stub_mail mail.stubs(:subject).returns(nil) mms = MMS2R::Media.new(mail) assert_equal '', mms.subject end def test_subject_with_subject_ignored s = 'hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) mms.stubs(:config).returns({'ignore' => {'text/plain' => [s]}}) assert_equal '', mms.subject end def test_subject_with_subject_transformed s = 'Default Subject: hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) mms.stubs(:config).returns( { 'ignore' => {}, 'transform' => {'text/plain' => [[/Default Subject: (.+)/, '\1']]}}) assert_equal 'hello world', mms.subject end def test_attachment_should_return_nil_if_files_for_type_are_not_found mms = MMS2R::Media.new stub_mail mms.stubs(:media).returns({}) assert_nil mms.send(:attachment, ['text']) end def test_attachment_should_return_nil_if_empty_files_are_found mms = MMS2R::Media.new stub_mail mms.stubs(:media).returns({'text/plain' => [Tempfile.new('test')]}) assert_nil mms.send(:attachment, ['text']) end def test_type_from_filename mms = MMS2R::Media.new stub_mail assert_equal 'image/jpeg', mms.send(:type_from_filename, "example.jpg") end def test_type_from_filename_should_be_nil mms = MMS2R::Media.new stub_mail assert_nil mms.send(:type_from_filename, "example.example") end def test_attachment_should_return_duck_typed_file mms = MMS2R::Media.new stub_mail duck_file = mms.send(:attachment, ['text']) assert_equal 1, duck_file.size assert_equal 'text/plain', duck_file.content_type assert_equal "a", open(mms.media['text/plain'].first).read end def test_empty_body mms = MMS2R::Media.new stub_mail mms.stubs(:default_text).returns(nil) assert_equal "", mms.body end def test_body mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") mms.stubs(:default_text).returns(File.new(temp_big)) body = mms.body assert_equal "hello world", body end def test_body_when_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") mms.stubs(:default_html).returns(File.new(temp_big)) assert_equal "hello world teapot", mms.body end def test_default_text mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'text/plain' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_text.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_text.local_path end def test_default_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") temp_small = temp_text_file("<html><head><title>hello</title></head><body>world<body></html>") mms.stubs(:media).returns({'text/html' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_html.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_html.local_path end def test_default_media mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'image/jpeg' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_media.local_path end def test_default_media_treats_image_and_video_equally mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big_image = temp_text_file("hello world") temp_small_image = temp_text_file("hello") temp_big_video = temp_text_file("hello world again") temp_small_video = temp_text_file("hello again") mms.stubs(:media).returns({'image/jpeg' => [temp_small_image, temp_big_image], 'video/mpeg' => [temp_small_video, temp_big_video], }) assert_equal temp_big_video, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big_video, mms.default_media.local_path end #def test_default_media_treats_gif_and_jpg_equally # #it doesn't matter that these are text files, we just need say they are images # temp_big = temp_text_file("hello world") # temp_small = temp_text_file("hello") # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/jpeg' => [temp_big], 'image/gif' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/gif' => [temp_big], 'image/jpg' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path #end def test_purge mms = MMS2R::Media.new stub_mail mms.purge assert_equal false, File.exist?(mms.media_dir) end def test_ignore_media_by_filename_equality name = 'foo.txt' type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [name]}}) # type is not in the ingore part = stub(:body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and filename are in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal true, mms.ignore_media?(type, part) # type but not file name are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_filename name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'foo.txt', mms.filename?(part) end def test_long_filename name = 'x' * 300 + '.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'x' * 251 + '.txt', mms.filename?(part) end def test_filename_when_file_extension_missing_part name = 'foo' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.txt', mms.filename?(part) name = 'foo.janky' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.janky.txt', mms.filename?(part) end def test_ignore_media_by_filename_regexp name = 'foo.txt' regexp = /foo\.txt/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [regexp, 'nil.txt']}}) # type is not in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the filename are in the ingore part = stub(:filename => name) assert_equal true, mms.ignore_media?(type, part) # type but not regexp for filename are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_by_regexp_on_file_content name = 'foo.txt' content = "aaaaaaahello worldbbbbbbbbb" regexp = /.*Hello World.*/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => ['nil.txt', regexp]}}) part = stub(:filename => name, :body => Mail::Body.new(content)) # type is not in the ingore assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the content are in the ingore assert_equal true, mms.ignore_media?(type, part) # type but not regexp for content are in the ignore part = stub(:filename => name, :body => Mail::Body.new('no teapots')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_when_file_content_is_empty mms = MMS2R::Media.new stub_mail # there is no conf but the part's body is empty part = stub(:filename => 'foo.txt', :body => Mail::Body.new) assert_equal true, mms.ignore_media?('text/test', part) # there is no conf but the part's body is white space part = stub(:filename => 'foo.txt', :body => Mail::Body.new("\t\n\t\n ")) assert_equal true, mms.ignore_media?('text/test', part) end def test_add_file mail = stub_mail mail.stubs(:from).returns(['[email protected]']) mms = MMS2R::Media.new(mail) mms.stubs(:media).returns({}) assert_nil mms.media['text/html'] mms.add_file('text/html', '/tmp/foo.html') assert_equal ['/tmp/foo.html'], mms.media['text/html'] mms.add_file('text/html', '/tmp/bar.html') assert_equal ['/tmp/foo.html', '/tmp/bar.html'], mms.media['text/html'] end def test_temp_file name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal name, File.basename(mms.temp_file(part)) end def test_process_media_for_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', 'hello world']) result = mms.process_media(part) assert_equal 'text/plain', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_with_empty_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', '']) assert_equal ['text/plain', nil], mms.process_media(part) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_application_smil name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['application/smil', nil]) part = stub(:filename => name, :content_type => 'application/smil', :part_type? => 'application/smil', :main_type => 'application') assert_equal ['application/smil', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['application/smil', 'hello world']) result = mms.process_media(part) assert_equal 'application/smil', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_application_octet_stream_when_image name = 'fake.jpg' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'application/octet-stream', :part_type? => 'application/octet-stream', :body => Mail::Body.new("data"), :main_type => 'application') result = mms.process_media(part) assert_equal 'image/jpeg', result.first assert_match(/fake\.jpg$/, result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_all_other_media name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :main_type => 'faux', :part_type? => 'faux/text', :body => Mail::Body.new(nil)) assert_equal ['faux/text', nil], mms.process_media(part) part = stub(:filename => name, :main_type => 'faux', :part_type? => 'faux/text', :body => Mail::Body.new('hello world')) result = mms.process_media(part) assert_equal 'faux/text', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process mms = MMS2R::Media.new stub_mail assert_equal 1, mms.media.size assert_not_nil mms.media['text/plain'] assert_equal 1, mms.media['text/plain'].size assert_equal true, File.exist?(mms.media['text/plain'].first) assert_equal 1, File.size(mms.media['text/plain'].first) mms.purge end def test_process_with_multipart_double_parts mail = mail('apple-double-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_not_nil mms.media['application/applefile'] assert_equal 1, mms.media['application/applefile'].size assert_not_nil mms.media['image/jpeg'] assert_equal 1, mms.media['image/jpeg'].size assert_match(/DSCN1715\.jpg$/, mms.media['image/jpeg'].first) assert_file_size mms.media['image/jpeg'].first, 337 mms.purge end def test_folding_with_multipart_alternative_parts mail = mail('helio-message-01.mail') mms = MMS2R::Media.new(Mail.new) assert_equal 5, mms.send(:folded_parts, mail.parts).size end def test_process_when_media_is_ignored # TODO - I'd like to get away from mocks and test on real data, and # this is covered repeatedly for various samples from the carrier end def test_process_when_yielding_to_a_block mail = mail('att-image-01.mail') mms = MMS2R::Media.new(mail) mms.process do |type, files| assert_equal 1, files.size assert_equal true, type == 'image/jpeg' assert_equal true, File.basename(files.first) == 'Photo_12.jpg' assert_equal true, File::exist?(files.first) end mms.purge end def test_domain_from_return_path mail = mock() mail.expects(:from).at_least_once.returns([]) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'null.example.com', domain end def test_domain_from_from mail = mock() mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'null.example.com', domain end def test_domain_from_from_yaml f = File.join(MMS2R::Media.conf_dir, 'from.yml') YAML.expects(:load_file).once.with(f).returns(['example.com']) mail = mock() mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'example.com', domain end def test_unknown_device_type mail = mail('generic.mail') mms = MMS2R::Media.new(mail) assert_equal :unknown, mms.device_type? assert_equal false, mms.is_mobile? end def test_iphone_device_type_by_header iphones = ['att-iphone-01.mail', 'iphone-image-01.mail'] iphones.each do |iphone| mail = mail(iphone) mms = MMS2R::Media.new(mail) assert_equal :iphone, mms.device_type?, "fixture #{iphone} was not a iphone" assert_equal true, mms.is_mobile? end end def test_exif mail = smart_phone_mock mms = MMS2R::Media.new(mail) assert_equal 'iPhone', mms.exif.model end def test_iphone_device_type_by_exif mail = smart_phone_mock mms = MMS2R::Media.new(mail) assert_equal :iphone, mms.device_type? assert_equal true, mms.is_mobile? end def test_faux_tiff_iphone_device_type_by_exif mail = smart_phone_mock('Apple', 'iPhone', nil, jpeg = false) mms = MMS2R::Media.new(mail) assert_equal :iphone, mms.device_type? assert_equal true, mms.is_mobile? end def test_iphone_device_type_by_filename_jpg mail = smart_phone_mock('Hipstamatic', '201') mms = MMS2R::Media.new(mail) assert_equal :apple, mms.device_type? assert_equal true, mms.is_mobile? end def test_iphone_device_type_by_filename_png mail = mail('iphone-image-02.mail') mms = MMS2R::Media.new(mail) assert_equal true, mms.is_mobile? assert_equal :iphone, mms.device_type? end def test_blackberry_device_type_by_exif_make_model mail = smart_phone_mock('Research In Motion', 'BlackBerry') mms = MMS2R::Media.new(mail) assert_equal :blackberry, mms.device_type? assert_equal true, mms.is_mobile? end def test_blackberry_device_type_by_exif_software mail = smart_phone_mock(nil, nil, "Rim Exif Version1.00a") mms = MMS2R::Media.new(mail) assert_equal :blackberry, mms.device_type? assert_equal true, mms.is_mobile? end def test_dash_device_type_by_exif mail = smart_phone_mock('T-Mobile Dash', 'T-Mobile Dash') mms = MMS2R::Media.new(mail) assert_equal :dash, mms.device_type? assert_equal true, mms.is_mobile? end def test_droid_device_type_by_exif mail = smart_phone_mock('Motorola', 'Droid') mms = MMS2R::Media.new(mail) assert_equal :droid, mms.device_type? assert_equal true, mms.is_mobile? end def test_htc_eris_device_type_by_exif mail = smart_phone_mock('HTC', 'Eris') mms = MMS2R::Media.new(mail) assert_equal :htc, mms.device_type? assert_equal true, mms.is_mobile? diff --git a/test/test_mms_att_net.rb b/test/test_mms_att_net.rb index 99b47c6..4c13f35 100644 --- a/test/test_mms_att_net.rb +++ b/test/test_mms_att_net.rb @@ -1,150 +1,150 @@ require "test_helper" class TestMmsAttNet < Test::Unit::TestCase include MMS2R::TestHelper def test_mms_att_net # mms.att.net service mail = mail('att-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal "12068675309", mms.number assert_equal "mms.att.net", mms.carrier assert_equal 1, mms.media.size assert_not_nil mms.media['image/jpeg'] assert_equal 1, mms.media['image/jpeg'].size assert_not_nil mms.media['image/jpeg'].first assert_match(/Photo_12.jpg$/, mms.media['image/jpeg'][0]) assert_file_size(mms.media['image/jpeg'][0], 337) mms.purge end def test_mms_att_net_subject # mms.att.net service mail = mail('att-image-02.mail') mms = MMS2R::Media.new(mail) assert_equal "12068675309", mms.number assert_equal "mms.att.net", mms.carrier assert_equal "", mms.subject mms.purge end def test_txt_att_net # txt.att.net service mail = mail('att-text-01.mail') mms = MMS2R::Media.new(mail) assert_equal "5551234", mms.number assert_equal "txt.att.net", mms.carrier assert_equal 1, mms.media.size assert_not_nil(mms.media['text/plain']) assert_equal "Hello World", IO.read(mms.media['text/plain'][0]) mms.purge end def test_cingularme_com # cingularme.com service mail = mail('cingularme-text-01.mail') mms = MMS2R::Media.new(mail) assert_equal "2068675309", mms.number assert_equal "cingularme.com", mms.carrier assert_equal 1, mms.media.size assert_not_nil(mms.media['text/plain']) assert_equal "hello world", IO.read(mms.media['text/plain'][0]) mms.purge end def test_mmode_com # mmode.com service mail = mail('mmode-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal "12068675309", mms.number assert_equal "mmode.com", mms.carrier assert_equal 1, mms.media.size assert_not_nil mms.media['image/jpeg'] assert_equal 1, mms.media['image/jpeg'].size assert_not_nil mms.media['image/jpeg'].first assert_match(/picture\(3\).jpg$/, mms.media['image/jpeg'][0]) assert_file_size(mms.media['image/jpeg'][0], 337) mms.purge end def test_mms_mycingular_com # mms.mycingular.com service mail = mail('mycingular-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal "2068675309", mms.number assert_equal "mms.mycingular.com", mms.carrier assert_equal 2, mms.media.size assert_not_nil mms.media['text/plain'] assert_not_nil mms.media['text/plain'][0] assert_equal 1, mms.media['text/plain'].size assert_not_nil mms.media['image/jpeg'] assert_not_nil mms.media['image/jpeg'][0] assert_equal 1, mms.media['image/jpeg'].size assert_not_nil mms.media['image/jpeg'].first assert_match(/04-18-07_1723.jpg$/, mms.media['image/jpeg'][0]) assert_file_size(mms.media['image/jpeg'][0], 337) assert_equal "Water", IO.read(mms.media['text/plain'][0]) mms.purge end def test_image_from_blackberry mail = mail('att-blackberry.mail') mms = MMS2R::Media.new(mail) assert_equal "2068675309", mms.number assert_equal "example.com", mms.carrier assert_not_nil mms.media['text/plain'] - assert_equal "Hello world", IO.readlines(mms.media['text/plain'].first).join.strip + assert_equal "Hello world", IO.read(mms.media['text/plain'].first).strip assert_not_nil mms.media['image/jpeg'].first assert_match(/\/BC-WAKE\.jpg$/, mms.media['image/jpeg'].first) end def test_image_from_blackberry2 mail = mail('att-blackberry-02.mail') mms = MMS2R::Media.new(mail) assert_equal "2068675309", mms.number assert_equal "mms.att.net", mms.carrier assert_equal 2, mms.media.size assert_not_nil mms.media['text/plain'] - assert_match(/^Testing memorymail from my blackberry and at&t.$/, IO.readlines(mms.media['text/plain'].first).join.strip) + assert_match(/^Testing memorymail from my blackberry and at&t.$/, IO.read(mms.media['text/plain'].first).strip) assert_not_nil mms.media['image/jpeg'].first assert_match(/IMG00367.jpg/, mms.media['image/jpeg'].first) end def test_mobile_mycingular_com # mobile.mycingular.com service mail = mail('mobile.mycingular.com-text-01.mail') mms = MMS2R::Media.new(mail) assert_equal "2068675309", mms.number assert_equal "mobile.mycingular.com", mms.carrier assert_equal 1, mms.media.size assert_not_nil(mms.media['text/plain']) assert_equal "I hate people that send text messages about skateboarding.", IO.read(mms.media['text/plain'][0]) mms.purge end def test_pics_cingularme_com # pics.cingularme.com service mail = mail('pics.cingularme.com-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal "2068675309", mms.number assert_equal "pics.cingularme.com", mms.carrier mms.purge end end diff --git a/test/test_mms_mycricket_com.rb b/test/test_mms_mycricket_com.rb index 4b02c1f..7cf467f 100644 --- a/test/test_mms_mycricket_com.rb +++ b/test/test_mms_mycricket_com.rb @@ -1,60 +1,60 @@ require "test_helper" class TestMmsMycricketCom < Test::Unit::TestCase include MMS2R::TestHelper def test_subject # mms.mycricket.com service mail = mail('mms.mycricket.com-pic.mail') mms = MMS2R::Media.new(mail) assert_equal "2068675309", mms.number assert_equal "mms.mycricket.com", mms.carrier assert_equal "", mms.subject mms.purge end def test_image # mms.mycricket.com service mail = mail('mms.mycricket.com-pic.mail') mms = MMS2R::Media.new(mail) assert_equal "2068675309", mms.number assert_equal "mms.mycricket.com", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_equal 1, mms.media['image/jpeg'].size assert_not_nil mms.media['image/jpeg'].first assert_match(/10-26-07_1739.jpg$/, mms.media['image/jpeg'].first) assert_file_size mms.media['image/jpeg'].first, 337 mms.purge end def test_image_and_text # mms.mycricket.com service mail = mail('mms.mycricket.com-pic-and-text.mail') mms = MMS2R::Media.new(mail) assert_equal "2068675309", mms.number assert_equal "mms.mycricket.com", mms.carrier assert_equal 2, mms.media.size assert_nil mms.media['text/html'] assert_equal 1, mms.media['text/plain'].size assert_equal 1, mms.media['image/jpeg'].size assert_not_nil mms.media['text/plain'].first assert_not_nil mms.media['image/jpeg'].first file = mms.media['text/plain'].first assert_equal true, File::exist?(file), "file #{file} does not exist" - text = IO.readlines("#{file}").join + text = IO.read("#{file}") assert_match(/Hello World/, text) assert_match(/02-14-08_2114.jpg$/, mms.media['image/jpeg'].first) assert_file_size mms.media['image/jpeg'].first, 337 mms.purge end end diff --git a/test/test_mms_uscc_net.rb b/test/test_mms_uscc_net.rb index 2465e75..7d26146 100644 --- a/test/test_mms_uscc_net.rb +++ b/test/test_mms_uscc_net.rb @@ -1,33 +1,33 @@ require "test_helper" class TestMmsUsccNet < Test::Unit::TestCase include MMS2R::TestHelper def test_mms_uscc_net # mms.uscc.net service mail = mail('us-cellular-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal "5418675309", mms.number assert_equal "mms.uscc.net", mms.carrier assert_equal "", mms.subject assert_equal 2, mms.media.size assert_nil mms.media['text/html'] assert_nil mms.media['image/gif'] assert_not_nil mms.media['image/jpeg'] assert_equal 1, mms.media['image/jpeg'].size assert_match(/0315001513.jpg$/, mms.media['image/jpeg'].first) assert_file_size(mms.media['image/jpeg'].first, 337) assert_not_nil mms.media['text/plain'] file = mms.media['text/plain'][0] assert_not_nil file assert_equal true, File::exist?(file) - text = IO.readlines("#{file}").join + text = IO.read("#{file}") assert_match(/This is what i do at work most the day/, text) mms.purge end end diff --git a/test/test_orangemms_net.rb b/test/test_orangemms_net.rb index b1ef1c4..7cdd0e0 100644 --- a/test/test_orangemms_net.rb +++ b/test/test_orangemms_net.rb @@ -1,108 +1,108 @@ require "test_helper" class TestOrangemmsNet < Test::Unit::TestCase include MMS2R::TestHelper def test_orangemms_subject # orangemms.net service mail = mail('orange-uk-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal "5551234", mms.number assert_equal "orangemms.net", mms.carrier assert_equal "", mms.subject mms.purge end def test_orangemms_image # orangemms.net service mail = mail('orange-uk-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal "5551234", mms.number assert_equal "orangemms.net", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_not_nil mms.media['image/jpeg'][0] assert_match(/picture.jpg$/, mms.media['image/jpeg'][0]) assert_file_size mms.media['image/jpeg'][0], 337 mms.purge end def test_orange_france_subject # orange.fr service mail = mail('orangefrance-text-and-image.mail') mms = MMS2R::Media.new(mail) assert_equal "0688675309", mms.number assert_equal "orange.fr", mms.carrier assert_equal "", mms.subject mms.purge end def test_orange_france_processed_content # orange.fr service mail = mail('orangefrance-text-and-image.mail') mms = MMS2R::Media.new(mail) assert_equal "0688675309", mms.number assert_equal "orange.fr", mms.carrier # there should be one text and one image assert_equal 2, mms.media.size #text # there is a text banner that Orange attaches but # that should be ignored assert_not_nil mms.media['text/plain'] assert_equal 1, mms.media['text/plain'].size file = mms.media['text/plain'].first assert File::exist?(file), "file #{file} does not exist" - text = IO.readlines("#{file}").join + text = IO.read("#{file}") assert_match(/Test ma poule/, text) # image assert_not_nil mms.media['image/jpeg'] assert_equal 1, mms.media['image/jpeg'].size assert_match(/IMAGE.jpeg$/, mms.media['image/jpeg'].first) assert_file_size mms.media['image/jpeg'].first, 337 mms.purge end def test_orange_poland_subject # mmsemail.orange.pl service mail = mail('orangepoland-text-01.mail') mms = MMS2R::Media.new(mail) assert_equal "48508675309", mms.number assert_equal "mmsemail.orange.pl", mms.carrier assert_equal "", mms.subject mms.purge end def test_orange_poland_non_empty_subject # mmsemail.orange.pl service mail = mail('orangepoland-text-02.mail') mms = MMS2R::Media.new(mail) assert_equal "48508675309", mms.number assert_equal "mmsemail.orange.pl", mms.carrier assert mms.subject, "whazzup" mms.purge end def test_orange_poland_content # mmsemail.orange.pl service mail = mail('orangepoland-text-01.mail') mms = MMS2R::Media.new(mail) assert_equal "48508675309", mms.number assert_equal "mmsemail.orange.pl", mms.carrier assert_not_nil mms.media['text/plain'] file = mms.media['text/plain'][0] assert_not_nil file assert File::exist?(file), "file #{file} does not exist" - text = IO.readlines("#{file}").join + text = IO.read("#{file}") assert_match(/pozdro600/, text) mms.purge end end diff --git a/test/test_pm_sprint_com.rb b/test/test_pm_sprint_com.rb index 8bd31e0..c584717 100644 --- a/test/test_pm_sprint_com.rb +++ b/test/test_pm_sprint_com.rb @@ -1,319 +1,319 @@ require "test_helper" class TestPmSprintCom < Test::Unit::TestCase include MMS2R::TestHelper def mock_sprint_image(message_id) response = mock('response') body = mock('body') connection = mock('connection') response.expects(:content_type).twice.returns('image/jpeg') response.expects(:body).returns(body) response.expects(:code).never Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection connection.expects(:get2).with( # 1.9.2 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90&ext=.jpg&iconifyVideo=true&wm=1' # 1.8.7 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&outquality=90&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU' kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).once.returns(response) end def mock_sprint_purged_image(message_id) response = mock('response') body = mock('body') connection = mock('connection') response.expects(:content_type).once.returns('text/html') response.expects(:body).returns(body) response.expects(:code).once.returns('500') Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection connection.expects(:get2).with( # 1.9.2 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90&ext=.jpg&iconifyVideo=true&wm=1' # 1.8.7 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&outquality=90&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU' kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).once.returns(response) end def mock_sprint_ajax response = mock('response') body = mock('body') # this is a response from a real sprint message file = File.open("./test/fixtures/sprint-ajax-response-success.json", "rb") json = file.read body.expects(:to_str).returns json connection = mock('connection') connection.stubs(:use_ssl=).returns(true) response.expects(:body).twice.returns(body) response.expects(:code).once.returns('200') response.expects(:content_type).twice.returns('text/html') Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).twice.returns connection connection.expects(:get2).with( # 1.9.2 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90&ext=.jpg&iconifyVideo=true&wm=1' # 1.8.7 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&outquality=90&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU' kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).twice.returns(response) end def mock_sprint_ajax_purged response = mock('response') body = mock('body') # this is a response from a real sprint message file = File.open("./test/fixtures/sprint-ajax-response-failure.html", "rb") error_html = file.read body.expects(:to_str).returns error_html connection = mock('connection') connection.stubs(:use_ssl=).returns(true) response.expects(:body).twice.returns(body) response.expects(:code).once.returns('500') response.expects(:content_type).once.returns('text/html') Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).twice.returns connection connection.expects(:get2).with( # 1.9.2 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90&ext=.jpg&iconifyVideo=true&wm=1' # 1.8.7 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&outquality=90&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU' kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).twice.returns(response) end def test_mms_should_have_text mail = mail('sprint-text-01.mail') mms = MMS2R::Media.new(mail) assert_equal "2068765309", mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_equal 1, mms.media['text/plain'].size file = mms.media['text/plain'].first assert_equal true, File.exist?(file) assert_match(/\.txt$/, File.basename(file)) assert_equal "Tea Pot", IO.read(file) mms.purge end def test_mms_should_have_a_phone_number mail = mail('sprint-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier mms.purge end def test_should_have_simple_video mail = mail('sprint-video-01.mail') response = mock('response') body = mock('body') connection = mock('connection') response.expects(:content_type).twice.returns('video/quicktime') response.expects(:body).returns(body) response.expects(:code).never Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection connection.expects(:get2).with( kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).once.returns(response) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_not_nil mms.media['video/quicktime'] assert_equal 1, mms.media['video/quicktime'].size assert_equal "000_259e41e851be9b1d_1-0.mov", File.basename(mms.media['video/quicktime'][0]) mms.purge end def test_should_have_simple_image mail = mail('sprint-image-01.mail') mock_sprint_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_not_nil mms.media['image/jpeg'][0] assert_match(/001_2066c7013e7ca833_1-0.jpg$/, mms.media['image/jpeg'][0]) mms.purge end def test_collect_image_using_block mail = mail('sprint-image-01.mail') mock_sprint_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size file_array = nil mms.process do |k, v| file_array = v if (k == 'image/jpeg') assert_equal 1, file_array.size file = file_array.first assert_not_nil file = file_array.first assert_equal "001_2066c7013e7ca833_1-0.jpg", File.basename(file) end mms.purge end def test_process_internals_should_only_be_executed_once mail = mail('sprint-image-01.mail') mock_sprint_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size # second time through shouldn't go into the was_processed block mms.mail.expects(:parts).never mms.process{|k, v| } mms.purge end def test_should_have_two_images mail = mail('sprint-two-images-01.mail') response = mock('response') body = mock('body') connection = mock('connection') response.expects(:content_type).times(4).returns('image/jpeg') response.expects(:body).twice.returns(body) response.expects(:code).never Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).twice.returns connection connection.expects(:get2).with( kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).twice.returns(response) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_equal 2, mms.media['image/jpeg'].size assert_not_nil mms.media['image/jpeg'][0] assert_not_nil mms.media['image/jpeg'][1] assert_match(/001_104058d23d79fb6a_1-0.jpg$/, mms.media['image/jpeg'][0]) assert_match(/001_104058d23d79fb6a_1-1.jpg$/, mms.media['image/jpeg'][1]) mms.purge end def test_image_should_be_missing # this test is questionable mail = mail('sprint-broken-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 0, mms.media.size mms.purge end def test_message_is_missing_in_mail # this test is questionable mail = mail('sprint-image-missing-message.mail') mock_sprint_ajax mms = MMS2R::Media.new(mail) assert_equal 2, mms.media['text/plain'].size # test that the message was extracted from the ajax response - message = IO.readlines(mms.media['text/plain'].first).join("") + message = IO.read(mms.media['text/plain'].first) assert_equal "First text content.", message # test that the &nbsp; was removed () assert message.last.bytes.to_a != [194, 160] mms.purge end def test_message_is_missing_in_mail_purged_from_content_server # this test is questionable mail = mail('sprint-image-missing-message.mail') mock_sprint_ajax_purged mms = MMS2R::Media.new(mail) assert_equal '5135455555', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 0, mms.media.size mms.purge end def test_image_should_be_purged_from_content_server mail = mail('sprint-image-01.mail') mock_sprint_purged_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 0, mms.media.size mms.purge end def test_body_should_return_empty_when_there_is_no_user_text mail = mail('sprint-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal "", mms.body end def test_sprint_write_file mail = mock(:message_id => 'a') mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') mms = MMS2R::Media.new(mail, :process => :lazy) type = 'text/plain' content = 'foo' file = Tempfile.new('sprint') file.close type, file = mms.send(:sprint_write_file, type, content, file.path) assert_equal 'text/plain', type assert_equal content, IO.read(file) end def test_subject mail = mail('sprint-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal "", mms.subject end def test_new_subject mail = mail('sprint-new-image-01.mail') mock_sprint_ajax mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal "", mms.subject end end diff --git a/test/test_pxt_vodafone_net_nz.rb b/test/test_pxt_vodafone_net_nz.rb index 1cb346f..3e9e0ae 100644 --- a/test/test_pxt_vodafone_net_nz.rb +++ b/test/test_pxt_vodafone_net_nz.rb @@ -1,33 +1,33 @@ require "test_helper" class TestPxtVodafoneNetNz < Test::Unit::TestCase include MMS2R::TestHelper def setup mail = mail('pxt-image-01.mail') @mms = MMS2R::Media.new(mail) assert_equal '+55512345', @mms.number assert_equal 'pxt.vodafone.net.nz', @mms.carrier end def teardown @mms.purge end def test_pxt_text_returns_text_plain assert_not_nil(@mms.media['text/plain']) file = @mms.media['text/plain'][0] assert_not_nil(file) assert(File::exist?(file), "file #{file} does not exist") - text = IO.readlines("#{file}").join + text = IO.read("#{file}") assert_match(/Kia ora ano Luke/, text) assert_match(/Kia ora ano Luke/, @mms.body) end def test_subject_should_clear_default_pxt_message assert_equal "", @mms.subject end end diff --git a/test/test_tmomail_net.rb b/test/test_tmomail_net.rb index d0f79e9..f3691f6 100644 --- a/test/test_tmomail_net.rb +++ b/test/test_tmomail_net.rb @@ -1,110 +1,110 @@ require "test_helper" class TestTmomailNet < Test::Unit::TestCase include MMS2R::TestHelper def test_ignore_simple_image mail = mail('tmobile-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal "2068675309", mms.number assert_equal "tmomail.net", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_not_nil mms.media['image/jpeg'][0] assert_match(/12-01-06_1234.jpg$/, mms.media['image/jpeg'][0]) assert_file_size mms.media['image/jpeg'][0], 337 mms.purge end def test_message_with_body_text mail = mail('tmobile-image-02.mail') mms = MMS2R::Media.new(mail) assert_equal "16128675309", mms.number assert_equal "tmomail.net", mms.carrier assert_equal 2, mms.media.size assert_not_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_not_nil mms.media['image/jpeg'][0] assert_match(/07-25-05_0935.jpg$/, mms.media['image/jpeg'][0]) assert_file_size mms.media['image/jpeg'][0], 337 file = mms.media['text/plain'][0] assert_not_nil file assert File::exist?(file), "file #{file} does not exist" - text = IO.readlines("#{file}").join + text = IO.read("#{file}") assert_equal "Lillies", text.strip mms.purge end def test_image_from_blackberry mail = mail('tmobile-blackberry.mail') mms = MMS2R::Media.new(mail) assert_equal "2068675309", mms.number assert_equal "srs.bis.na.blackberry.com", mms.carrier assert_nil mms.media['text/plain'] assert_not_nil mms.media['image/jpeg'].first assert_match(/\/IMG00239\.jpg$/, mms.media['image/jpeg'].first) mms.purge end def test_image_from_blackberry2 mail = mail('tmobile-blackberry-02.mail') mms = MMS2R::Media.new(mail) assert_equal "2068675309", mms.number assert_equal "example.com", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_not_nil mms.media['image/jpeg'].first assert_match(/\/IMG00141\.jpg$/, mms.media['image/jpeg'].first) mms.purge end def test_tmobile_uk_image_and_text_and_number mail = mail('mmsreply.t-mobile.co.uk-text-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '12345678901', mms.number assert_equal 'mmsreply.t-mobile.co.uk', mms.carrier assert_equal 2, mms.media.size assert_equal 1, mms.media['image/jpeg'].size assert_equal 1, mms.media['text/plain'].size assert_equal "Do you know this office? Do you know this office? Do \nyou know this office? Do you know this office?", mms.default_text.read assert_file_size mms.media['image/jpeg'][0], 337 file = mms.default_media assert_equal 'Image002.jpg', file.original_filename mms.purge end def test_tmo_blackberry_net mail = mail('tmo.blackberry.net-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal 'IMG00440.jpg', mms.subject assert_equal 'tmo.blackberry.net', mms.carrier assert_equal 1, mms.media.size assert_equal 1, mms.media['image/jpeg'].size assert_file_size mms.media['image/jpeg'][0], 337 file = mms.default_media assert_equal 'IMG00440.jpg', file.original_filename mms.purge end end diff --git a/test/test_unicel_com.rb b/test/test_unicel_com.rb index c4d971e..983babd 100644 --- a/test/test_unicel_com.rb +++ b/test/test_unicel_com.rb @@ -1,45 +1,45 @@ require "test_helper" class TestUnicelCom < Test::Unit::TestCase include MMS2R::TestHelper def test_subject_number_image_unicel mail = mail('unicel-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal "joeexample", mms.number assert_equal "unicel.com", mms.carrier assert_equal "", mms.subject assert_equal 2, mms.media.size assert_equal 1, mms.media['text/plain'].size assert_equal 1, mms.media['image/jpeg'].size image = mms.media['image/jpeg'].detect{|f| /moto_0002\.jpg/ =~ f} assert_equal 337, File.size(image) file = mms.media['text/plain'][0] - text = IO.readlines("#{file}").join + text = IO.read("#{file}") assert_match(/2068675309/, text) mms.purge end def test_subject_number_image_info2go mail = mail('info2go-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal "", mms.subject assert_equal "2068675309", mms.number assert_equal "info2go.com", mms.carrier assert_equal 1, mms.media.size assert_equal 1, mms.media['image/jpeg'].size image = mms.media['image/jpeg'].detect{|f| /Image047\.jpeg/ =~ f} assert_equal 337, File.size(image) mms.purge end end diff --git a/test/test_vzwpix_com.rb b/test/test_vzwpix_com.rb index ba084cc..80ca14b 100644 --- a/test/test_vzwpix_com.rb +++ b/test/test_vzwpix_com.rb @@ -1,161 +1,161 @@ require "test_helper" class TestVzwpixCom < Test::Unit::TestCase include MMS2R::TestHelper def setup @ad_new = fixture_data('ad_new.txt') @ad_old = %q{This message was sent using PIX-FLIX Messaging service from Verizon Wireless! To learn how you can snap pictures with your wireless phone visit www.verizonwireless.com/getitnow/getpix.} @greet = "This message was sent using PIX-FLIX Messaging service from Verizon Wireless!" end def test_simple_video # vzwpix.com service mail = mail('verizon-video-01.mail') mms = MMS2R::Media.new(mail) assert_equal "2068675309", mms.number assert_equal 'vzwpix.com', mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_not_nil mms.media['video/3gpp2'][0] assert_match(/012345_67890.3g2$/, mms.media['video/3gpp2'][0]) assert_file_size mms.media['video/3gpp2'][0], 16553 mms.purge end def test_simple_image # vzwpix.com service mail = mail('verizon-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal "2068675309", mms.number assert_equal 'vzwpix.com', mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_not_nil mms.media['image/jpeg'][0] assert_match(/IMAGE_00004.jpg$/, mms.media['image/jpeg'][0]) assert_file_size mms.media['image/jpeg'][0], 337 mms.purge end def test_simple_image_new_message_april_2008 # vzwpix.com service mail = mail('verizon-image-03.mail') mms = MMS2R::Media.new(mail) assert_equal "2068675309", mms.number assert_equal 'vzwpix.com', mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_not_nil mms.media['image/jpeg'][0] assert_match(/0414082054.jpg$/, mms.media['image/jpeg'][0]) assert_file_size mms.media['image/jpeg'][0], 337 mms.purge end def test_simple_text # vzwpix.com service mail = mail('verizon-text-01.mail') mms = MMS2R::Media.new(mail) assert_equal "2068675309", mms.number assert_equal 'vzwpix.com', mms.carrier assert_equal 1, mms.media.size assert_not_nil mms.media['text/plain'] file = mms.media['text/plain'][0] assert_not_nil file assert_equal true, File::exist?(file) - text = IO.readlines("#{file}").join + text = IO.read("#{file}") assert_match(/hello world/, text) mms.purge end def test_image_with_body_text # vzwpix.com service mail = mail('verizon-image-02.mail') mms = MMS2R::Media.new(mail) assert_equal "7018675309", mms.number assert_equal 'vzwpix.com', mms.carrier assert_equal 2, mms.media.size assert_not_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_not_nil mms.media['image/jpeg'][0] assert_match(/04-09-07_1114.jpg$/, mms.media['image/jpeg'][0]) assert_file_size mms.media['image/jpeg'][0], 337 file = mms.media['text/plain'][0] assert_not_nil file assert_equal true, File::exist?(file) - text = IO.readlines("#{file}").join + text = IO.read("#{file}") assert_no_match(/Regexp.escape(@ad_old)/, text) assert_no_match(/Regexp.escape@greet/, text) assert_equal "? Weird", text mms.purge end def test_new_vzpix_com_image_with_body_text # vzwpix.com service mail = mail('vzwpix.com-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal "2068675309", mms.number assert_equal 'vzwpix.com', mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_not_nil mms.media['image/jpeg'][0] assert_match(/0827092137.jpg$/, mms.media['image/jpeg'][0]) assert_file_size mms.media['image/jpeg'][0], 337 mms.purge end def test_simple_text_vtext # vtext.com service mail = mail('vtext-text-01.mail') mms = MMS2R::Media.new(mail) assert_equal "2068675309", mms.number assert_equal 'vtext.com', mms.carrier assert_not_nil mms.media['text/plain'] file = mms.media['text/plain'][0] assert_not_nil file assert_equal true, File::exist?(file) - text = IO.readlines("#{file}").join + text = IO.read("#{file}") assert_match(/hello world/, text) mms.purge end def test_image_from_blackberry mail = mail('verizon-blackberry.mail') mms = MMS2R::Media.new(mail) assert_equal "2068675309", mms.number assert_equal 'yahoo.com', mms.carrier assert_not_nil mms.media['text/plain'] - assert_equal "Wonderful picture!", IO.readlines(mms.media['text/plain'].first).join.strip + assert_equal "Wonderful picture!", IO.read(mms.media['text/plain'].first).strip assert_not_nil mms.media['image/jpeg'].first assert_match(/\/IMG00016\.jpg$/, mms.media['image/jpeg'].first) mms.purge end end
monde/mms2r
a7b2d34867925706bc5c77790f439e53f4b8e228
prep for 3.8.2 release
diff --git a/Gemfile.lock b/Gemfile.lock index 16d3b99..02c06fd 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,48 +1,48 @@ PATH remote: . specs: - mms2r (3.8.1) + mms2r (3.8.2) exifr (>= 1.0.3) json (>= 1.6.0) mail (>= 2.4.0) nokogiri (>= 1.5.0) rake (= 0.9.2.2) GEM remote: https://rubygems.org/ specs: exifr (1.1.3) i18n (0.6.0) json (1.7.3) mail (2.4.4) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) metaclass (0.0.1) mime-types (1.19) mocha (0.11.4) metaclass (~> 0.0.1) multi_json (1.3.5) nokogiri (1.5.5) polyglot (0.3.3) rake (0.9.2.2) rdoc (3.12) json (~> 1.4) simplecov (0.6.4) multi_json (~> 1.0) simplecov-html (~> 0.5.3) simplecov-html (0.5.3) test-unit (2.4.8) treetop (1.4.10) polyglot polyglot (>= 0.3.1) PLATFORMS ruby DEPENDENCIES mms2r! mocha rdoc simplecov test-unit diff --git a/History.txt b/History.txt index 59a6b35..32744d5 100644 --- a/History.txt +++ b/History.txt @@ -1,450 +1,456 @@ +### 3.8.2 / 2012-08-21 (Seth - Pickles The Drummer's brother) + +* 2 minor enhancements + * Broadened handling of generic "Sent from" footers in smart phones + * Add ability to process HTC Sensation footer + ### 3.8.1 / 2012-07-22 (Calvert - Pickles The Drummer's dad) * 1 major enhancement * Support for Cincinnati Bell - mms.gocbw.com - James McGrath ### 3.8.0 / 2012-07-04 (Dr. Donald Gorfield – Comedy specialist) * 1 major enhancement * Handle MMS from Sprint that have their media attached rather than CDN'd ### 3.7.1 / 2012-06-04 (Abrigail Remeltindtdrinc - The Record Cleaner) * 2 minor enhancements * Improve processing of Sprint media - James McGrath * RDoc format documentation - James McGrath ### 3.7.0 / 2012-05-31 (The Teenager - Edgar's brother via Eric's face) * 2 major enhancements * Improve processing of Sprint media - James McGrath * Remove Hoe and gemcutter dependencies ### 3.6.4 / 2012-04-22 (Molly - Pickles' mother) * 1 minor enhancement * strip a variation of the iphone default footer ### 3.6.3 / 2012-03-25 (Dethklok Minute Host - host of The Dethklok Minute) * 1 minor enhancement * strip Windows phone default footer ### 3.6.2 / 2012-02-12 (Mr. Gojira - Owner Mr. Gojira's Driving School - retake driver's exam) * 1 minor enhancement * Change user agent given to Sprint so it returns a properly sized image. ### 3.6.1 / 2012-02-11 (Mr. Gojira - Owner Mr. Gojira's Driving School) * 1 minor enhancement * use Net::HTTP#get2 to fetch Sprint content ### 3.6.0 / 2012-01-19 (Agent 216 - assassin, master of infiltration and sabotage) * 1 major enhancement * Ruby 1.8.7, 1.9.2, and 1.9.3 compatible * 1 bug fix * A fix for the utf-8 encoding issue with ruby 1.9.2 - minimul / Christian ### 3.5.1 / 2011-12-11 (Mashed Potato Johnson - oldest living blues guitarist in the world) * 1 bug fix * A fix for the utf-8 encoding issue with ruby 1.9.2 - James McGrath ### 3.5.0 / 2011-12-01 (Dr. Milminiman Lamilim Swimwambli - Marriage expert) * 1 major bug fix * In Ruby 1.9.X MMS2R::Media::Sprint was not fetching content from Sprint's CDN correctly because the implementation of Net::HTTP in 1.9.X passes a User-Agent header of "Ruby" to which Sprint responds with a fake 500 - with help from James McGrath ### 3.4.1 / 2011-11-06 (Fatty Ding-Dongs, Dethklok foster child) * 2 major enhancements * Additional means to detect android, iphone, motorola, nokia, palm handsets * Additional known SMS/MMS domains mm.att.net, labwig.net, cdma.sasktel.com ### 3.4.0 / 2011-10-31 (Serveta Skwigelf, Skwisgaar's hot mom) * 2 major enhancements * regexp's in yaml configs are store as a ruby regexp and not a string that is evaled. * character encoding capability with 1.8 rubies and 1.9 rubies. ### 3.3.1 / 2011-01-01 (Reverend Aslaug Wartooth (deceased), Toki's dad) * 2 minor enhancements * new method #default_html returns the default html attachment * #body will return the default plain text, or default stripped html text ### 3.3.0 / 2010-12-31 (Charles Foster Offdensen - CFO, dethklok) * 1 major enhancement * MMS2R::Media::Sprint is now a module that is extended in for processing Sprint content rather than being child class of MMS2R::Media Extension is the strategy to use for overwriting template methods now * 1 minor enhancement * process new Sprint subject - Jason Hooper * new SaskTel mms/sms domain alias sasktel.com * new Virgin Mobile mms/sms domain alias yrmobl.com ### 3.2.0 / 2010-08-17 (Antonio "Tony" DiMarco Thunderbottom - bassist) * 3 minor enhancements * updated readme with latest sites known to use mms2r * bundler assimilated * loading rubygems only if it's required, like rake ### 3.1.0 / 2010-07-09 (Dick "Magic Ears" Knubbler - music producer) * 8 minor enhancements * Detects additional Bell/AT&T domain sbcglobal.net as a handset * Detects additional Virgin mobile domains pixmbl.com vmobl.com as a handset * Expanded mobile phone detection for handset makers by : Casio, Google Nexus One, LG Electronics, Motorola, Pantech, Qualcom, Samsung, Sprint, UTStarCom * EXIF Reader (exifr) is integral to MMS2R and is now a required gem * upgrade Mail to 2.2.5 * depend on latest gems * corrected example - Jason Hooper * added As Seen On The Internet to README that lists sites known to be using MMS2R in some fashion ### 3.0.1 / 2010-03-28 (Lavona Succuboso - leader of "Succuboso Explosion") * 1 minor enhancement * support for U.S. Cellular ### 3.0.0 / 2010-02-24 (General Crozier - Chairman of the Joint Chiefs of Staff) * 1 new feature * dependence upon Mail gem rather than TMail gem ### 2.4.1 / 2010-02-07 (Vater Orlaag - political and spiritual specialist) * 3 minor enhancements * make sure filename is free of new lines - laurynas * recognize HTC HERO200 as a smart phone * recognize HTC Eris as a smart phone ### 2.4.0 / 2009-12-20 (Dr. Nanemiltred Philtendrieden - specialist on celebrity death) * 1 new feature * replace Hpricot with Nokogiri for html parsing of Sprint data * 3 minor enhancements * smartphone identities stored in conf/mms2r_media.yml * identify Motorola Droid as a smartphone * identify T-Mobile Dash as a smartphone * use uuidtools for naming temp directories - kbaum ### 2.3.0 / 2009-08-30 (Snakes 'n' Barrels Greatest Hits) * 5 new features * detect smartphone status/type based on model metadata from jpeg and tiff exif data using exifr gem, access exif data with MMS2R::Media#exif * make MMS2R Rails gem packaging friendly with an init.rb - Scott Taylor, smtlaissezfaire * delegate missing methods to mms2r's tmail object so that mms2r behaves as if it were a tmail object - Sai Emrys, saizai * default_media can return an attachment of application content type - Brendan Lim, brendanlim * MMS2R.parse(raw_mail) convenience class method that parses and returns an mms2r from a mail file - saizai * 4 minor enhancements * make examples more 'mail' specific to enforce the fact that an mms is a multipart email - saizai * update for text in vzwpix.com default carrier message * detecting smartphone (blackberries and iphones for now) is more versatile from reading mail headers * expanded filtering of carrier advertising text in mms from smartphones ### 2.2.0 / 2009-01-04 (Rikki Kixx - owner of a franchise of rehab centers) * 3 new features * MMS2R::Media#is_mobile? best guess if the sender was a mobile device * MMS2R::Media#device_type? best guess of the mobile device type. Simple heuristics thus far for :blackberry :iphone :handset :unknown could be expanded for exif probing or additinal shifting of mail header * from array in conf/from.yml to provide granularity to determine carrier domain (caused by tmo.blackberry.net) * 4 minor enhancements * support for Virgin Canada messaging service vmobile.ca * support for text service messaging.sprintpcs.com * additional BlackBerry coverage from T-Mobile tmo.blackberry.net provider * legacy support for mobile.mycingular.com, pics.cingularme.com * 3 bug fixes * iPhone default subject - jesse dp http://rubyforge.org/tracker/?func=detail&atid=11789&aid=22951&group_id=3065 * add sprintpcs.com to pm.sprint.com aliases * fix OS X long filename issues - Matt Conway ### 2.1.3 / 2008-11-06 (Dr. Ramonolith Chesterfield - Military pharmaceutical psychotropic drug manufacturing expert * 1 minor enhancement * added mms.ae support ### 2.1.2 / 2008-10-21 (Toki's mom, Anja Wartooth) * 2 minor enhancments * Sprint subject update - jesse dp * Virgin Mobile support vmpix.com ### 2.1.1 / 2008-09-24 (Lavona Succuboso, Nathan Explosion uber-groupie) * 4 minor enhancments * Bell Canada support txt.bell.ca - Matt Conway / Snap My Life - http://github.com/wr0ngway, http://github.com/sml * Unicel support unicel.com - Michael DelGaudio * info2go.com support / Unicel * TELUS Corporation support mms.telusmobility.com, msg.telus.com * add test to check that gem builds correctly as a github gem * 1 bug fix * Iconv utf8 fix - Kai Kai ### 2.1.0 / 2008-07-30 (Dr. Gibbons – Birthday expert and Murderface expert) * 1 major enhancement: * opens up TMail for improved query method patterned code in MMS2R * 2 minor enhancements: * UK O2 support mediamessaging.o2.co.uk - Jeremy Wilkins * Write non text files with binary bit set on Windows - David Alm * source hosted on github: git clone git://github.com/monde/mms2r.git ### 2.0.5 / 2008-07-17 (Dr. Ralphus Galkensmelter - Psychological death expert) * Deal with Apple Mail multipart/appledouble - jesse dp ### 2.0.4 / 2008-04-28 (Mr. Selatcia - elder member of The Tribunal) * updated mms.vodacom4me.co.za Vodacom South Africa - Vijay Yellapragada * 1nbox.net / Idea cellular 1nbox.net - Vijay Yellapragada * mms.3ireland.ie / 3 Ireland - Vijay Yellapragada * mms.alltel.com / Alltel (reverted message.alltel.com) - Vijay Yellapragada * mms.mobileiam.ma / Maroc Telecom - Vijay Yellapragada * mms.mtn.co.za / MTM South Africa - Vijay Yellapragada * rci.rogers.com / Rogers of Canada - Vijay Yellapragada * mmsreply.t-mobile.co.uk / T-Mobile UK - Vijay Yellapragada * waw.plspictures.com / PLSPICTURES.COM mms hosting service ### 2.0.3 / 2008-04-15 (Enter Taxman - The 1040 MMS Form) * fix case when part is image/jpeg declared 'application/octet-stream' * trim dangling image/jpeg text from blackberry messages * file extensions added to filenames that are missing extensions in part headers * anonymize images in fixtures to reduce gem size * T-Mobile update - jesse dp * AT&T/T-Mobile Blackberrry update - Dave Myron ### 2.0.2 / 2008-02-22 (The Jomfru Brothers - proprietors of diefordethklok.com) * added support for mms.vodacom4me.co.za Vodacom South Africa - Jason Haruska * added support for bellsouth.net - Jason Haruska * added support for mms.mycricket.com * Improved Blackberry and iPhone suport - Jason Haruska * added :number key to configuration to provide rules for specifying alternative phone number location * return sender's phone number for mobile.indosat.net.id * return sender's phone number for mms.luxgsm.lu * return sender's phone number for mms.vodacom4me.co.za ### 2.0.1 / 2008-02-08 (Professor Jerry Gustav Munndig - Child control expert) * strip out common blackberry and iPhone signatures * handle carriers that use external mail services such as Yahoo! as the From address * Add support for mobile.indosat.net.id (and yahoo.co.id) - Jason Haruska * Add support for sms.sasktel.com - Jason Haruska ### 2.0.0 / 2008-01-23 (Skwisgaar Skwigelf - fastest guitarist alive) * added support for pxt.vodafone.net.nz PXT New Zealand * added support for mms.o2online.de O2 Germany * added support for orangemms.net Orange UK * added support for txt.att.net AT&T * added support for mms.luxgsm.lu LUXGSM S.A. * added support for mms.netcom.no NetCom (Norway) * added support for mms.three.co.uk Hutchison 3G UK Ltd * removed deprecated #get_number use #number * removed deprecated #get_subject use #subject * removed deprecated #get_body use #body * removed deprecated #get_media use #default_media * removed deprecated #get_text use #default_text * removed deprecated #get_attachment use #attachment * fixed error when Sprint content server responds 500 * better yaml configs * moved TMail dependency from Rails ActionMailer SVN to 'official' Gem * ::new greedily processes MMS unless otherwise specified as an initialize option :process => :lazy * logger moved to initialize option :logger => some_logger * testing using mocks and stubs instead of duck raped Net::HTTP * fixed typo in name of method #attachement to #attachment * fixed broken downloading of Sprint videos ### 1.1.12 / 2007-10-21 (Dr. Ronald von Moldenberg - Endorsement specialist) * fetch original images from Sprint content server (Layton Wedgeworth) * ignore Sprint messages when requested content has been purged from their content server ### 1.1.11 / 2007-10-20 (Dr. Armand Skagerakk Frederickshaven - Mythology expert) * minor fix for attachment_fu where it might call #path on the cgi temp file that is returned by get_attachment * renamed a_t_t_media.rb to att_media.rb to make it autotest happy * masthead.jpg misplaced in mms2r_t_mobile_media_ignore.yml (Layton Wedgeworth) * overridden SprintMedia#process failed to accept block (Layton Wedgeworth) * added method_deprecated to help mark methods that are going to be deprecated in preparation of 1.2.x release * #get_number marked deprecated, use #number instead * #get_subject marked deprecated, use #subject instead * #get_body marked deprecated, use #body instead * #get_text marked deprecated, use #default_text instead * #get_attachment marked deprecated, use #attachment instead * #get_media marked deprecated, use #default_media instead ### 1.1.10 / 2007-09-30 (Face Bones) * fixed a case for a nil match on From in the create method (Luke Francl) * added support for Alltel message.alltel.com (Ben Wood) ### 1.1.9 / 2007-09-08 (Rebecca Nightrod - controlling girlfriend of Nathan Explosion) * fixed broken support for act_as_attachment and attachment_fu ### 1.1.8 / 2007-09-08 (James Grishnack - Head of Behemoth Productions, producer of Blood Ocean) * Added support for Orange of France, Orange orange.fr (Julian Biard) * purge in the process block removed, purge must be called explicitly after processing to clean up extracted temporary media files. ### 1.1.7 / 2007-08-25 (Adam Nergal, friend of Skwisgaar, but not Pickles) * Added support for Orange of Poland, Orange mmsemail.orange.pl (Zbigniew Sobiecki) * Cleaned up documentation modifiers * Cleaned out non-Ruby code idioms ### 1.1.6 / 2007-08-11 (Mustakrakish, the Lake Troll part 2) * Redo of release mistake of 1.1.5 ### 1.1.5 / 2007-08-11 (Mustakrakish, the Lake Troll) * AT&T => mms.att.net not clearing out default "multimedia message" subject to nil (Will Jessup) * Ignore case on default subject for all carriers in corresponding conf/mms2r_XXX_media_subject.yml ### 1.1.4 / 2007-08-07 (Dr. Rockso) * AT&T => mms.att.net support (thanks Mike Chen and Dave Myron) * get_body returns nil when there is not user text (sorry Will!) ### 1.1.3 / 2007-07-10 (Charles Foster Ofdensen) * Helio support by Will Jessup * get_subject returns nil on default carrier subjects ### 1.1.2 / 2007-06-13 (Dethklok roadie #2) * placed versioned hpricot dependency in Hoe's extra_deps (an attempt to appease firebrigade gods or not cause Gem::RemoteInstallationCancelled whichever you prefer) ### 1.1.1 / 2007-06-11 (Dethklok roadie) * rescue rcov non-dependency in Rakefile to make firebrigade happy ### 1.1.0 / 2007-06-08 (Toki Wartooth) * get_body to return body text (Luke Francl) * get_subject returns "" for default subjects now * default subjects listed in yaml by carrier in conf directory * added granularity to Cingular, Sprint, and Verizon carrier services (Will Jessup) * refactored Sprint instance to process all media (Will Jessup + Mike) * optimized text transformations (Will Jessup) * properly handle ISO-8859-1 and UTF-8 text (Will Jessup) * autotest powers activate! (ZenTest autotest discovery enabled) * configuration file ignores, transforms, and subjects all store Regexp's * Put vendor Text::Format & TMail::Mail as an external subversion dependency to the 1.2 stable branch of Rails ActionMailer * added get_number method to return the phone number associated with this MMS * get_media and get_text attachment_fu helper return the largest piece of media of that type if the more than one exits in the media (Luke Francl) * added block support to process() method (Shane Vitarana) ### 1.0.7 / 2007-04-27 (Senator Stampingston) * patch submitted by Luke Francl * added a get_subject method that returns nil when any MMS has a default carrier subject * get_subject returns nil for '', 'Multimedia message', '(no subject)', 'You have new Picture Mail!' ### 1.0.6 / 2007-04-24 (Pickles the Drummer) * patch submitted by Luke Francl * added support for mms.dobson.net (Dobson aka Cellular One) (Luke) * DRY'd up unit tests (Luke) * added get_media instance method that returns first video or image as File (Luke) * File from get_media can be used by/with attachment_fu (Luke) * added get_text instance method that returns first non advertising text * File from get_text can be used by/with attachment_fu ### 1.0.5 / 2007-04-10 (William Murderface) * patch submitted by Luke Francl * made ignore_media? start its text check from the start of the file (Luke) * added new text transform for Verizon messages (Luke) * updated Nextel ignore conf (Luke) * added additional samples and tests for T-Mobile & Verizon (Luke) * cleaned up MMS2R::Media documentation * added Sprint broken image test for when media goes stale on their content server * fixed teardown typo in lots of plases * added tests for 4 three samples of unique variants of Sprint/Nextel text * 100% test coverage! ### 1.0.4 / 2007-04-09 (Metalocalypse) * fix teardown in test_mms2r_sprint.rb (shanesbrain.net) * clean up Net::HTTP in MMS2R::SprintMedia (shanesbrain.net) * added accessor MMS2R::Media.media_dir * fixed a nil issue with underlying tmp working dir * added exception handling around Net::HTTP in MMS2R::SprintMedia ### 1.0.3 / 2007-04-05 (Paper Cut) * Cleaned up packaging and errors in example found by Shane V. http://shanesbrain.net/ ### 1.0.2 / 2007-03-07 * Reorganized tests and fixtures * Added carriers: * Cingular => cingularme.com * Nextel => messaging.nextel.com * Verizon => vtext.com ### 1.0.1 / 2007-03-07 * Flubbed RubyForge release ... do not use this. ### 1.0.0 / 2007-03-06 * Birthday! * AT&T/Cingular => mmode.com * Cingular => mms.mycingular.com * Sprint => pm.sprint.com * Sprint => messaging.sprintpcs.com * T-Mobile => tmomail.net * Verizon => vzwpix.com diff --git a/lib/mms2r/version.rb b/lib/mms2r/version.rb index d1d7fa5..448c31d 100644 --- a/lib/mms2r/version.rb +++ b/lib/mms2r/version.rb @@ -1,25 +1,25 @@ module MMS2R class Version def self.major 3 end def self.minor 8 end def self.patch - 1 + 2 end def self.pre nil end def self.to_s [major, minor, patch, pre].compact.join('.') end end end
monde/mms2r
797932b89dd4c94796e0acc1ea26d7d7f1f9095f
Process HTC Sensation footers.
diff --git a/conf/mms2r_media.yml b/conf/mms2r_media.yml index 3e69efd..2c74a44 100644 --- a/conf/mms2r_media.yml +++ b/conf/mms2r_media.yml @@ -1,70 +1,73 @@ --- ignore: text/plain: - !ruby/regexp /^\(no subject\)$/i - !ruby/regexp /\ASent (via|(from (my|your))) /im + - !ruby/regexp /\AFrom my HTC /im - !ruby/regexp /\ASent on the Sprint.* Now Network.*$/im multipart/mixed: - !ruby/regexp "/^Attachment: /i" transform: text/plain: - - !ruby/regexp /\A(.*?)Sent (via|(from (my|your))) .*/im - "\\1" + - - !ruby/regexp /\A(.*?)From my HTC .*/im + - "\\1" - - !ruby/regexp /\A(.*?)\s+image\/jpeg$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent on the Sprint.* Now Network.*$/im - "\\1" device_types: boundary: :motorola: !ruby/regexp /Motorola-A-Mail/i headers: x-mailer: :iphone: !ruby/regexp /iPhone Mail/i :blackberry: !ruby/regexp /Palm webOS/i mime-version: :iphone: !ruby/regexp /iPhone Mail/i x-rim-org-msg-ref-id: :blackberry: !ruby/regexp /.+/ user-agent: :iphone: !ruby/regexp /iPhone/i # TODO do something about the assortment of camera models that have # been seen: # 1.3 Megapixel, 2.0 Megapixel, BlackBerry, CU920, G'z One TYPE-S, # Hermes, iPhone, LG8700, LSI_S5K4AAFA, Micron MT9M113 1.3MP YUV, # Motorola Phone, Omni_vision-9650, Pre, # Seoul Electronics & Telecom SIM120B 1.3M, SGH-T729, SGH-T819, # SPH-M540, SPH-M800, SYSTEMLSI S5K4BAFB 2.0 MP, VX-9700 # # NOTE: These model strings are stored in the exif model header of an image file # created and sent by the device, the regex is used by mms2r to detect the # model string makes: :android: !ruby/regexp /Android/i :apple: !ruby/regexp /^(Apple|Hipstamatic)$/i :casio: !ruby/regexp /^CASIO$/i :dash: !ruby/regexp /T-Mobile Dash/i :google: !ruby/regexp /^google$/i :htc: !ruby/regexp /^HTC/i :lge: !ruby/regexp /^(LG|CX87BL05)/i :motorola: !ruby/regexp /^Motorola/i :nokia: !ruby/regexp /^Nokia/i :pantech: !ruby/regexp /^PANTECH$/i :palm: !ruby/regexp /Palm/i :qualcomm: !ruby/regexp /^MSM6/i :research_in_motion: !ruby/regexp /^(RIM|Research In Motion)$/i :samsung: !ruby/regexp /^(SAMSUNG|ES.M800|M6550B-SAM-4480)/i :seoul_electronics: !ruby/regexp /^ISUS0/i :sprint: !ruby/regexp /^Sprint$/i :utstarcom: !ruby/regexp /^T1A_UC1.88$/i models: :blackberry: !ruby/regexp /BlackBerry/i :centro: !ruby/regexp /^Palm Centro$/i :dash: !ruby/regexp /T-Mobile Dash/i :droid: !ruby/regexp /Droid/i :htc: !ruby/regexp /HTC|Eris|HERO200/i :iphone: !ruby/regexp /iPhone/i software: :blackberry: !ruby/regexp /^Rim Exif/i filenames: :iphone: !ruby/regexp /^photo\.(JPG|PNG)$/ :video: !ruby/regexp /\.3gp$/ diff --git a/test/test_mms2r_media.rb b/test/test_mms2r_media.rb index 0a7c235..54e5317 100644 --- a/test/test_mms2r_media.rb +++ b/test/test_mms2r_media.rb @@ -1,707 +1,708 @@ # encoding: UTF-8 require "test_helper" class TestMms2rMedia < Test::Unit::TestCase include MMS2R::TestHelper def use_temp_dirs MMS2R::Media.tmp_dir = @tmpdir MMS2R::Media.conf_dir = @confdir end def setup @oldtmpdir = MMS2R::Media.tmp_dir || File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") @oldconfdir = MMS2R::Media.conf_dir || File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") FileUtils.mkdir_p(@oldtmpdir) FileUtils.mkdir_p(@oldconfdir) @tmpdir = File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") FileUtils.mkdir_p(@tmpdir) @confdir = File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") FileUtils.mkdir_p(@confdir) end def teardown FileUtils.rm_rf(@tmpdir) FileUtils.rm_rf(@confdir) MMS2R::Media.tmp_dir = @oldtmpdir MMS2R::Media.conf_dir = @oldconfdir end def stub_mail(vals = {}) attrs = { :from => '[email protected]', :to => '[email protected]', :subject => 'This is a test email', :body => 'a', }.merge(vals) Mail.new do from attrs[:from] to attrs[:to] subject attrs[:subject] body attrs[:body] end end def test_faux_user_agent assert_equal "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.120 Safari/535.2", MMS2R::Media::USER_AGENT end def test_class_parse mms = mail('generic.mail') assert_equal ['[email protected]'], mms.from end def temp_text_file(text) tf = Tempfile.new("test" + rand.to_s) tf.puts(text) tf.close tf.path end def test_tmp_dir use_temp_dirs() MMS2R::Media.tmp_dir = @tmpdir assert_equal @tmpdir, MMS2R::Media.tmp_dir end def test_conf_dir use_temp_dirs() MMS2R::Media.conf_dir = @confdir assert_equal @confdir, MMS2R::Media.conf_dir end def test_safe_message_id mid1_b="1234abcd" mid1_a="1234abcd" mid2_b="<01234567.0123456789012.JavaMail.fooba@foo-bars999>" mid2_a="012345670123456789012JavaMailfoobafoo-bars999" assert_equal mid1_a, MMS2R::Media.safe_message_id(mid1_b) assert_equal mid2_a, MMS2R::Media.safe_message_id(mid2_b) end def test_default_ext assert_equal nil, MMS2R::Media.default_ext(nil) assert_equal 'text', MMS2R::Media.default_ext('text') assert_equal 'txt', MMS2R::Media.default_ext('text/plain') assert_equal 'test', MMS2R::Media.default_ext('example/test') end def test_base_initialize_config_tries_to_open_default_config_yaml f = File.join(MMS2R::Media.conf_dir, 'mms2r_media.yml') YAML.expects(:load_file).once.with(f).returns({}) config = MMS2R::Media.initialize_config(nil) end def test_base_initialize_config config = MMS2R::Media.initialize_config(nil) # test defaults shipped in mms2r_media.yml assert_not_nil config assert_equal true, config['ignore'].is_a?(Hash) assert_equal true, config['transform'].is_a?(Hash) assert_equal true, config['number'].is_a?(Array) end def test_instance_initialize_config mms = MMS2R::Media.new stub_mail config = mms.initialize_config(nil) # test defaults shipped in mms2r_media.yml assert_not_nil config assert_equal true, config['ignore'].is_a?(Hash) assert_equal true, config['transform'].is_a?(Hash) assert_equal true, config['number'].is_a?(Array) end def test_initialize_config_contatenation c = {'ignore' => {'text/plain' => [/A TEST/]}, 'transform' => {'text/plain' => [/FOO/, '']}, 'number' => ['from', /^([^\s]+)\s.*/, '\1'] } config = MMS2R::Media.initialize_config(c) assert_not_nil config['ignore']['text/plain'].detect{|v| v == /A TEST/} assert_not_nil config['transform']['text/plain'].detect{|v| v == /FOO/} assert_not_nil config['number'].first == 'from' end def test_aliased_new_returns_default_processor_instance mms = MMS2R::Media.new stub_mail assert_not_nil mms assert_equal true, mms.respond_to?(:process) assert_equal MMS2R::Media, mms.class end def test_lazy_process_option mms = MMS2R::Media.new stub_mail, :process => :lazy mms.expects(:process).never end def test_logger_option logger = mock() logger.expects(:info).at_least_once mms = MMS2R::Media.new stub_mail, :logger => logger end def test_default_processor_initialize_tries_to_open_config_for_carrier mms_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'mms2r_media.yml')) aliases_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'aliases.yml')) from_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'from.yml')) example_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'example.com.yml')) YAML.expects(:load_file).at_least_once.with(mms_yaml).returns({}) YAML.expects(:load_file).at_least_once.with(aliases_yaml).returns({}) YAML.expects(:load_file).at_least_once.with(from_yaml).returns([]) YAML.expects(:load_file).never.with(example_yaml) mms = MMS2R::Media.new stub_mail end def test_mms_phone_number mail = stub_mail mail.stubs(:from).returns(['[email protected]']) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number end def test_mms_phone_number_from_config mail = stub_mail(:from => '"+2068675309" <[email protected]>') mms = MMS2R::Media.new(mail) mms.expects(:config).once.returns({'number' => ['from', /^([^\s]+)\s.*/, '\1']}) assert_equal '+2068675309', mms.number end def test_mms_phone_number_with_errors mail = stub_mail mail.stubs(:from).returns(nil) mms = MMS2R::Media.new(mail) assert_nothing_raised do assert_equal '', mms.number end end def test_transform_text_plain mail = stub_mail mail.stubs(:from).returns(nil) mms = MMS2R::Media.new(mail) type = 'test/type' text = 'hello' # no match in the config result = [type, text] assert_equal result, mms.transform_text(type, text) # testing the default config + assert_equal ['text/plain', ''], mms.transform_text('text/plain', "From my HTC Sensation 4G on T-Mobile. The first nationwide 4G network") assert_equal ['text/plain', ''], mms.transform_text('text/plain', "Sent from my Windows Phone") assert_equal ['text/plain', ''], mms.transform_text('text/plain', "Sent via BlackBerry from T-Mobile") assert_equal ['text/plain', ''], mms.transform_text('text/plain', "Sent from my Verizon Wireless BlackBerry") assert_equal ['text/plain', ''], mms.transform_text('text/plain', 'Sent via iPhone') assert_equal ['text/plain', ''], mms.transform_text('text/plain', 'Sent from my iPhone') assert_equal ['text/plain', ''], mms.transform_text('text/plain', 'Sent from your iPhone.') assert_equal ['text/plain', ''], mms.transform_text('text/plain', " \n\nimage/jpeg") # has a bad regexp mms.expects(:config).at_least_once.returns({'transform' => {type => [['(hello)', 'world']]}}) assert_equal result, mms.transform_text(type, text) # matches in config mms.expects(:config).at_least_once.returns({'transform' => {type => [[/(hello)/, 'world']]}}) assert_equal [type, 'world'], mms.transform_text(type, text) mms.expects(:config).at_least_once.returns({'transform' => {type => [[/^Ignore this part, (.+)/, '\1']]}}) assert_equal [type, text], mms.transform_text(type, "Ignore this part, " + text) # chaining transforms mms.expects(:config).at_least_once.returns({'transform' => {type => [[/(hello)/, 'world'], [/(world)/, 'mars']]}}) assert_equal [type, 'mars'], mms.transform_text(type, text) # has a Iconv problem mms.expects(:config).at_least_once.returns({'transform' => {type => [['(hello)', 'world']]}}) assert_equal result, mms.transform_text(type, text) end def test_transform_text_to_utf8 mail = mail('iconv-fr-text-01.mail') mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_equal 1, mms.media['text/plain'].size assert_equal 1, mms.media['text/html'].size file = mms.media['text/plain'][0] assert_not_nil file assert_equal true, File::exist?(file) text_lines = IO.readlines("#{file}") text = text_lines.join # ASCII-8BIT -> D'ici un mois G\xE9orgie # UTF-8 -> D'ici un mois Géorgie if RUBY_VERSION < "1.9" assert_equal("sample email message Fwd: sub D'ici un mois Géorgie", mms.subject) assert_equal("D'ici un mois Géorgie body", text_lines.first.strip) else assert_equal(Iconv.new('UTF-8', 'ISO-8859-1').iconv("sample email message Fwd: sub D'ici un mois Géorgie"), mms.subject) assert_equal(Iconv.new('UTF-8', 'ISO-8859-1').iconv("D'ici un mois G\xE9orgie body"), text_lines.first.strip) end end def test_subject s = 'hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) assert_equal s, mms.subject # second time through shouldn't process the subject again mail.expects(:subject).never assert_equal s, mms.subject end def test_subject_with_bad_mail_subject mail = stub_mail mail.stubs(:subject).returns(nil) mms = MMS2R::Media.new(mail) assert_equal '', mms.subject end def test_subject_with_subject_ignored s = 'hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) mms.stubs(:config).returns({'ignore' => {'text/plain' => [s]}}) assert_equal '', mms.subject end def test_subject_with_subject_transformed s = 'Default Subject: hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) mms.stubs(:config).returns( { 'ignore' => {}, 'transform' => {'text/plain' => [[/Default Subject: (.+)/, '\1']]}}) assert_equal 'hello world', mms.subject end def test_attachment_should_return_nil_if_files_for_type_are_not_found mms = MMS2R::Media.new stub_mail mms.stubs(:media).returns({}) assert_nil mms.send(:attachment, ['text']) end def test_attachment_should_return_nil_if_empty_files_are_found mms = MMS2R::Media.new stub_mail mms.stubs(:media).returns({'text/plain' => [Tempfile.new('test')]}) assert_nil mms.send(:attachment, ['text']) end def test_type_from_filename mms = MMS2R::Media.new stub_mail assert_equal 'image/jpeg', mms.send(:type_from_filename, "example.jpg") end def test_type_from_filename_should_be_nil mms = MMS2R::Media.new stub_mail assert_nil mms.send(:type_from_filename, "example.example") end def test_attachment_should_return_duck_typed_file mms = MMS2R::Media.new stub_mail duck_file = mms.send(:attachment, ['text']) assert_equal 1, duck_file.size assert_equal 'text/plain', duck_file.content_type assert_equal "a", open(mms.media['text/plain'].first).read end def test_empty_body mms = MMS2R::Media.new stub_mail mms.stubs(:default_text).returns(nil) assert_equal "", mms.body end def test_body mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") mms.stubs(:default_text).returns(File.new(temp_big)) body = mms.body assert_equal "hello world", body end def test_body_when_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") mms.stubs(:default_html).returns(File.new(temp_big)) assert_equal "hello world teapot", mms.body end def test_default_text mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'text/plain' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_text.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_text.local_path end def test_default_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") temp_small = temp_text_file("<html><head><title>hello</title></head><body>world<body></html>") mms.stubs(:media).returns({'text/html' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_html.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_html.local_path end def test_default_media mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'image/jpeg' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_media.local_path end def test_default_media_treats_image_and_video_equally mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big_image = temp_text_file("hello world") temp_small_image = temp_text_file("hello") temp_big_video = temp_text_file("hello world again") temp_small_video = temp_text_file("hello again") mms.stubs(:media).returns({'image/jpeg' => [temp_small_image, temp_big_image], 'video/mpeg' => [temp_small_video, temp_big_video], }) assert_equal temp_big_video, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big_video, mms.default_media.local_path end #def test_default_media_treats_gif_and_jpg_equally # #it doesn't matter that these are text files, we just need say they are images # temp_big = temp_text_file("hello world") # temp_small = temp_text_file("hello") # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/jpeg' => [temp_big], 'image/gif' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/gif' => [temp_big], 'image/jpg' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path #end def test_purge mms = MMS2R::Media.new stub_mail mms.purge assert_equal false, File.exist?(mms.media_dir) end def test_ignore_media_by_filename_equality name = 'foo.txt' type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [name]}}) # type is not in the ingore part = stub(:body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and filename are in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal true, mms.ignore_media?(type, part) # type but not file name are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_filename name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'foo.txt', mms.filename?(part) end def test_long_filename name = 'x' * 300 + '.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'x' * 251 + '.txt', mms.filename?(part) end def test_filename_when_file_extension_missing_part name = 'foo' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.txt', mms.filename?(part) name = 'foo.janky' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.janky.txt', mms.filename?(part) end def test_ignore_media_by_filename_regexp name = 'foo.txt' regexp = /foo\.txt/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [regexp, 'nil.txt']}}) # type is not in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the filename are in the ingore part = stub(:filename => name) assert_equal true, mms.ignore_media?(type, part) # type but not regexp for filename are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_by_regexp_on_file_content name = 'foo.txt' content = "aaaaaaahello worldbbbbbbbbb" regexp = /.*Hello World.*/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => ['nil.txt', regexp]}}) part = stub(:filename => name, :body => Mail::Body.new(content)) # type is not in the ingore assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the content are in the ingore assert_equal true, mms.ignore_media?(type, part) # type but not regexp for content are in the ignore part = stub(:filename => name, :body => Mail::Body.new('no teapots')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_when_file_content_is_empty mms = MMS2R::Media.new stub_mail # there is no conf but the part's body is empty part = stub(:filename => 'foo.txt', :body => Mail::Body.new) assert_equal true, mms.ignore_media?('text/test', part) # there is no conf but the part's body is white space part = stub(:filename => 'foo.txt', :body => Mail::Body.new("\t\n\t\n ")) assert_equal true, mms.ignore_media?('text/test', part) end def test_add_file mail = stub_mail mail.stubs(:from).returns(['[email protected]']) mms = MMS2R::Media.new(mail) mms.stubs(:media).returns({}) assert_nil mms.media['text/html'] mms.add_file('text/html', '/tmp/foo.html') assert_equal ['/tmp/foo.html'], mms.media['text/html'] mms.add_file('text/html', '/tmp/bar.html') assert_equal ['/tmp/foo.html', '/tmp/bar.html'], mms.media['text/html'] end def test_temp_file name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal name, File.basename(mms.temp_file(part)) end def test_process_media_for_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', 'hello world']) result = mms.process_media(part) assert_equal 'text/plain', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_with_empty_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', '']) assert_equal ['text/plain', nil], mms.process_media(part) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_application_smil name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['application/smil', nil]) part = stub(:filename => name, :content_type => 'application/smil', :part_type? => 'application/smil', :main_type => 'application') assert_equal ['application/smil', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['application/smil', 'hello world']) result = mms.process_media(part) assert_equal 'application/smil', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_application_octet_stream_when_image name = 'fake.jpg' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'application/octet-stream', :part_type? => 'application/octet-stream', :body => Mail::Body.new("data"), :main_type => 'application') result = mms.process_media(part) assert_equal 'image/jpeg', result.first assert_match(/fake\.jpg$/, result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_all_other_media name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :main_type => 'faux', :part_type? => 'faux/text', :body => Mail::Body.new(nil)) assert_equal ['faux/text', nil], mms.process_media(part) part = stub(:filename => name, :main_type => 'faux', :part_type? => 'faux/text', :body => Mail::Body.new('hello world')) result = mms.process_media(part) assert_equal 'faux/text', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process mms = MMS2R::Media.new stub_mail assert_equal 1, mms.media.size assert_not_nil mms.media['text/plain'] assert_equal 1, mms.media['text/plain'].size assert_equal true, File.exist?(mms.media['text/plain'].first) assert_equal 1, File.size(mms.media['text/plain'].first) mms.purge end def test_process_with_multipart_double_parts mail = mail('apple-double-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_not_nil mms.media['application/applefile'] assert_equal 1, mms.media['application/applefile'].size assert_not_nil mms.media['image/jpeg'] assert_equal 1, mms.media['image/jpeg'].size assert_match(/DSCN1715\.jpg$/, mms.media['image/jpeg'].first) assert_file_size mms.media['image/jpeg'].first, 337 mms.purge end def test_folding_with_multipart_alternative_parts mail = mail('helio-message-01.mail') mms = MMS2R::Media.new(Mail.new) assert_equal 5, mms.send(:folded_parts, mail.parts).size end def test_process_when_media_is_ignored # TODO - I'd like to get away from mocks and test on real data, and # this is covered repeatedly for various samples from the carrier end def test_process_when_yielding_to_a_block mail = mail('att-image-01.mail') mms = MMS2R::Media.new(mail) mms.process do |type, files| assert_equal 1, files.size assert_equal true, type == 'image/jpeg' assert_equal true, File.basename(files.first) == 'Photo_12.jpg' assert_equal true, File::exist?(files.first) end mms.purge end def test_domain_from_return_path mail = mock() mail.expects(:from).at_least_once.returns([]) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'null.example.com', domain end def test_domain_from_from mail = mock() mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'null.example.com', domain end def test_domain_from_from_yaml f = File.join(MMS2R::Media.conf_dir, 'from.yml') YAML.expects(:load_file).once.with(f).returns(['example.com']) mail = mock() mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'example.com', domain end def test_unknown_device_type mail = mail('generic.mail') mms = MMS2R::Media.new(mail) assert_equal :unknown, mms.device_type? assert_equal false, mms.is_mobile? end def test_iphone_device_type_by_header iphones = ['att-iphone-01.mail', 'iphone-image-01.mail'] iphones.each do |iphone| mail = mail(iphone) mms = MMS2R::Media.new(mail) assert_equal :iphone, mms.device_type?, "fixture #{iphone} was not a iphone" assert_equal true, mms.is_mobile? end end def test_exif mail = smart_phone_mock mms = MMS2R::Media.new(mail) assert_equal 'iPhone', mms.exif.model end def test_iphone_device_type_by_exif mail = smart_phone_mock mms = MMS2R::Media.new(mail) assert_equal :iphone, mms.device_type? assert_equal true, mms.is_mobile? end def test_faux_tiff_iphone_device_type_by_exif
monde/mms2r
2433b3774e2afa745d6626345d4351872ad55fd2
Handle a wider range for "Sent from" footers used in smart phones.
diff --git a/conf/mms2r_media.yml b/conf/mms2r_media.yml index 4d78f4e..3e69efd 100644 --- a/conf/mms2r_media.yml +++ b/conf/mms2r_media.yml @@ -1,79 +1,70 @@ --- ignore: text/plain: - !ruby/regexp /^\(no subject\)$/i - - !ruby/regexp /\ASent via BlackBerry (from|by) .*$/im - - !ruby/regexp /\ASent from my Windows Phone.*$/im - - !ruby/regexp /\ASent from my Verizon Wireless BlackBerry$/im - - !ruby/regexp /\ASent (via|(from (my|your))) iPhone.?$/im + - !ruby/regexp /\ASent (via|(from (my|your))) /im - !ruby/regexp /\ASent on the Sprint.* Now Network.*$/im multipart/mixed: - !ruby/regexp "/^Attachment: /i" transform: text/plain: - - - !ruby/regexp /\A(.*?)Sent via BlackBerry (from|by) .*$/im - - "\\1" - - - !ruby/regexp /\A(.*?)Sent from my Windows Phone.*$/im - - "\\1" - - - !ruby/regexp /\A(.*?)Sent from my Verizon Wireless BlackBerry$/im - - "\\1" - - - !ruby/regexp /\A(.*?)Sent (via|(from (my|your))) iPhone.?$/im + - - !ruby/regexp /\A(.*?)Sent (via|(from (my|your))) .*/im - "\\1" - - !ruby/regexp /\A(.*?)\s+image\/jpeg$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent on the Sprint.* Now Network.*$/im - "\\1" device_types: boundary: :motorola: !ruby/regexp /Motorola-A-Mail/i headers: x-mailer: :iphone: !ruby/regexp /iPhone Mail/i :blackberry: !ruby/regexp /Palm webOS/i mime-version: :iphone: !ruby/regexp /iPhone Mail/i x-rim-org-msg-ref-id: :blackberry: !ruby/regexp /.+/ user-agent: :iphone: !ruby/regexp /iPhone/i # TODO do something about the assortment of camera models that have # been seen: # 1.3 Megapixel, 2.0 Megapixel, BlackBerry, CU920, G'z One TYPE-S, # Hermes, iPhone, LG8700, LSI_S5K4AAFA, Micron MT9M113 1.3MP YUV, # Motorola Phone, Omni_vision-9650, Pre, # Seoul Electronics & Telecom SIM120B 1.3M, SGH-T729, SGH-T819, # SPH-M540, SPH-M800, SYSTEMLSI S5K4BAFB 2.0 MP, VX-9700 # # NOTE: These model strings are stored in the exif model header of an image file # created and sent by the device, the regex is used by mms2r to detect the # model string makes: :android: !ruby/regexp /Android/i :apple: !ruby/regexp /^(Apple|Hipstamatic)$/i :casio: !ruby/regexp /^CASIO$/i :dash: !ruby/regexp /T-Mobile Dash/i :google: !ruby/regexp /^google$/i :htc: !ruby/regexp /^HTC/i :lge: !ruby/regexp /^(LG|CX87BL05)/i :motorola: !ruby/regexp /^Motorola/i :nokia: !ruby/regexp /^Nokia/i :pantech: !ruby/regexp /^PANTECH$/i :palm: !ruby/regexp /Palm/i :qualcomm: !ruby/regexp /^MSM6/i :research_in_motion: !ruby/regexp /^(RIM|Research In Motion)$/i :samsung: !ruby/regexp /^(SAMSUNG|ES.M800|M6550B-SAM-4480)/i :seoul_electronics: !ruby/regexp /^ISUS0/i :sprint: !ruby/regexp /^Sprint$/i :utstarcom: !ruby/regexp /^T1A_UC1.88$/i models: :blackberry: !ruby/regexp /BlackBerry/i :centro: !ruby/regexp /^Palm Centro$/i :dash: !ruby/regexp /T-Mobile Dash/i :droid: !ruby/regexp /Droid/i :htc: !ruby/regexp /HTC|Eris|HERO200/i :iphone: !ruby/regexp /iPhone/i software: :blackberry: !ruby/regexp /^Rim Exif/i filenames: :iphone: !ruby/regexp /^photo\.(JPG|PNG)$/ :video: !ruby/regexp /\.3gp$/
monde/mms2r
39d54863c1a48cf12fbfa0b615e2152be941257e
prepping 3.8.1 deploy
diff --git a/.gitignore b/.gitignore index 72376a0..0dfe305 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,7 @@ .DS_Store coverage/ pkg/ email.txt coverage.info mkmf.log doc/ -.redcar/ diff --git a/Gemfile.lock b/Gemfile.lock index b09dde5..16d3b99 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,48 +1,48 @@ PATH remote: . specs: - mms2r (3.8.0) + mms2r (3.8.1) exifr (>= 1.0.3) json (>= 1.6.0) mail (>= 2.4.0) nokogiri (>= 1.5.0) rake (= 0.9.2.2) GEM remote: https://rubygems.org/ specs: exifr (1.1.3) i18n (0.6.0) json (1.7.3) mail (2.4.4) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) metaclass (0.0.1) mime-types (1.19) mocha (0.11.4) metaclass (~> 0.0.1) multi_json (1.3.5) nokogiri (1.5.5) polyglot (0.3.3) rake (0.9.2.2) rdoc (3.12) json (~> 1.4) simplecov (0.6.4) multi_json (~> 1.0) simplecov-html (~> 0.5.3) simplecov-html (0.5.3) test-unit (2.4.8) treetop (1.4.10) polyglot polyglot (>= 0.3.1) PLATFORMS ruby DEPENDENCIES mms2r! mocha rdoc simplecov test-unit diff --git a/History.txt b/History.txt index ee0405f..59a6b35 100644 --- a/History.txt +++ b/History.txt @@ -1,445 +1,450 @@ +### 3.8.1 / 2012-07-22 (Calvert - Pickles The Drummer's dad) + +* 1 major enhancement + * Support for Cincinnati Bell - mms.gocbw.com - James McGrath + ### 3.8.0 / 2012-07-04 (Dr. Donald Gorfield – Comedy specialist) * 1 major enhancement * Handle MMS from Sprint that have their media attached rather than CDN'd ### 3.7.1 / 2012-06-04 (Abrigail Remeltindtdrinc - The Record Cleaner) * 2 minor enhancements * Improve processing of Sprint media - James McGrath * RDoc format documentation - James McGrath ### 3.7.0 / 2012-05-31 (The Teenager - Edgar's brother via Eric's face) * 2 major enhancements * Improve processing of Sprint media - James McGrath * Remove Hoe and gemcutter dependencies ### 3.6.4 / 2012-04-22 (Molly - Pickles' mother) * 1 minor enhancement * strip a variation of the iphone default footer ### 3.6.3 / 2012-03-25 (Dethklok Minute Host - host of The Dethklok Minute) * 1 minor enhancement * strip Windows phone default footer ### 3.6.2 / 2012-02-12 (Mr. Gojira - Owner Mr. Gojira's Driving School - retake driver's exam) * 1 minor enhancement * Change user agent given to Sprint so it returns a properly sized image. ### 3.6.1 / 2012-02-11 (Mr. Gojira - Owner Mr. Gojira's Driving School) * 1 minor enhancement * use Net::HTTP#get2 to fetch Sprint content ### 3.6.0 / 2012-01-19 (Agent 216 - assassin, master of infiltration and sabotage) * 1 major enhancement * Ruby 1.8.7, 1.9.2, and 1.9.3 compatible * 1 bug fix * A fix for the utf-8 encoding issue with ruby 1.9.2 - minimul / Christian ### 3.5.1 / 2011-12-11 (Mashed Potato Johnson - oldest living blues guitarist in the world) * 1 bug fix * A fix for the utf-8 encoding issue with ruby 1.9.2 - James McGrath ### 3.5.0 / 2011-12-01 (Dr. Milminiman Lamilim Swimwambli - Marriage expert) * 1 major bug fix * In Ruby 1.9.X MMS2R::Media::Sprint was not fetching content from Sprint's CDN correctly because the implementation of Net::HTTP in 1.9.X passes a User-Agent header of "Ruby" to which Sprint responds with a fake 500 - with help from James McGrath ### 3.4.1 / 2011-11-06 (Fatty Ding-Dongs, Dethklok foster child) * 2 major enhancements * Additional means to detect android, iphone, motorola, nokia, palm handsets * Additional known SMS/MMS domains mm.att.net, labwig.net, cdma.sasktel.com ### 3.4.0 / 2011-10-31 (Serveta Skwigelf, Skwisgaar's hot mom) * 2 major enhancements * regexp's in yaml configs are store as a ruby regexp and not a string that is evaled. * character encoding capability with 1.8 rubies and 1.9 rubies. ### 3.3.1 / 2011-01-01 (Reverend Aslaug Wartooth (deceased), Toki's dad) * 2 minor enhancements * new method #default_html returns the default html attachment * #body will return the default plain text, or default stripped html text ### 3.3.0 / 2010-12-31 (Charles Foster Offdensen - CFO, dethklok) * 1 major enhancement * MMS2R::Media::Sprint is now a module that is extended in for processing Sprint content rather than being child class of MMS2R::Media Extension is the strategy to use for overwriting template methods now * 1 minor enhancement * process new Sprint subject - Jason Hooper * new SaskTel mms/sms domain alias sasktel.com * new Virgin Mobile mms/sms domain alias yrmobl.com ### 3.2.0 / 2010-08-17 (Antonio "Tony" DiMarco Thunderbottom - bassist) * 3 minor enhancements * updated readme with latest sites known to use mms2r * bundler assimilated * loading rubygems only if it's required, like rake ### 3.1.0 / 2010-07-09 (Dick "Magic Ears" Knubbler - music producer) * 8 minor enhancements * Detects additional Bell/AT&T domain sbcglobal.net as a handset * Detects additional Virgin mobile domains pixmbl.com vmobl.com as a handset * Expanded mobile phone detection for handset makers by : Casio, Google Nexus One, LG Electronics, Motorola, Pantech, Qualcom, Samsung, Sprint, UTStarCom * EXIF Reader (exifr) is integral to MMS2R and is now a required gem * upgrade Mail to 2.2.5 * depend on latest gems * corrected example - Jason Hooper * added As Seen On The Internet to README that lists sites known to be using MMS2R in some fashion ### 3.0.1 / 2010-03-28 (Lavona Succuboso - leader of "Succuboso Explosion") * 1 minor enhancement * support for U.S. Cellular ### 3.0.0 / 2010-02-24 (General Crozier - Chairman of the Joint Chiefs of Staff) * 1 new feature * dependence upon Mail gem rather than TMail gem ### 2.4.1 / 2010-02-07 (Vater Orlaag - political and spiritual specialist) * 3 minor enhancements * make sure filename is free of new lines - laurynas * recognize HTC HERO200 as a smart phone * recognize HTC Eris as a smart phone ### 2.4.0 / 2009-12-20 (Dr. Nanemiltred Philtendrieden - specialist on celebrity death) * 1 new feature * replace Hpricot with Nokogiri for html parsing of Sprint data * 3 minor enhancements * smartphone identities stored in conf/mms2r_media.yml * identify Motorola Droid as a smartphone * identify T-Mobile Dash as a smartphone * use uuidtools for naming temp directories - kbaum ### 2.3.0 / 2009-08-30 (Snakes 'n' Barrels Greatest Hits) * 5 new features * detect smartphone status/type based on model metadata from jpeg and tiff exif data using exifr gem, access exif data with MMS2R::Media#exif * make MMS2R Rails gem packaging friendly with an init.rb - Scott Taylor, smtlaissezfaire * delegate missing methods to mms2r's tmail object so that mms2r behaves as if it were a tmail object - Sai Emrys, saizai * default_media can return an attachment of application content type - Brendan Lim, brendanlim * MMS2R.parse(raw_mail) convenience class method that parses and returns an mms2r from a mail file - saizai * 4 minor enhancements * make examples more 'mail' specific to enforce the fact that an mms is a multipart email - saizai * update for text in vzwpix.com default carrier message * detecting smartphone (blackberries and iphones for now) is more versatile from reading mail headers * expanded filtering of carrier advertising text in mms from smartphones ### 2.2.0 / 2009-01-04 (Rikki Kixx - owner of a franchise of rehab centers) * 3 new features * MMS2R::Media#is_mobile? best guess if the sender was a mobile device * MMS2R::Media#device_type? best guess of the mobile device type. Simple heuristics thus far for :blackberry :iphone :handset :unknown could be expanded for exif probing or additinal shifting of mail header * from array in conf/from.yml to provide granularity to determine carrier domain (caused by tmo.blackberry.net) * 4 minor enhancements * support for Virgin Canada messaging service vmobile.ca * support for text service messaging.sprintpcs.com * additional BlackBerry coverage from T-Mobile tmo.blackberry.net provider * legacy support for mobile.mycingular.com, pics.cingularme.com * 3 bug fixes * iPhone default subject - jesse dp http://rubyforge.org/tracker/?func=detail&atid=11789&aid=22951&group_id=3065 * add sprintpcs.com to pm.sprint.com aliases * fix OS X long filename issues - Matt Conway ### 2.1.3 / 2008-11-06 (Dr. Ramonolith Chesterfield - Military pharmaceutical psychotropic drug manufacturing expert * 1 minor enhancement * added mms.ae support ### 2.1.2 / 2008-10-21 (Toki's mom, Anja Wartooth) * 2 minor enhancments * Sprint subject update - jesse dp * Virgin Mobile support vmpix.com ### 2.1.1 / 2008-09-24 (Lavona Succuboso, Nathan Explosion uber-groupie) * 4 minor enhancments * Bell Canada support txt.bell.ca - Matt Conway / Snap My Life - http://github.com/wr0ngway, http://github.com/sml * Unicel support unicel.com - Michael DelGaudio * info2go.com support / Unicel * TELUS Corporation support mms.telusmobility.com, msg.telus.com * add test to check that gem builds correctly as a github gem * 1 bug fix * Iconv utf8 fix - Kai Kai ### 2.1.0 / 2008-07-30 (Dr. Gibbons – Birthday expert and Murderface expert) * 1 major enhancement: * opens up TMail for improved query method patterned code in MMS2R * 2 minor enhancements: * UK O2 support mediamessaging.o2.co.uk - Jeremy Wilkins * Write non text files with binary bit set on Windows - David Alm * source hosted on github: git clone git://github.com/monde/mms2r.git ### 2.0.5 / 2008-07-17 (Dr. Ralphus Galkensmelter - Psychological death expert) * Deal with Apple Mail multipart/appledouble - jesse dp ### 2.0.4 / 2008-04-28 (Mr. Selatcia - elder member of The Tribunal) * updated mms.vodacom4me.co.za Vodacom South Africa - Vijay Yellapragada * 1nbox.net / Idea cellular 1nbox.net - Vijay Yellapragada * mms.3ireland.ie / 3 Ireland - Vijay Yellapragada * mms.alltel.com / Alltel (reverted message.alltel.com) - Vijay Yellapragada * mms.mobileiam.ma / Maroc Telecom - Vijay Yellapragada * mms.mtn.co.za / MTM South Africa - Vijay Yellapragada * rci.rogers.com / Rogers of Canada - Vijay Yellapragada * mmsreply.t-mobile.co.uk / T-Mobile UK - Vijay Yellapragada * waw.plspictures.com / PLSPICTURES.COM mms hosting service ### 2.0.3 / 2008-04-15 (Enter Taxman - The 1040 MMS Form) * fix case when part is image/jpeg declared 'application/octet-stream' * trim dangling image/jpeg text from blackberry messages * file extensions added to filenames that are missing extensions in part headers * anonymize images in fixtures to reduce gem size * T-Mobile update - jesse dp * AT&T/T-Mobile Blackberrry update - Dave Myron ### 2.0.2 / 2008-02-22 (The Jomfru Brothers - proprietors of diefordethklok.com) * added support for mms.vodacom4me.co.za Vodacom South Africa - Jason Haruska * added support for bellsouth.net - Jason Haruska * added support for mms.mycricket.com * Improved Blackberry and iPhone suport - Jason Haruska * added :number key to configuration to provide rules for specifying alternative phone number location * return sender's phone number for mobile.indosat.net.id * return sender's phone number for mms.luxgsm.lu * return sender's phone number for mms.vodacom4me.co.za ### 2.0.1 / 2008-02-08 (Professor Jerry Gustav Munndig - Child control expert) * strip out common blackberry and iPhone signatures * handle carriers that use external mail services such as Yahoo! as the From address * Add support for mobile.indosat.net.id (and yahoo.co.id) - Jason Haruska * Add support for sms.sasktel.com - Jason Haruska ### 2.0.0 / 2008-01-23 (Skwisgaar Skwigelf - fastest guitarist alive) * added support for pxt.vodafone.net.nz PXT New Zealand * added support for mms.o2online.de O2 Germany * added support for orangemms.net Orange UK * added support for txt.att.net AT&T * added support for mms.luxgsm.lu LUXGSM S.A. * added support for mms.netcom.no NetCom (Norway) * added support for mms.three.co.uk Hutchison 3G UK Ltd * removed deprecated #get_number use #number * removed deprecated #get_subject use #subject * removed deprecated #get_body use #body * removed deprecated #get_media use #default_media * removed deprecated #get_text use #default_text * removed deprecated #get_attachment use #attachment * fixed error when Sprint content server responds 500 * better yaml configs * moved TMail dependency from Rails ActionMailer SVN to 'official' Gem * ::new greedily processes MMS unless otherwise specified as an initialize option :process => :lazy * logger moved to initialize option :logger => some_logger * testing using mocks and stubs instead of duck raped Net::HTTP * fixed typo in name of method #attachement to #attachment * fixed broken downloading of Sprint videos ### 1.1.12 / 2007-10-21 (Dr. Ronald von Moldenberg - Endorsement specialist) * fetch original images from Sprint content server (Layton Wedgeworth) * ignore Sprint messages when requested content has been purged from their content server ### 1.1.11 / 2007-10-20 (Dr. Armand Skagerakk Frederickshaven - Mythology expert) * minor fix for attachment_fu where it might call #path on the cgi temp file that is returned by get_attachment * renamed a_t_t_media.rb to att_media.rb to make it autotest happy * masthead.jpg misplaced in mms2r_t_mobile_media_ignore.yml (Layton Wedgeworth) * overridden SprintMedia#process failed to accept block (Layton Wedgeworth) * added method_deprecated to help mark methods that are going to be deprecated in preparation of 1.2.x release * #get_number marked deprecated, use #number instead * #get_subject marked deprecated, use #subject instead * #get_body marked deprecated, use #body instead * #get_text marked deprecated, use #default_text instead * #get_attachment marked deprecated, use #attachment instead * #get_media marked deprecated, use #default_media instead ### 1.1.10 / 2007-09-30 (Face Bones) * fixed a case for a nil match on From in the create method (Luke Francl) * added support for Alltel message.alltel.com (Ben Wood) ### 1.1.9 / 2007-09-08 (Rebecca Nightrod - controlling girlfriend of Nathan Explosion) * fixed broken support for act_as_attachment and attachment_fu ### 1.1.8 / 2007-09-08 (James Grishnack - Head of Behemoth Productions, producer of Blood Ocean) * Added support for Orange of France, Orange orange.fr (Julian Biard) * purge in the process block removed, purge must be called explicitly after processing to clean up extracted temporary media files. ### 1.1.7 / 2007-08-25 (Adam Nergal, friend of Skwisgaar, but not Pickles) * Added support for Orange of Poland, Orange mmsemail.orange.pl (Zbigniew Sobiecki) * Cleaned up documentation modifiers * Cleaned out non-Ruby code idioms ### 1.1.6 / 2007-08-11 (Mustakrakish, the Lake Troll part 2) * Redo of release mistake of 1.1.5 ### 1.1.5 / 2007-08-11 (Mustakrakish, the Lake Troll) * AT&T => mms.att.net not clearing out default "multimedia message" subject to nil (Will Jessup) * Ignore case on default subject for all carriers in corresponding conf/mms2r_XXX_media_subject.yml ### 1.1.4 / 2007-08-07 (Dr. Rockso) * AT&T => mms.att.net support (thanks Mike Chen and Dave Myron) * get_body returns nil when there is not user text (sorry Will!) ### 1.1.3 / 2007-07-10 (Charles Foster Ofdensen) * Helio support by Will Jessup * get_subject returns nil on default carrier subjects ### 1.1.2 / 2007-06-13 (Dethklok roadie #2) * placed versioned hpricot dependency in Hoe's extra_deps (an attempt to appease firebrigade gods or not cause Gem::RemoteInstallationCancelled whichever you prefer) ### 1.1.1 / 2007-06-11 (Dethklok roadie) * rescue rcov non-dependency in Rakefile to make firebrigade happy ### 1.1.0 / 2007-06-08 (Toki Wartooth) * get_body to return body text (Luke Francl) * get_subject returns "" for default subjects now * default subjects listed in yaml by carrier in conf directory * added granularity to Cingular, Sprint, and Verizon carrier services (Will Jessup) * refactored Sprint instance to process all media (Will Jessup + Mike) * optimized text transformations (Will Jessup) * properly handle ISO-8859-1 and UTF-8 text (Will Jessup) * autotest powers activate! (ZenTest autotest discovery enabled) * configuration file ignores, transforms, and subjects all store Regexp's * Put vendor Text::Format & TMail::Mail as an external subversion dependency to the 1.2 stable branch of Rails ActionMailer * added get_number method to return the phone number associated with this MMS * get_media and get_text attachment_fu helper return the largest piece of media of that type if the more than one exits in the media (Luke Francl) * added block support to process() method (Shane Vitarana) ### 1.0.7 / 2007-04-27 (Senator Stampingston) * patch submitted by Luke Francl * added a get_subject method that returns nil when any MMS has a default carrier subject * get_subject returns nil for '', 'Multimedia message', '(no subject)', 'You have new Picture Mail!' ### 1.0.6 / 2007-04-24 (Pickles the Drummer) * patch submitted by Luke Francl * added support for mms.dobson.net (Dobson aka Cellular One) (Luke) * DRY'd up unit tests (Luke) * added get_media instance method that returns first video or image as File (Luke) * File from get_media can be used by/with attachment_fu (Luke) * added get_text instance method that returns first non advertising text * File from get_text can be used by/with attachment_fu ### 1.0.5 / 2007-04-10 (William Murderface) * patch submitted by Luke Francl * made ignore_media? start its text check from the start of the file (Luke) * added new text transform for Verizon messages (Luke) * updated Nextel ignore conf (Luke) * added additional samples and tests for T-Mobile & Verizon (Luke) * cleaned up MMS2R::Media documentation * added Sprint broken image test for when media goes stale on their content server * fixed teardown typo in lots of plases * added tests for 4 three samples of unique variants of Sprint/Nextel text * 100% test coverage! ### 1.0.4 / 2007-04-09 (Metalocalypse) * fix teardown in test_mms2r_sprint.rb (shanesbrain.net) * clean up Net::HTTP in MMS2R::SprintMedia (shanesbrain.net) * added accessor MMS2R::Media.media_dir * fixed a nil issue with underlying tmp working dir * added exception handling around Net::HTTP in MMS2R::SprintMedia ### 1.0.3 / 2007-04-05 (Paper Cut) * Cleaned up packaging and errors in example found by Shane V. http://shanesbrain.net/ ### 1.0.2 / 2007-03-07 * Reorganized tests and fixtures * Added carriers: * Cingular => cingularme.com * Nextel => messaging.nextel.com * Verizon => vtext.com ### 1.0.1 / 2007-03-07 * Flubbed RubyForge release ... do not use this. ### 1.0.0 / 2007-03-06 * Birthday! * AT&T/Cingular => mmode.com * Cingular => mms.mycingular.com * Sprint => pm.sprint.com * Sprint => messaging.sprintpcs.com * T-Mobile => tmomail.net * Verizon => vzwpix.com diff --git a/Manifest.txt b/Manifest.txt index ea3661f..d1564c2 100644 --- a/Manifest.txt +++ b/Manifest.txt @@ -1,188 +1,194 @@ -.gitignore -Gemfile -Gemfile.lock -History.txt -LICENSE -Manifest.txt -README.TMail.txt -README.rdoc -Rakefile conf/1nbox.net.yml conf/aliases.yml conf/bellsouth.net.yml conf/from.yml conf/mediamessaging.o2.co.uk.yml conf/messaging.nextel.com.yml +conf/mms2r_media.yml conf/mms.3ireland.ie.yml conf/mms.ae.yml conf/mms.alltel.com.yml conf/mms.att.net.yml conf/mms.dobson.net.yml +conf/mms.gocbw.com.yml conf/mms.luxgsm.lu.yml conf/mms.mobileiam.ma.yml conf/mms.mtn.co.za.yml conf/mms.mycricket.com.yml conf/mms.myhelio.com.yml conf/mms.netcom.no.yml conf/mms.o2online.de.yml conf/mms.three.co.uk.yml conf/mms.uscc.net.yml conf/mms.vodacom4me.co.za.yml -conf/mms2r_media.yml conf/mobile.indosat.net.id.yml conf/msg.telus.com.yml conf/orangemms.net.yml conf/pm.sprint.com.yml conf/pxt.vodafone.net.nz.yml conf/rci.rogers.com.yml conf/sms.sasktel.com.yml conf/tmomail.net.yml conf/txt.bell.ca.yml conf/unicel.com.yml conf/vmpix.com.yml conf/vzwpix.com.yml conf/waw.plspictures.com.yml dev_tools/anonymizer.rb dev_tools/debug_sprint_nokogiri_parsing.rb +Gemfile +Gemfile.lock +.gitignore +History.txt init.rb lib/ext/mail.rb lib/ext/object.rb -lib/mms2r.rb lib/mms2r/media.rb -lib/mms2r/version.rb lib/mms2r/media/sprint.rb +lib/mms2r.rb +lib/mms2r/version.rb +LICENSE +Manifest.txt mms2r.gemspec +Rakefile +README.rdoc +README.TMail.txt test/fixtures/1nbox-2images-01.mail test/fixtures/1nbox-2images-02.mail test/fixtures/1nbox-2images-03.mail test/fixtures/1nbox-2images-04.mail test/fixtures/3ireland-mms-01.mail test/fixtures/ad_new.txt test/fixtures/alltel-image-01.mail test/fixtures/alltel-mms-01.mail test/fixtures/alltel-mms-03.mail test/fixtures/apple-double-image-01.mail test/fixtures/att-blackberry-02.mail test/fixtures/att-blackberry.mail test/fixtures/att-image-01.mail test/fixtures/att-image-02.mail test/fixtures/att-iphone-01.mail test/fixtures/att-iphone-02.mail test/fixtures/att-iphone-03.mail test/fixtures/att-text-01.mail test/fixtures/bell-canada-image-01.mail +test/fixtures/cincinnati-bell-image-01.mail test/fixtures/cingularme-text-01.mail test/fixtures/cingularme-text-02.mail test/fixtures/dici_un_mois_georgie.txt test/fixtures/dobson-image-01.mail test/fixtures/dot.jpg test/fixtures/generic.mail test/fixtures/handsets.yml test/fixtures/helio-image-01.mail test/fixtures/helio-message-01.mail test/fixtures/iconv-fr-text-01.mail test/fixtures/indosat-image-01.mail test/fixtures/indosat-image-02.mail test/fixtures/info2go-image-01.mail test/fixtures/invalid-byte-seq-outlook.mail test/fixtures/iphone-image-01.mail test/fixtures/iphone-image-02.mail test/fixtures/luxgsm-image-01.mail test/fixtures/maroctelecom-france-mms-01.mail test/fixtures/mediamessaging_o2_co_uk-image-01.mail test/fixtures/mmode-image-01.mail test/fixtures/mms.ae-image-01.mail test/fixtures/mms.mycricket.com-pic-and-text.mail test/fixtures/mms.mycricket.com-pic.mail test/fixtures/mmsreply.t-mobile.co.uk-text-image-01.mail test/fixtures/mobile.mycingular.com-text-01.mail test/fixtures/mtn-southafrica-mms.mail test/fixtures/mycingular-image-01.mail test/fixtures/netcom-image-01.mail test/fixtures/nextel-image-01.mail test/fixtures/nextel-image-02.mail test/fixtures/nextel-image-03.mail test/fixtures/nextel-image-04.mail test/fixtures/o2-de-image-01.mail -test/fixtures/orange-uk-image-01.mail test/fixtures/orangefrance-text-and-image.mail test/fixtures/orangepoland-text-01.mail test/fixtures/orangepoland-text-02.mail +test/fixtures/orange-uk-image-01.mail test/fixtures/pics.cingularme.com-image-01.mail test/fixtures/pxt-image-01.mail test/fixtures/rogers-canada-mms-01.mail test/fixtures/sasktel-image-01.mail +test/fixtures/sprint-ajax-response-failure.html +test/fixtures/sprint-ajax-response-success.json test/fixtures/sprint-blackberry-01.mail test/fixtures/sprint-broken-image-01.mail test/fixtures/sprint-image-01.mail +test/fixtures/sprint-image-missing-message.mail +test/fixtures/sprint.mov test/fixtures/sprint-new-image-01.mail test/fixtures/sprint-pcs-text-01.mail test/fixtures/sprint-purged-image-01.mail test/fixtures/sprint-text-01.mail test/fixtures/sprint-two-images-01.mail test/fixtures/sprint-video-01.mail -test/fixtures/sprint.mov test/fixtures/suncom-blackberry.mail test/fixtures/telus-image-01.mail test/fixtures/three-uk-image-01.mail -test/fixtures/tmo.blackberry.net-image-01.mail test/fixtures/tmobile-blackberry-02.mail test/fixtures/tmobile-blackberry.mail test/fixtures/tmobile-image-01.mail test/fixtures/tmobile-image-02.mail +test/fixtures/tmo.blackberry.net-image-01.mail test/fixtures/unicel-image-01.mail test/fixtures/us-cellular-image-01.mail test/fixtures/verizon-blackberry.mail test/fixtures/verizon-image-01.mail test/fixtures/verizon-image-02.mail test/fixtures/verizon-image-03.mail test/fixtures/verizon-text-01.mail test/fixtures/verizon-video-01.mail -test/fixtures/virgin-mobile-image-01.mail test/fixtures/virgin.ca-text-01.mail +test/fixtures/virgin-mobile-image-01.mail test/fixtures/vodacom4me-co-za-01.mail test/fixtures/vodacom4me-co-za-02.mail test/fixtures/vodacom4me-southafrica-mms-01.mail test/fixtures/vodacom4me-southafrica-mms-04.mail test/fixtures/vtext-text-01.mail test/fixtures/vzwpix.com-image-01.mail test/fixtures/waw.plspictures.com-image-01.mail test/test_1nbox_net.rb test/test_bell_canada.rb test/test_bellsouth_net.rb test/test_helper.rb test/test_invalid_byte_seq_outlook.rb test/test_mediamessaging_o2_co_uk.rb test/test_messaging_nextel_com.rb test/test_messaging_sprintpcs_com.rb test/test_mms2r_media.rb test/test_mms_3ireland_ie.rb test/test_mms_ae.rb test/test_mms_alltel_com.rb test/test_mms_att_net.rb +test/test_mms_cincinnati_bell.rb test/test_mms_dobson_net.rb test/test_mms_luxgsm_lu.rb test/test_mms_mobileiam_ma.rb test/test_mms_mtn_co_za.rb test/test_mms_mycricket_com.rb test/test_mms_myhelio_com.rb test/test_mms_netcom_no.rb test/test_mms_o2online_de.rb test/test_mms_three_co_uk.rb test/test_mms_uscc_net.rb test/test_mms_vodacom4me_co_za.rb test/test_mobile_indosat_net_id.rb test/test_msg_telus_com.rb test/test_orangemms_net.rb test/test_pm_sprint_com.rb test/test_pxt_vodafone_net_nz.rb test/test_rci_rogers_com.rb test/test_sms_sasktel_com.rb test/test_sprint.rb test/test_tmomail_net.rb test/test_unicel_com.rb test/test_vmpix_com.rb test/test_vzwpix_com.rb test/test_waw_plspictures_com.rb vendor/plugins/mms2r/lib/autotest/discover.rb vendor/plugins/mms2r/lib/autotest/mms2r.rb diff --git a/lib/mms2r/version.rb b/lib/mms2r/version.rb index 9b2e05a..d1d7fa5 100644 --- a/lib/mms2r/version.rb +++ b/lib/mms2r/version.rb @@ -1,25 +1,25 @@ module MMS2R class Version def self.major 3 end def self.minor 8 end def self.patch - 0 + 1 end def self.pre nil end def self.to_s [major, minor, patch, pre].compact.join('.') end end end
monde/mms2r
5cabc4e5503d827ac6233859014ae52f70d8df02
added cincinnati bell to the list.
diff --git a/README.rdoc b/README.rdoc index d44dd12..a2c80e4 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,222 +1,223 @@ = mms2r https://github.com/monde/mms2r == DESCRIPTION MMS2R by Mike Mondragon https://github.com/monde/mms2r https://rubygems.org/gems/mms2r http://peepcode.com/products/mms2r-pdf MMS2R is a library that decodes the parts of a MMS message to disk while stripping out advertising injected by the mobile carriers. MMS messages are multipart email and the carriers often inject branding into these messages. Use MMS2R if you want to get at the real user generated content from a MMS without having to deal with the cruft from the carriers. If MMS2R is not aware of a particular carrier no extra processing is done to the MMS other than decoding and consolidating its media. MMS2R can be used to process any multipart email to conveniently access the parts the mail is comprised of. Contact the author to add additional carriers to be processed by the library. Suggestions and patches appreciated and welcomed! === Corpus of carriers currently processed by MMS2R: * 1nbox/Idea: 1nbox.net * 3 Ireland: mms.3ireland.ie * Alltel: mms.alltel.com * AT&T/Cingular/Legacy: mms.att.net, mm.att.net, txt.att.net, mmode.com, mms.mycingular.com, cingularme.com, mobile.mycingular.com pics.cingularme.com * Bell Canada: txt.bell.ca * Bell South / Suncom / SBC Global: bellsouth.net, sbcglobal.net * Cricket Wireless: mms.mycricket.com * Dobson/Cellular One: mms.dobson.net * Helio: mms.myhelio.com * Hutchison 3G UK Ltd: mms.three.co.uk * INDOSAT M2: mobile.indosat.net.id * LUXGSM S.A.: mms.luxgsm.lu * Maroc Telecom / mms.mobileiam.ma * MTM South Africa: mms.mtn.co.za * NetCom (Norway): mms.netcom.no * Nextel: messaging.nextel.com * O2 Germany: mms.o2online.de * O2 UK: mediamessaging.o2.co.uk * Orange & Regional Oranges: orangemms.net, mmsemail.orange.pl, orange.fr * PLSPICTURES.COM mms hosting: waw.plspictures.com * PXT New Zealand: pxt.vodafone.net.nz * Rogers of Canada: rci.rogers.com * SaskTel: sasktel.com, sms.sasktel.com, cdma.sasktel.com * Sprint: pm.sprint.com, messaging.sprintpcs.com, sprintpcs.com * T-Mobile: tmomail.net, mmsreply.t-mobile.co.uk, tmo.blackberry.net * TELUS Corporation (Canada): mms.telusmobility.com, msg.telus.com * U.S. Cellular: mms.uscc.net * UAE MMS: mms.ae * Unicel: unicel.com, info2go.com (note: mobile number is tucked away in a text/plain part for unicel.com) * Verizon: vzwpix.com, vtext.com, labwig.net * Virgin Mobile: vmpix.com, pixmbl.com, vmobl.com, yrmobl.com * Virgin Mobile of Canada: vmobile.ca * Vodacom: mms.vodacom4me.co.za +* Cincinnati Bell: mms.gocbw.com === Corpus of smart phones known to MMS2R: * Apple iPhone variants * Blackberry / Research In Motion variants * Casio variants * Droid variants * Google / Nexus One variants * HTC variants (T-Mobile Dash, Sprint HERO) * LG Electronics variants * Motorola variants * Pantech variants * Qualcom variants * Samsung variants * Sprint variants * UTStarCom variants === As Seen On The Internets - sites known to be using MMS2R in some fashion * twitpic.com[http://www.twitpic.com/] * Simplton[http://simplton.com/] * fanchatter.com[http://www.fanchatter.com/] * camura.com[http://www.camura.com/] * eachday.com[http://www.eachday.com/] * beenup2.com[http://www.beenup2.com/] * snapmylife.com[http://www.snapmylife.com/] * email the author to be listed here == FEATURES * #default_media and #default_text methods return a File that can be used in attachment_fu or Paperclip * #process supports blocks for enumerating over the content of the MMS * #process can be made lazy when :process => :lazy is passed to new * logging is enabled when :logger => your_logger is passed to new * an mms instance acts like a Mail object, any methods not defined on the instance are delegated to it's underlying Mail object * #device_type? returns a symbol representing a device or smartphone type Known smartphones thus far: iPhone, BlackBerry, T-Mobile Dash, Droid, Samsung == BOOKS MMS2R, Making email useful http://peepcode.com/products/mms2r-pdf == SYNOPSIS begin require 'mms2r' rescue LoadError require 'rubygems' require 'mms2r' end # required for the example require 'fileutils' mail = MMS2R::Media.new(Mail.read('some_saved_mail.file')) puts "mail has default carrier subject" if mail.subject.empty? # access the sender's phone number puts "mail was from phone #{mail.number}" # most mail are either image or video, default_media will return the largest # (non-advertising) video or image found file = mail.default_media puts "mail had a media: #{file.inspect}" unless file.nil? # finds the largest (non-advertising) text found file = mail.default_text puts "mail had some text: #{file.inspect}" unless file.nil? # mail.media is a hash that is indexed by mime-type. # The mime-type key returns an array of filepaths # to media that were extract from the mail and # are of that type mail.media['image/jpeg'].each {|f| puts "#{f}"} mail.media['text/plain'].each {|f| puts "#{f}"} # print the text (assumes mail had text) text = IO.readlines(mail.media['text/plain'].first).join puts text # save the image (assumes mail had a jpeg) FileUtils.cp mail.media['image/jpeg'].first, '/some/where/useful', :verbose => true puts "does the mail have quicktime video? #{!mail.media['video/quicktime'].nil?}" puts "plus run anything that Mail provides, e.g. #{mail.to.inspect}" # check if the mail is from a mobile phone puts "mail is from a mobile phone #{mail.is_mobile?}" # determine the device type of the phone puts "mail is from a mobile phone of type #{mail.device_type?}" # inspect default media's exif data if exifr gem is installed and default # media is a jpeg or tiff puts "mail's default media's exif data is:" puts mail.exif.inspect # Block support, process and receive all media types of video. mail.process do |media_type, files| # assumes a Clip model that is an AttachmentFu Clip.create(:uploaded_data => files.first, :title => "From phone") if media_type =~ /video/ end # Another AttachmentFu example, Picture model is an AttachmentFu picture = Picture.new picture.title = mail.subject picture.uploaded_data = mail.default_media picture.save! #remove all the media that was put to temporary disk mail.purge == REQUIREMENTS * Mail (mail) * Nokogiri (nokogiri) * UUIDTools (uuidtools) * EXIF Reader (exif) == INSTALL * sudo gem install mms2r == SOURCE git clone git://github.com/monde/mms2r.git == AUTHORS Copyright (c) 2007-2012 by Mike Mondragon blog[http://plasti.cx/] MMS2R's {Flickr page}[http://www.flickr.com/photos/8627919@N05/] == CONTRIBUTORS * Luke Francl - blog[http://railspikes.com/] * Will Jessup - blog[http://www.willjessup.com/] * Shane Vitarana - blog[http://www.shanesbrain.net/] * Layton Wedgeworth - company[http://www.beenup2.com/] * Jason Haruska - blog[http://software.haruska.com/] * Dave Myron - company[http://contentfree.com/] * Vijay Yellapragada * Jesse Dp - {github profile}[http://github.com/jessedp] * David Alm * Jeremy Wilkins * Matt Conway - {github profile}[http://github.com/wr0ngway] * Kai Kai * Michael DelGaudio * Sai Emrys - blog[http://saizai.com] * Brendan Lim - {github profile}[http://github.com/brendanlim] * Scott Taylor - {github profile}[http://github.com/smtlaissezfaire] * Jaap van der Meer - {github profile}[http://github.com/japetheape] * Karl Baum - {github profile}[http://github.com/kbaum] * James McGrath - blog[http://jamespmcgrath.com]
monde/mms2r
ba507f5f3d4bd1d94a235b49a808dcc9cd0bf3ea
Added support for cincinnati bell (http://www.cincinnatibell.com/) with supporting tests.
diff --git a/.gitignore b/.gitignore index 0dfe305..72376a0 100644 --- a/.gitignore +++ b/.gitignore @@ -1,7 +1,8 @@ .DS_Store coverage/ pkg/ email.txt coverage.info mkmf.log doc/ +.redcar/ diff --git a/conf/mms.gocbw.com.yml b/conf/mms.gocbw.com.yml new file mode 100644 index 0000000..222008a --- /dev/null +++ b/conf/mms.gocbw.com.yml @@ -0,0 +1,5 @@ +--- +transform: + text/plain: + - - !ruby/regexp /^This is an MMS message. Please go to .* to reply to the message.\n\n/i + - "\\1" \ No newline at end of file diff --git a/test/fixtures/cincinnati-bell-image-01.mail b/test/fixtures/cincinnati-bell-image-01.mail new file mode 100644 index 0000000..2cb01a1 --- /dev/null +++ b/test/fixtures/cincinnati-bell-image-01.mail @@ -0,0 +1,2408 @@ +Return-Path: <[email protected]> +Received: by 10.112.55.41 with SMTP id o9csp20103lbp; Sat, 14 Jul 2012 11:04:27 -0700 +Received: by 10.224.208.194 with SMTP id gd2mr10938716qab.96.1342289066653; Sat, 14 Jul 2012 11:04:26 -0700 +Received: from mms2.mms.gocbw.com (mms2.fuse.net. [216.68.79.212]) by mx.google.com with ESMTP id p19si4664151qct.73.2012.07.14.11.04.26; Sat, 14 Jul 2012 11:04:26 -0700 +Received: from opwvsmtp ([192.0.0.75]) by mms2.mms.gocbw.com (InterMail vM.8.00.01.00 201-2244-105-20090324) with SMTP id <20120714180404.JETY17608.mms2.mms.gocbw.com@opwvsmtp> for <[email protected]>; Sat, 14 Jul 2012 14:04:04 -0400 +Date: Sat, 14 Jul 2012 18:04:25 +0000 +From: [email protected] +Sender: 12223334444 <[email protected]> +To: [email protected] +Message-ID: <20120714180404.JETY17608.mms2.mms.gocbw.com@opwvsmtp> +Mime-Version: 1.0 +Content-Type: multipart/mixed; + boundary=5001b4a959bfqwerty_0000; + charset=UTF-8 +Content-Transfer-Encoding: 7bit +Delivered-To: [email protected] +Received-SPF: neutral (google.com: 216.68.79.212 is neither permitted nor + denied by best guess record for domain of [email protected]) + client-ip=216.68.79.212; +Authentication-Results: mx.google.com; spf=neutral (google.com: 216.68.79.212 + is neither permitted nor denied by best guess record for domain of + [email protected]) [email protected] + +This is a multi-part message in MIME format. + +--5001b4a959bfqwerty_0000 +Date: Sat, 14 Jul 2012 18:05:08 +0000 +Mime-Version: 1.0 +Content-Type: text/plain; + charset=utf-8 +Content-Transfer-Encoding: 7bit +Content-ID: <5001b4d46cb82_8169c261058f2@f5d30a94-bcc8-4419-8e57-cc39cc122f8d.mail> + +This is an MMS message. Please go to http://mms.gocbw.com:80/do/legacy/[email protected]&[email protected]&password=AMBGQG to view the message or go to http://mms.gocbw.com:80/do/legacy/[email protected]&[email protected]&password=AMBGQG to reply to the message. + +Wow! A facinating caption for the image. + +--5001b4a959bfqwerty_0000 +Date: Sat, 14 Jul 2012 18:05:08 +0000 +Mime-Version: 1.0 +Content-Type: image/jpeg; + charset=UTF-8; + name=test-file.jpg +Content-Transfer-Encoding: base64 +Content-Disposition: attachment; + filename=test-file.jpg +Content-ID: <test-file> + +/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAYEBQYFBAYGBQYHBwYIChAKCgkJ +ChQODwwQFxQYGBcUFhYaHSUfGhsjHBYWICwgIyYnKSopGR8tMC0oMCUoKSj/ +2wBDAQcHBwoIChMKChMoGhYaKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgoKCgo +KCgoKCgoKCgoKCgoKCgoKCgoKCgoKCj/wAARCAQAAwADASIAAhEBAxEB/8QA +HwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUF +BAQAAAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkK +FhcYGRolJicoKSo0NTY3ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1 +dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWmp6ipqrKztLW2t7i5usLDxMXG +x8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEAAwEBAQEB +AQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAEC +AxEEBSExBhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRom +JygpKjU2Nzg5OkNERUZHSElKU1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOE +hYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3uLm6wsPExcbHyMnK0tPU +1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M5pxcBd2M1Be4decY5pzDA45pOtOBJzkGi4WIyOOTn2p/J5JP +4U4rhSf0poY5PGKAIwuT81OwQflPFKwJI3DFIpCk4/SgBy56k0uOaBnJpM4I +oAXA696EPHzDFH0pwBPJxgUgAnLcUfLg7s5oyM9M03BBpoAP1oY9BmlUZ5pG +GCaAsJnLYGfSl7YoXpx2o4IznFADVyTjFKBjvS9B70EHtQAzHX1pwIPQUik/ +xYFKOvUUAKy4PTmkCjOaU8DOeaQHBOaAFIHIbHtQ3JpD9PxpcfKeRn0NADSQ +G56npUgJIIqNlyuBj60uemetAWA0c+tKSMc8U0HOQOtADlbPQ57GnBSykjFR +quwnPenjjqcCgRXuYSFLrwcVi6gcuPmJx610UrDBHaubvB0Y96uJLKwPFApK +K0EOzQKQUUhDqKbmjNFgsKaSikoAWpIjjr0qKnL0oYMu28wXJxk9qc078nPN +V4ImJ5wB709tqE5ORQAxWY72PT3rooWDwqc53AHNc28pfgDFbdgxe1Q9wMZH +tUSKiWiGK0be9IDwSSacDxUXKsM28nP86VRjABH408LkEk9KYF/AincBuBjg +4pMAfeBNKVZV7ECgv8vIxQLYVcEH0FNxjGDwDTjkqNvU0mOM88UAL1JBx7UK +wLEGk4PPakyASvf1oAHwQfWpnGLWPJ5JNRYAxkZzUsxP2eNeoGeaYEa42DPT +NOPyn5SMelMj4HtTuTkjmlcBqg5POKbNEs0ToRjIwKlI45FAHNFxXMIZjzG4 +wwqM9a1dTg3QF8fMnf2rJz61cWAnGDmo8U8+5yBTfXFAD4van/hUanHSpR0q +Skf/2Q== + + +--5001b4a959bfqwerty_0000-- diff --git a/test/test_mms_cincinnati_bell.rb b/test/test_mms_cincinnati_bell.rb new file mode 100644 index 0000000..8231f5c --- /dev/null +++ b/test/test_mms_cincinnati_bell.rb @@ -0,0 +1,24 @@ +require "test_helper" + +class TestMmsCincinnatiBell < Test::Unit::TestCase + include MMS2R::TestHelper + + def test_mms_image_cincinnati_bell + # sms.sasktel.com service + mail = mail('cincinnati-bell-image-01.mail') + mms = MMS2R::Media.new(mail) + assert_equal "12223334444", mms.number + assert_equal "mms.gocbw.com", mms.carrier + assert_equal "", mms.subject + assert_nil mms.media['text/html'] + assert_nil mms.media['image/gif'] + # we have media and text, to 2 media items + assert_equal 2, mms.media.size + assert_not_nil mms.media['image/jpeg'] + assert_equal 1, mms.media['image/jpeg'].size + assert_match(/test-file.jpg$/, mms.media['image/jpeg'].first) + assert_file_size(mms.media['image/jpeg'].first, 106024) + mms.purge + end + +end
monde/mms2r
be8fdcf8785838400101b6e4dfe42f4f84b91d1a
Notes for shipping 3.8.0
diff --git a/History.txt b/History.txt index b6441a9..ee0405f 100644 --- a/History.txt +++ b/History.txt @@ -1,440 +1,445 @@ +### 3.8.0 / 2012-07-04 (Dr. Donald Gorfield – Comedy specialist) + +* 1 major enhancement + * Handle MMS from Sprint that have their media attached rather than CDN'd + ### 3.7.1 / 2012-06-04 (Abrigail Remeltindtdrinc - The Record Cleaner) * 2 minor enhancements * Improve processing of Sprint media - James McGrath * RDoc format documentation - James McGrath ### 3.7.0 / 2012-05-31 (The Teenager - Edgar's brother via Eric's face) * 2 major enhancements * Improve processing of Sprint media - James McGrath * Remove Hoe and gemcutter dependencies ### 3.6.4 / 2012-04-22 (Molly - Pickles' mother) * 1 minor enhancement * strip a variation of the iphone default footer ### 3.6.3 / 2012-03-25 (Dethklok Minute Host - host of The Dethklok Minute) * 1 minor enhancement * strip Windows phone default footer ### 3.6.2 / 2012-02-12 (Mr. Gojira - Owner Mr. Gojira's Driving School - retake driver's exam) * 1 minor enhancement * Change user agent given to Sprint so it returns a properly sized image. ### 3.6.1 / 2012-02-11 (Mr. Gojira - Owner Mr. Gojira's Driving School) * 1 minor enhancement * use Net::HTTP#get2 to fetch Sprint content ### 3.6.0 / 2012-01-19 (Agent 216 - assassin, master of infiltration and sabotage) * 1 major enhancement * Ruby 1.8.7, 1.9.2, and 1.9.3 compatible * 1 bug fix * A fix for the utf-8 encoding issue with ruby 1.9.2 - minimul / Christian ### 3.5.1 / 2011-12-11 (Mashed Potato Johnson - oldest living blues guitarist in the world) * 1 bug fix * A fix for the utf-8 encoding issue with ruby 1.9.2 - James McGrath ### 3.5.0 / 2011-12-01 (Dr. Milminiman Lamilim Swimwambli - Marriage expert) * 1 major bug fix * In Ruby 1.9.X MMS2R::Media::Sprint was not fetching content from Sprint's CDN correctly because the implementation of Net::HTTP in 1.9.X passes a User-Agent header of "Ruby" to which Sprint responds with a fake 500 - with help from James McGrath ### 3.4.1 / 2011-11-06 (Fatty Ding-Dongs, Dethklok foster child) * 2 major enhancements * Additional means to detect android, iphone, motorola, nokia, palm handsets * Additional known SMS/MMS domains mm.att.net, labwig.net, cdma.sasktel.com ### 3.4.0 / 2011-10-31 (Serveta Skwigelf, Skwisgaar's hot mom) * 2 major enhancements * regexp's in yaml configs are store as a ruby regexp and not a string that is evaled. * character encoding capability with 1.8 rubies and 1.9 rubies. ### 3.3.1 / 2011-01-01 (Reverend Aslaug Wartooth (deceased), Toki's dad) * 2 minor enhancements * new method #default_html returns the default html attachment * #body will return the default plain text, or default stripped html text ### 3.3.0 / 2010-12-31 (Charles Foster Offdensen - CFO, dethklok) * 1 major enhancement * MMS2R::Media::Sprint is now a module that is extended in for processing Sprint content rather than being child class of MMS2R::Media Extension is the strategy to use for overwriting template methods now * 1 minor enhancement * process new Sprint subject - Jason Hooper * new SaskTel mms/sms domain alias sasktel.com * new Virgin Mobile mms/sms domain alias yrmobl.com ### 3.2.0 / 2010-08-17 (Antonio "Tony" DiMarco Thunderbottom - bassist) * 3 minor enhancements * updated readme with latest sites known to use mms2r * bundler assimilated * loading rubygems only if it's required, like rake ### 3.1.0 / 2010-07-09 (Dick "Magic Ears" Knubbler - music producer) * 8 minor enhancements * Detects additional Bell/AT&T domain sbcglobal.net as a handset * Detects additional Virgin mobile domains pixmbl.com vmobl.com as a handset * Expanded mobile phone detection for handset makers by : Casio, Google Nexus One, LG Electronics, Motorola, Pantech, Qualcom, Samsung, Sprint, UTStarCom * EXIF Reader (exifr) is integral to MMS2R and is now a required gem * upgrade Mail to 2.2.5 * depend on latest gems * corrected example - Jason Hooper * added As Seen On The Internet to README that lists sites known to be using MMS2R in some fashion ### 3.0.1 / 2010-03-28 (Lavona Succuboso - leader of "Succuboso Explosion") * 1 minor enhancement * support for U.S. Cellular ### 3.0.0 / 2010-02-24 (General Crozier - Chairman of the Joint Chiefs of Staff) * 1 new feature * dependence upon Mail gem rather than TMail gem ### 2.4.1 / 2010-02-07 (Vater Orlaag - political and spiritual specialist) * 3 minor enhancements * make sure filename is free of new lines - laurynas * recognize HTC HERO200 as a smart phone * recognize HTC Eris as a smart phone ### 2.4.0 / 2009-12-20 (Dr. Nanemiltred Philtendrieden - specialist on celebrity death) * 1 new feature * replace Hpricot with Nokogiri for html parsing of Sprint data * 3 minor enhancements * smartphone identities stored in conf/mms2r_media.yml * identify Motorola Droid as a smartphone * identify T-Mobile Dash as a smartphone * use uuidtools for naming temp directories - kbaum ### 2.3.0 / 2009-08-30 (Snakes 'n' Barrels Greatest Hits) * 5 new features * detect smartphone status/type based on model metadata from jpeg and tiff exif data using exifr gem, access exif data with MMS2R::Media#exif * make MMS2R Rails gem packaging friendly with an init.rb - Scott Taylor, smtlaissezfaire * delegate missing methods to mms2r's tmail object so that mms2r behaves as if it were a tmail object - Sai Emrys, saizai * default_media can return an attachment of application content type - Brendan Lim, brendanlim * MMS2R.parse(raw_mail) convenience class method that parses and returns an mms2r from a mail file - saizai * 4 minor enhancements * make examples more 'mail' specific to enforce the fact that an mms is a multipart email - saizai * update for text in vzwpix.com default carrier message * detecting smartphone (blackberries and iphones for now) is more versatile from reading mail headers * expanded filtering of carrier advertising text in mms from smartphones ### 2.2.0 / 2009-01-04 (Rikki Kixx - owner of a franchise of rehab centers) * 3 new features * MMS2R::Media#is_mobile? best guess if the sender was a mobile device * MMS2R::Media#device_type? best guess of the mobile device type. Simple heuristics thus far for :blackberry :iphone :handset :unknown could be expanded for exif probing or additinal shifting of mail header * from array in conf/from.yml to provide granularity to determine carrier domain (caused by tmo.blackberry.net) * 4 minor enhancements * support for Virgin Canada messaging service vmobile.ca * support for text service messaging.sprintpcs.com * additional BlackBerry coverage from T-Mobile tmo.blackberry.net provider * legacy support for mobile.mycingular.com, pics.cingularme.com * 3 bug fixes * iPhone default subject - jesse dp http://rubyforge.org/tracker/?func=detail&atid=11789&aid=22951&group_id=3065 * add sprintpcs.com to pm.sprint.com aliases * fix OS X long filename issues - Matt Conway ### 2.1.3 / 2008-11-06 (Dr. Ramonolith Chesterfield - Military pharmaceutical psychotropic drug manufacturing expert * 1 minor enhancement * added mms.ae support ### 2.1.2 / 2008-10-21 (Toki's mom, Anja Wartooth) * 2 minor enhancments * Sprint subject update - jesse dp * Virgin Mobile support vmpix.com ### 2.1.1 / 2008-09-24 (Lavona Succuboso, Nathan Explosion uber-groupie) * 4 minor enhancments * Bell Canada support txt.bell.ca - Matt Conway / Snap My Life - http://github.com/wr0ngway, http://github.com/sml * Unicel support unicel.com - Michael DelGaudio * info2go.com support / Unicel * TELUS Corporation support mms.telusmobility.com, msg.telus.com * add test to check that gem builds correctly as a github gem * 1 bug fix * Iconv utf8 fix - Kai Kai ### 2.1.0 / 2008-07-30 (Dr. Gibbons – Birthday expert and Murderface expert) * 1 major enhancement: * opens up TMail for improved query method patterned code in MMS2R * 2 minor enhancements: * UK O2 support mediamessaging.o2.co.uk - Jeremy Wilkins * Write non text files with binary bit set on Windows - David Alm * source hosted on github: git clone git://github.com/monde/mms2r.git ### 2.0.5 / 2008-07-17 (Dr. Ralphus Galkensmelter - Psychological death expert) * Deal with Apple Mail multipart/appledouble - jesse dp ### 2.0.4 / 2008-04-28 (Mr. Selatcia - elder member of The Tribunal) * updated mms.vodacom4me.co.za Vodacom South Africa - Vijay Yellapragada * 1nbox.net / Idea cellular 1nbox.net - Vijay Yellapragada * mms.3ireland.ie / 3 Ireland - Vijay Yellapragada * mms.alltel.com / Alltel (reverted message.alltel.com) - Vijay Yellapragada * mms.mobileiam.ma / Maroc Telecom - Vijay Yellapragada * mms.mtn.co.za / MTM South Africa - Vijay Yellapragada * rci.rogers.com / Rogers of Canada - Vijay Yellapragada * mmsreply.t-mobile.co.uk / T-Mobile UK - Vijay Yellapragada * waw.plspictures.com / PLSPICTURES.COM mms hosting service ### 2.0.3 / 2008-04-15 (Enter Taxman - The 1040 MMS Form) * fix case when part is image/jpeg declared 'application/octet-stream' * trim dangling image/jpeg text from blackberry messages * file extensions added to filenames that are missing extensions in part headers * anonymize images in fixtures to reduce gem size * T-Mobile update - jesse dp * AT&T/T-Mobile Blackberrry update - Dave Myron ### 2.0.2 / 2008-02-22 (The Jomfru Brothers - proprietors of diefordethklok.com) * added support for mms.vodacom4me.co.za Vodacom South Africa - Jason Haruska * added support for bellsouth.net - Jason Haruska * added support for mms.mycricket.com * Improved Blackberry and iPhone suport - Jason Haruska * added :number key to configuration to provide rules for specifying alternative phone number location * return sender's phone number for mobile.indosat.net.id * return sender's phone number for mms.luxgsm.lu * return sender's phone number for mms.vodacom4me.co.za ### 2.0.1 / 2008-02-08 (Professor Jerry Gustav Munndig - Child control expert) * strip out common blackberry and iPhone signatures * handle carriers that use external mail services such as Yahoo! as the From address * Add support for mobile.indosat.net.id (and yahoo.co.id) - Jason Haruska * Add support for sms.sasktel.com - Jason Haruska ### 2.0.0 / 2008-01-23 (Skwisgaar Skwigelf - fastest guitarist alive) * added support for pxt.vodafone.net.nz PXT New Zealand * added support for mms.o2online.de O2 Germany * added support for orangemms.net Orange UK * added support for txt.att.net AT&T * added support for mms.luxgsm.lu LUXGSM S.A. * added support for mms.netcom.no NetCom (Norway) * added support for mms.three.co.uk Hutchison 3G UK Ltd * removed deprecated #get_number use #number * removed deprecated #get_subject use #subject * removed deprecated #get_body use #body * removed deprecated #get_media use #default_media * removed deprecated #get_text use #default_text * removed deprecated #get_attachment use #attachment * fixed error when Sprint content server responds 500 * better yaml configs * moved TMail dependency from Rails ActionMailer SVN to 'official' Gem * ::new greedily processes MMS unless otherwise specified as an initialize option :process => :lazy * logger moved to initialize option :logger => some_logger * testing using mocks and stubs instead of duck raped Net::HTTP * fixed typo in name of method #attachement to #attachment * fixed broken downloading of Sprint videos ### 1.1.12 / 2007-10-21 (Dr. Ronald von Moldenberg - Endorsement specialist) * fetch original images from Sprint content server (Layton Wedgeworth) * ignore Sprint messages when requested content has been purged from their content server ### 1.1.11 / 2007-10-20 (Dr. Armand Skagerakk Frederickshaven - Mythology expert) * minor fix for attachment_fu where it might call #path on the cgi temp file that is returned by get_attachment * renamed a_t_t_media.rb to att_media.rb to make it autotest happy * masthead.jpg misplaced in mms2r_t_mobile_media_ignore.yml (Layton Wedgeworth) * overridden SprintMedia#process failed to accept block (Layton Wedgeworth) * added method_deprecated to help mark methods that are going to be deprecated in preparation of 1.2.x release * #get_number marked deprecated, use #number instead * #get_subject marked deprecated, use #subject instead * #get_body marked deprecated, use #body instead * #get_text marked deprecated, use #default_text instead * #get_attachment marked deprecated, use #attachment instead * #get_media marked deprecated, use #default_media instead ### 1.1.10 / 2007-09-30 (Face Bones) * fixed a case for a nil match on From in the create method (Luke Francl) * added support for Alltel message.alltel.com (Ben Wood) ### 1.1.9 / 2007-09-08 (Rebecca Nightrod - controlling girlfriend of Nathan Explosion) * fixed broken support for act_as_attachment and attachment_fu ### 1.1.8 / 2007-09-08 (James Grishnack - Head of Behemoth Productions, producer of Blood Ocean) * Added support for Orange of France, Orange orange.fr (Julian Biard) * purge in the process block removed, purge must be called explicitly after processing to clean up extracted temporary media files. ### 1.1.7 / 2007-08-25 (Adam Nergal, friend of Skwisgaar, but not Pickles) * Added support for Orange of Poland, Orange mmsemail.orange.pl (Zbigniew Sobiecki) * Cleaned up documentation modifiers * Cleaned out non-Ruby code idioms ### 1.1.6 / 2007-08-11 (Mustakrakish, the Lake Troll part 2) * Redo of release mistake of 1.1.5 ### 1.1.5 / 2007-08-11 (Mustakrakish, the Lake Troll) * AT&T => mms.att.net not clearing out default "multimedia message" subject to nil (Will Jessup) * Ignore case on default subject for all carriers in corresponding conf/mms2r_XXX_media_subject.yml ### 1.1.4 / 2007-08-07 (Dr. Rockso) * AT&T => mms.att.net support (thanks Mike Chen and Dave Myron) * get_body returns nil when there is not user text (sorry Will!) ### 1.1.3 / 2007-07-10 (Charles Foster Ofdensen) * Helio support by Will Jessup * get_subject returns nil on default carrier subjects ### 1.1.2 / 2007-06-13 (Dethklok roadie #2) * placed versioned hpricot dependency in Hoe's extra_deps (an attempt to appease firebrigade gods or not cause Gem::RemoteInstallationCancelled whichever you prefer) ### 1.1.1 / 2007-06-11 (Dethklok roadie) * rescue rcov non-dependency in Rakefile to make firebrigade happy ### 1.1.0 / 2007-06-08 (Toki Wartooth) * get_body to return body text (Luke Francl) * get_subject returns "" for default subjects now * default subjects listed in yaml by carrier in conf directory * added granularity to Cingular, Sprint, and Verizon carrier services (Will Jessup) * refactored Sprint instance to process all media (Will Jessup + Mike) * optimized text transformations (Will Jessup) * properly handle ISO-8859-1 and UTF-8 text (Will Jessup) * autotest powers activate! (ZenTest autotest discovery enabled) * configuration file ignores, transforms, and subjects all store Regexp's * Put vendor Text::Format & TMail::Mail as an external subversion dependency to the 1.2 stable branch of Rails ActionMailer * added get_number method to return the phone number associated with this MMS * get_media and get_text attachment_fu helper return the largest piece of media of that type if the more than one exits in the media (Luke Francl) * added block support to process() method (Shane Vitarana) ### 1.0.7 / 2007-04-27 (Senator Stampingston) * patch submitted by Luke Francl * added a get_subject method that returns nil when any MMS has a default carrier subject * get_subject returns nil for '', 'Multimedia message', '(no subject)', 'You have new Picture Mail!' ### 1.0.6 / 2007-04-24 (Pickles the Drummer) * patch submitted by Luke Francl * added support for mms.dobson.net (Dobson aka Cellular One) (Luke) * DRY'd up unit tests (Luke) * added get_media instance method that returns first video or image as File (Luke) * File from get_media can be used by/with attachment_fu (Luke) * added get_text instance method that returns first non advertising text * File from get_text can be used by/with attachment_fu ### 1.0.5 / 2007-04-10 (William Murderface) * patch submitted by Luke Francl * made ignore_media? start its text check from the start of the file (Luke) * added new text transform for Verizon messages (Luke) * updated Nextel ignore conf (Luke) * added additional samples and tests for T-Mobile & Verizon (Luke) * cleaned up MMS2R::Media documentation * added Sprint broken image test for when media goes stale on their content server * fixed teardown typo in lots of plases * added tests for 4 three samples of unique variants of Sprint/Nextel text * 100% test coverage! ### 1.0.4 / 2007-04-09 (Metalocalypse) * fix teardown in test_mms2r_sprint.rb (shanesbrain.net) * clean up Net::HTTP in MMS2R::SprintMedia (shanesbrain.net) * added accessor MMS2R::Media.media_dir * fixed a nil issue with underlying tmp working dir * added exception handling around Net::HTTP in MMS2R::SprintMedia ### 1.0.3 / 2007-04-05 (Paper Cut) * Cleaned up packaging and errors in example found by Shane V. http://shanesbrain.net/ ### 1.0.2 / 2007-03-07 * Reorganized tests and fixtures * Added carriers: * Cingular => cingularme.com * Nextel => messaging.nextel.com * Verizon => vtext.com ### 1.0.1 / 2007-03-07 * Flubbed RubyForge release ... do not use this. ### 1.0.0 / 2007-03-06 * Birthday! * AT&T/Cingular => mmode.com * Cingular => mms.mycingular.com * Sprint => pm.sprint.com * Sprint => messaging.sprintpcs.com * T-Mobile => tmomail.net * Verizon => vzwpix.com diff --git a/lib/mms2r/version.rb b/lib/mms2r/version.rb index 627ea75..9b2e05a 100644 --- a/lib/mms2r/version.rb +++ b/lib/mms2r/version.rb @@ -1,25 +1,25 @@ module MMS2R class Version def self.major 3 end def self.minor - 7 + 8 end def self.patch - 1 + 0 end def self.pre nil end def self.to_s [major, minor, patch, pre].compact.join('.') end end end
monde/mms2r
33ff5daa5acd8fea363eef4e5d549097f59c2ee5
Refactor to account for some Sprint messages having attached files and rather than being hosted on their CDN.
diff --git a/lib/mms2r/media.rb b/lib/mms2r/media.rb index 85290ca..50d86e2 100644 --- a/lib/mms2r/media.rb +++ b/lib/mms2r/media.rb @@ -1,845 +1,860 @@ #-- # Copyright (c) 2007-2012 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ ## # = Synopsis # # MMS2R is a library to collect media files from MMS messages. MMS messages # are multipart emails and mobile carriers often inject branding into these # messages. MMS2R strips the advertising from an MMS leaving the actual user # generated media. # # The Tracker for MMS2R is located at # http://rubyforge.org/tracker/?group_id=3065 # Please submit bugs and feature requests using the Tracker. # # If MMS from a carrier not known by MMS2R is encountered please submit a # sample to the author for inclusion in this project. # # == Stand Alone Example # # begin # require 'mms2r' # rescue LoadError # require 'rubygems' # require 'mms2r' # end # mail = Mail.read("sample-MMS.file") # mms = MMS2R::Media.new(mail) # subject = mms.subject # number = mms.number # file = mms.default_media # mms.purge # # == Rails ActionMailer#receive w/ AttachmentFu Example # # def receive(mail) # mms = MMS2R::Media.new(mail) # picture = Picture.new # picture is an attachemnt_fu model # picture.title = mms.subject # picture.uploaded_data = mms.default_media # picture.save! # mms.purge # end # # == More Examples # # See the README.rdoc file for more examples # # == Built In Configuration # # A custom configuration can be created for processing the MMS from carriers # that are not currently known by MMS2R. In the conf/ directory create a # YAML file named by combining the domain name of the MMS sender plus a .yml # extension. For instance the configuration of senders from AT&T's cellular # service with a Sender pattern of [email protected] have a configuration # named conf/mms.att.net.yml # # The YAML configuration contains a Hash with instructions for determining what # is content generated by the user and what is content inserted by the carrier. # # The root hash itself has two hashes under the keys 'ignore' and 'transform', # and an array under the 'number' key. # Each hash is itself keyed by mime-type. The value pointed to by the mime-type # key is an array. The ignore arrays are first inspected as regular expressions # else are used as a equality for a string filename. Ignores # work by filename # for the multi-part of the MMS that is being inspected. The array pointed to # by the 'number' key represents an alternate mail header where the sender's # number can be found with a regular expression and replacement value for a # gsub. # # The transform arrays are themselves an array of two element arrays. The elements # are regexp parameters for gsub. # # Ignore instructions are honored first then transform instructions. In the sample, # masthead.jpg is ignored as a regular expression, and spacer.gif is ignored as a # filename comparison. The transform has a match and a replacement, see the gsub # documentation for more information about match and replace. # # -- # ignore: # image/jpeg: # - /^masthead.jpg$/i # image/gif: # - spacer.gif # text/plain: # - /\AThis message was sent using PIX-FLIX Messaging service from .*/m # transform: # text/plain: # - - /\A(.+?)\s+This message was sent using PIX-FLIX Messaging .*/m # - "\1" # number: # - from # - /^([^\s]+)\s.*/ # - "\1" # # Carriers often provide their services under many different domain names. # The conf/aliases.yml is a YAML file with a hash that maps alternative or # legacy carrier names to the most common name of their service. For example # in terms of MMS2R txt.att.net is an alias for mms.att.net. Therefore when # an MMS with a Sender of txt.att.net is processed MMS2R will use the # mms.att.net configuration to process the message. module MMS2R class MMS2R::Media # Pass off everything we don't do to the Mail object # TODO: refactor to explicit addition a la http://blog.jayfields.com/2008/02/ruby-replace-methodmissing-with-dynamic.html def method_missing method, *args, &block mail.send method, *args, &block end ## # Mail object that the media files were derived from. attr_reader :mail ## # media returns the hash of media. The media hash is keyed by mime-type # such as 'text/plain' and the value mapped to the key is an array of # media that are of that type. attr_reader :media ## # Carrier is the domain name of the carrier. If the carrier is not known # the carrier will be set to 'mms2r.media' attr_reader :carrier ## # Base working dir where media for a unique mms message are dropped attr_reader :media_dir ## # Determine if return-path or from is going to be used to desiginate the # origin carrier. If the domain in the From header is listed in # conf/from.yaml then that is the carrier domain. Else if there is a # Return-Path header its address's domain is the carrier doamin, else # use From header's address domain. def self.domain(mail) return_path = case when mail.return_path mail.return_path ? mail.return_path.split('@').last : '' else '' end from_domain = case when mail.from && mail.from.first mail.from.first.split('@').last else '' end f = File.expand_path(File.join(self.conf_dir(), "from.yml")) from = YAML::load_file(f) ret = case when from.include?(from_domain) from_domain when return_path.present? return_path else from_domain end ret end ## # Initialize a new MMS2R::Media comprised of a mail. # # Specify options to initialize with: # :logger => some_logger for logging # :process => :lazy, for non-greedy processing upon initialization # # #process will have to be called explicitly if the lazy process option # is chosen. def initialize(mail, opts={}) @mail = mail @logger = opts[:logger] log("#{self.class} created", :info) @carrier = self.class.domain(mail) @dir_count = 0 sha = Digest::SHA1.hexdigest("#{@carrier}-#{Time.now.to_i}-#{rand}") @media_dir = File.expand_path( File.join(self.tmp_dir(), "#{self.safe_message_id(@mail.message_id)}_#{sha}")) @media = {} @was_processed = false @number = nil @subject = nil @body = nil @exif = nil @default_media = nil @default_text = nil @default_html = nil f = File.expand_path(File.join(self.conf_dir(), "aliases.yml")) @aliases = YAML::load_file(f) conf = "#{@aliases[@carrier] || @carrier}.yml" f = File.expand_path(File.join(self.conf_dir(), conf)) c = File.exist?(f) ? YAML::load_file(f) : {} @config = self.class.initialize_config(c) processor_module = MMS2R::CARRIERS[@carrier] extend processor_module if processor_module lazy = (opts[:process] == :lazy) rescue false self.process() unless lazy end ## # Get the phone number associated with this MMS if it exists. The value # returned is simplistic, it is just the user name of the from address # before the @ symbol. Validation of the number is left to you. Most # carriers are using the real phone number as the username. def number unless @number params = config['number'] if params && params.any? && (header = mail.header[params[0]]) @number = header.to_s.gsub(params[1], params[2]) end if @number.nil? || @number.blank? @number = mail.from.first.split(/@|\//).first rescue "" end end @number end ## # Return the Subject for this message, returns "" for default carrier # subject such as 'Multimedia message' for ATT&T carrier. def subject unless @subject subject = mail.subject.strip rescue "" ignores = config['ignore']['text/plain'] if ignores && ignores.detect{|s| s == subject} @subject = "" else @subject = transform_text('text/plain', subject).last end end @subject end # Convenience method that returns a string including all the text of the # default text/plain file found. If the plain text is blank then it returns # stripped down version of the title and body of default text/html. Returns # empty string if no body text is found. def body text_file = default_text @body = text_file ? IO.readlines(text_file.path).join.strip : "" @body.force_encoding("ISO-8859-1") if RUBY_VERSION >= "1.9" && @body.encoding == "ASCII-8BIT" begin ic = Iconv.new('UTF-8', 'ISO-8859-1' ) @body = ic.iconv(@body) @body << ic.iconv(nil) ic.close rescue Exception => e end if @body.blank? && html_file = default_html html = Nokogiri::HTML(IO.read(html_file.path)) @body = (html.xpath("//head/title").map(&:text) + html.xpath("//body/*").map(&:text)).join(" ") end @body end # Returns a File with the most likely candidate for the user-submitted # media. Given that most MMS messages only have one file attached, this # method will try to return that file. Singleton methods are added to # the File object so it can be used in place of a CGI upload (local_path, # original_filename, size, and content_type) such as in conjunction with # AttachementFu. The largest file found in terms of bytes is returned. # # Returns nil if there are not any video or image Files found. def default_media @default_media ||= attachment(['video', 'image', 'application', 'text']) end # Returns a File with the most likely candidate that is text, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_text @default_text ||= attachment(['text/plain']) end # Returns a File with the most likely candidate that is html, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_html @default_html ||= attachment(['text/html']) end ## # process is a template method and collects all the media in a MMS. # Override helper methods to this template to clean out advertising and/or # ignore media that are advertising. This method should not be overridden # unless there is an extreme special case in processing the media of a MMS # (like Sprint) # # Helper methods for the process template: # * ignore_media? -- true if the media contained in a part should be ignored. # * process_media -- retrieves media to temporary file, returns path to file. # * transform_text -- called by process_media, strips out advertising. # * temp_file -- creates a temporary filepath based on information from the part. # # Block support: # Call process() with a block to automatically iterate through media. # For example, to process and receive only media of video type: # mms.process do |media_type, file| # results << file if media_type =~ /video/ # end # # note: purge must be explicitly called to remove the media files # mms2r extracts from an mms message. - def process() # :yields: media_type, file + def process # :yields: media_type, file unless @was_processed log("#{self.class} processing", :info) - parts = mail.multipart? ? mail.parts : [mail] - - # Double check for multipart/related, if it exists replace it with its - # children parts. Do this twice as multipart/alternative can have - # children and we want to fold everything down - for i in 1..2 - flat = [] - parts.each do |p| - if p.multipart? - p.parts.each {|mp| flat << mp } - else - flat << p - end - end - parts = flat.dup - end - - # get to work - parts.each do |p| - t = p.part_type? - unless ignore_media?(t,p) - t,f = process_media(p) - add_file(t,f) unless t.nil? || f.nil? + parts = self.folded_parts(mail) + parts.each do |part| + if part.part_type? == 'text/html' + process_html_part(part) + else + process_part(part) end end @was_processed = true end # when process acts upon a block if block_given? media.each do |k, v| yield(k, v) end end end ## # Helper for process template method to determine if media contained in a # part should be ignored. Producers should override this method to return # true for media such as images that are advertising, carrier logos, etc. # See the ignore section in the discussion of the built-in configuration. def ignore_media?(type, part) ignores = config['ignore'][type] || [] ignore = ignores.detect{ |test| filename?(part) == test} ignore ||= ignores.detect{ |test| filename?(part) =~ test if test.is_a?(Regexp) } ignore ||= ignores.detect{ |test| part.body.decoded.strip =~ test if test.is_a?(Regexp) } ignore ||= (part.body.decoded.strip.size == 0 ? true : nil) ignore.nil? ? false : true end ## # Helper for process template method to decode the part based on its type # and write its content to a temporary file. Returns path to temporary # file that holds the content. Parts with a main type of text will have # their contents transformed with a call to transform_text # # Producers should only override this method if the parts of the MMS need # special treatment besides what is expected for a normal mime part (like # Sprint). # # Returns a tuple of content type, file path def process_media(part) # Mail body auto-magically decodes quoted # printable for text/html type. file = temp_file(part) if part.part_type? =~ /^text\// || part.part_type? == 'application/smil' type, content = transform_text_part(part) mode = 'wb' else if part.part_type? == 'application/octet-stream' type = type_from_filename(filename?(part)) else type = part.part_type? end content = part.body.decoded mode = 'wb' # open with binary bit for Windows for non text end return type, nil if content.nil? || content.empty? log("#{self.class} writing file #{file}", :info) File.open(file, mode){ |f| f.write(content) } return type, file end + ## + # Helper to decide if a part should be kept or ignored + + def process_part(part) + return if ignore_media?(part.part_type?, part) + + type, file = process_media(part) + add_file(type, file) unless type.nil? || file.nil? + end + + ## + # Helper to decide if a html part should be kept or ignored. + # We are defining it here primarily for the benefit so that Sprint + # can override a special case for processing. + + def process_html_part(part) + process_part(part) + end + ## # Helper for process_media template method to transform text. # See the transform section in the discussion of the built-in # configuration. def transform_text(type, text, original_encoding = 'ISO-8859-1') return type, text if !config['transform'] || !(transforms = config['transform'][type]) begin ic = Iconv.new('UTF-8', original_encoding ) utf_t = ic.iconv(text) utf_t << ic.iconv(nil) ic.close rescue Exception => e utf_t = text end transforms.each do |transform| next unless transform.size == 2 p = transform.first r = transform.last utf_t = utf_t.gsub(p, r) rescue utf_t end return type, utf_t end ## # Helper for process_media template method to transform text. def transform_text_part(part) type = part.part_type? text = part.body.decoded.strip transform_text(type, text) end ## # Helper for process template method to name a temporary filepath based on # information in the part. This version attempts to honor the name of the # media as labeled in the part header and creates a unique temporary # directory for writing the file so filename collision does not occur. # Consumers of this method expect the directory structure to the file # exists, if the method is overridden it is mandatory that this behavior is # retained. def temp_file(part) file_name = filename?(part) File.expand_path(File.join(msg_tmp_dir(),File.basename(file_name))) end ## # Purges the unique MMS2R::Media.media_dir directory created # for this producer and all of the media that it contains. - def purge() + def purge log("#{self.class} purging #{@media_dir} and all its contents", :info) FileUtils.rm_rf(@media_dir) end ## # Helper to add a file to the media hash. def add_file(type, file) media[type] = [] unless media[type] media[type] << file end ## # Helper to temp_file to create a unique temporary directory that is a # child of tmp_dir This version is based on the message_id of the mail. - def msg_tmp_dir() + def msg_tmp_dir @dir_count += 1 dir = File.expand_path(File.join(@media_dir, "#{@dir_count}")) FileUtils.mkdir_p(dir) dir end ## # returns a filename declared for a part, or a default if its not defined def filename?(part) name = part.filename if (name.nil? || name.empty?) if part.content_id && (matched = /^<(.+)>$/.match(part.content_id)) name = matched[1] else name = "#{Time.now.to_f}.#{self.default_ext(part.part_type?)}" end end # FIXME FWIW, janky look for dot extension 1 to 4 chars long name = (name =~ /\..{1,4}$/ ? name : "#{name}.#{self.default_ext(part.part_type?)}").strip # handle excessively large filenames if name.size > 255 ext = File.extname(name) base = File.basename(name, ext) name = "#{base[0, 255 - ext.size]}#{ext}" end name end def aliases @aliases end ## # Best guess of the mobile device type. Simple heuristics thus far by # inspecting mail headers and jpeg/tiff exif metadata, and file name. # Known smart phone types thus far are # # * :blackberry # * :dash # * :droid # * :htc # * :iphone # * :lge # * :motorola # * :nokia # * :palm # * :pantech # * :samsung # # If the message is from a carrier known to MMS2R, and not a smart phone # its type is returned as :handset # Otherwise device type is :unknown def device_type? file = attachment(['image']) if file original = file.original_filename @exif = case original when /\.je?pg$/i EXIFR::JPEG.new(file) when /\.tiff?$/i EXIFR::TIFF.new(file) end if @exif models = config['device_types']['models'] rescue {} models.each do |type, regex| return type if @exif.model =~ regex end makes = config['device_types']['makes'] rescue {} makes.each do |type, regex| return type if @exif.make =~ regex end software = config['device_types']['software'] rescue {} software.each do |type, regex| return type if @exif.software =~ regex end end end headers = config['device_types']['headers'] rescue {} headers.keys.each do |header| if mail.header[header] # headers[header] refers to a hash of smart phone types with regex values # that if they match, the header signals the type should be returned headers[header].each do |type, regex| return type if mail.header[header].decoded =~ regex field = mail.header.fields.detect { |field| field.name == header } return type if field && field.to_s =~ regex end end end file = attachment(['image']) if file original_filename = file.original_filename filenames = config['device_types']['filenames'] rescue {} filenames.each do |type, regex| return type if original_filename =~ regex end end file = attachment(['video']) if file original_filename = file.original_filename filenames = config['device_types']['filenames'] rescue {} filenames.each do |type, regex| return type if original_filename =~ regex end end boundary = mail.boundary boundaries = config['device_types']['boundary'] rescue {} boundaries.each do |type, regex| return type if boundary =~ regex end return :handset if File.exist?( File.expand_path( File.join(self.conf_dir, "#{self.aliases[self.carrier] || self.carrier}.yml") ) ) :unknown end ## # exif object on default image from exifr gem def exif device_type? unless @exif @exif end ## # The source of the MMS was some sort of mobile or smart phone def is_mobile? self.device_type? != :unknown end ## # Get the temporary directory where media files are written to. def self.tmp_dir @@tmp_dir ||= File.expand_path(File.join(Dir.tmpdir, (ENV['USER'].nil? ? '':ENV['USER']), 'mms2r')) end ## # Set the temporary directory where media files are written to. def self.tmp_dir=(d) @@tmp_dir=d end ## # Get the directory where conf files are stored. def self.conf_dir @@conf_dir ||= File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'conf')) end ## # Set the directory where conf files are stored. def self.conf_dir=(d) @@conf_dir=d end ## # Helper to create a safe directory path element based on the mail message # id. def self.safe_message_id(mid) mid.nil? ? "#{Time.now.to_i}" : mid.gsub(/\$|<|>|@|\./, "") end ## # Returns a default file extension based on a content type def self.default_ext(content_type) if MMS2R::EXT[content_type] MMS2R::EXT[content_type] elsif content_type content_type.split('/').last end end ## # Joins the generic mms2r configuration with the carrier specific # configuration. def self.initialize_config(c) f = File.expand_path(File.join(self.conf_dir(), "mms2r_media.yml")) conf = YAML::load_file(f) conf['ignore'] ||= {} unless conf['ignore'] conf['transform'] = {} unless conf['transform'] conf['number'] = [] unless conf['number'] return conf unless c kinds = ['ignore', 'transform'] kinds.each do |kind| if c[kind] c[kind].each do |type,array| conf[kind][type] = [] unless conf[kind][type] conf[kind][type] += array end end end conf['number'] = c['number'] if c['number'] conf end def log(message, level = :info) @logger.send(level, message) unless @logger.nil? end ## # convenience accessor for self.class.conf_dir def conf_dir self.class.conf_dir end ## # convenience accessor for self.class.conf_dir def tmp_dir self.class.tmp_dir end ## # convenience accessor for self.class.default_ext def default_ext(type) self.class.default_ext(type) end ## # convenience accessor for self.class.safe_message_id def safe_message_id(message_id) self.class.safe_message_id(message_id) end ## # convenience accessor for self.class.initialize_confg def initialize_config(config) self.class.initialize_config(config) end - private + protected ## # accessor for the config def config @config end ## # guess content type from filename def type_from_filename(filename) ext = filename.split('.').last ent = MMS2R::EXT.detect{|k,v| v == ext} ent.nil? ? nil : ent.first end + ## + # Helper to fold all the parts of multipart mail down into a flat array. + # multipart/related and multipart/alternative parts can have child parts. + def folded_parts(parts) + return folded_parts([parts]) unless parts.respond_to?(:each) + + result = [] # NOTE could use #tap but want 1.8.7 compat + parts.each do |part| + result << (part.multipart? ? folded_parts(part.parts) : part) + end + result.flatten + end + ## # used by #default_media and #text to return the biggest attachment type # listed in the types array def attachment(types) # get all the files that are of the major types passed in files = [] types.each do |type| media.keys.find_all{|k| type.include?("/") ? k == type : k.index(type) == 0 }.each do |key| files += media[key] end end return nil if files.empty? # set temp holders file = nil # explicitly declare the file and size size = 0 mime_type = nil #get the largest file files.each do |path| next unless File.exist?(path) if File.size(path) > size size = File.size(path) file = File.new(path) media.each do |type,_files| mime_type = type if _files.detect{ |_path| _path == path } end end end return nil if file.nil? # These singleton methods implement the interface necessary to be used # as a drop-in replacement for files uploaded with CGI.rb. # This helps if you want to use the files with, for example, # attachment_fu. def file.local_path self.path end def file.original_filename File.basename(self.path) end def file.size File.size(self.path) end # this one is kind of confusing because it needs a closure. class << file self end.send(:define_method, :content_type) { mime_type } file end end end diff --git a/lib/mms2r/media/sprint.rb b/lib/mms2r/media/sprint.rb index 08cfe94..5e3133d 100644 --- a/lib/mms2r/media/sprint.rb +++ b/lib/mms2r/media/sprint.rb @@ -1,249 +1,222 @@ #-- # Copyright (c) 2007-2012 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ require 'net/http' require 'nokogiri' require 'cgi' require 'json' module MMS2R class Media ## # Sprint version of MMS2R::Media # # Sprint is an annoying carrier because they don't actually transmit user # generated content (like images or videos) directly in the MMS message. # Instead, they hijack the media that is sent from the cellular subscriber # and place that content on a content server. In place of the media # the recipient receives a HTML message with unsolicited Sprint # advertising and links back to their content server. The recipient has # to click through Sprint more pages to view the content. # # The default subject on these messages from the # carrier is "You have new Picture Mail!" module Sprint - ## - # Override process() because Sprint doesn't attach media (images, video, - # etc.) to its MMS. Media such as images and videos are hosted on a - # Sprint content server. MMS2R::Media::Sprint has to pick apart an - # HTML attachment to find the URL to the media on Sprint's content - # server and download each piece of content. Any text message part of - # the MMS if it exists is embedded in the html. - - def process - unless @was_processed - log("#{self.class} processing", :info) - #sprint MMS are multipart - parts = @mail.parts - - #find the payload html - doc = nil - parts.each do |p| - next unless p.part_type? == 'text/html' - d = Nokogiri(p.body.decoded) - title = d.at('title').inner_html - if title =~ /You have new Picture Mail!/ - doc = d - @is_video = (p.body.decoded =~ /type=&quot;VIDEO&quot;&gt;/m ? true : false) - end - end - return if doc.nil? # it was a dud - @is_video ||= false - - # break it down - sprint_phone_number(doc) - sprint_process_text(doc) - sprint_process_media(doc) - - @was_processed = true - end - - # when process acts upon a block - if block_given? - media.each do |k, v| - yield(k, v) - end - end + protected + ## + # Helper to process old style media on the Sprint CDN which didn't attach + # media (images, video, etc.) to its MMS. Media such as images and + # videos are hosted on a Sprint content server. MMS2R::Media::Sprint has + # to pick apart an HTML attachment to find the URL to the media on + # Sprint's content server and download each piece of content. Any text + # message part of the MMS if it exists is embedded in the html. + + def process_html_part(part) + doc = Nokogiri(part.body.decoded) + + is_video = (part.body.decoded =~ /type=&quot;VIDEO&quot;&gt;/m ? true : false) + sprint_process_media(doc, is_video) + sprint_process_text(doc) + sprint_phone_number(doc) end - private - ## # Digs out where Sprint hides the phone number def sprint_phone_number(doc) c = doc.search("/html/head/comment()").last t = c.content.gsub(/\s+/m," ").strip #@number returned in parent's #number - @number = / name=&quot;MDN&quot;&gt;(\d+)&lt;/.match(t)[1] + matched = / name=&quot;MDN&quot;&gt;(\d+)&lt;/.match(t) + @number = matched[1] if matched end ## # Pulls out the user text form the MMS and adds the text to media hash def sprint_process_text(doc) # there is at least one <pre> with MMS text if text has been included by # the user. (note) we'll have to verify that if they attach multiple texts # to the MMS then Sprint stacks it up in multiple <pre>'s. The only <pre> # tag in the document is for text from the user. # if there is no text media found in the mail body - then we go to more # extreme measures. text_found = false doc.search("/html/body//pre").each do |pre| type = 'text/plain' text = pre.inner_html.strip next if text.empty? text_found = true type, text = transform_text(type, text) type, file = sprint_write_file(type, text.strip) add_file(type, file) unless type.nil? || file.nil? end # if no text was found, there still might be a message with images # that can be seen at the end of the "View Entire Message" link if !text_found view_entire_message_link = doc.search("a").find { |link| link.inner_html == "View Entire Message"} # if we can't find the view entire message link, give up if view_entire_message_link # Sprint uses AJAX/json to serve up the content at the end of the link so this is conveluted url = view_entire_message_link.attr("href") # extract the "invite" param out of the url - this will be the id we pass to the ajax path below inviteMessageId = CGI::parse(URI::parse(url).query)["invite"].first if inviteMessageId json_url = "http://pictures.sprintpcs.com/ui-refresh/guest/getMessageContainerJSON.do%3FcomponentType%3DmediaDetail&invite=#{inviteMessageId}&externalMessageId=#{inviteMessageId}" # pull down the json from the url and parse it uri = URI.parse(json_url) connection = Net::HTTP.new(uri.host, uri.port) response = connection.get2( uri.request_uri, { "User-Agent" => MMS2R::Media::USER_AGENT } ) content = response.body # if the content has expired, sprint sends back html "content expired page # json will fail to parse begin json = JSON.parse(content) # there may be multiple "results" in the json - due to multiple images # cycle through them and extract the "description" which is the text # message the sender sent with the images json["Results"].each do |result| type = 'text/plain' # remove any &nbsp; chars from the resulting text text = result["description"] ? result["description"].gsub(/[[:space:]]/, " ").strip : nil next if text.empty? type, text = transform_text(type, text) type, file = sprint_write_file(type, text.strip) add_file(type, file) unless type.nil? || file.nil? end rescue JSON::ParserError => e log("#{self.class} processing error, #{$!}", :error) end end end end end ## # Fetch all the media that is referred to in the doc - def sprint_process_media(doc) + def sprint_process_media(doc, is_video=false) srcs = Array.new # collect all the images in the document, even though # they are <img> tag some might actually refer to video. # To know the link refers to vide one must look at the # content type on the http GET response. imgs = doc.search("/html/body//img") imgs.each do |i| src = i.attributes['src'] next unless src src = src.text # we don't want to double fetch content and we only # want to fetch media from the content server, you get # a clue about that as there is a RECIPIENT in the URI path # of real content next unless /mmps\/RECIPIENT\//.match(src) next if srcs.detect{|s| s.eql?(src)} srcs << src end #we've got the payload now, go fetch them cnt = 0 srcs.each do |src| begin uri = URI.parse(CGI.unescapeHTML(src)) - unless @is_video + unless is_video query={} uri.query.split('&').each{|a| p=a.split('='); query[p[0]] = p[1]} query.delete_if{|k, v| k == 'limitsize' || k == 'squareoutput' } uri.query = query.map{|k,v| "#{k}=#{v}"}.join("&") end # sprint is a ghetto, they expect to see &amp; for video request - uri.query = uri.query.gsub(/&/, "&amp;") if @is_video + uri.query = uri.query.gsub(/&/, "&amp;") if is_video connection = Net::HTTP.new(uri.host, uri.port) #connection.set_debug_output $stdout response = connection.get2( uri.request_uri, { "User-Agent" => MMS2R::Media::USER_AGENT } ) content = response.body rescue StandardError => err log("#{self.class} processing error, #{$!}", :error) next end # if the Sprint content server uses response code 500 when the content is purged # the content type will text/html and the body will be the message if response.content_type == 'text/html' && response.code == "500" log("Sprint content server returned response code 500", :error) next end # setup the file path and file base = /\/RECIPIENT\/([^\/]+)\//.match(src)[1] type = response.content_type file_name = "#{base}-#{cnt}.#{self.class.default_ext(type)}" file = File.join(msg_tmp_dir(),File.basename(file_name)) # write it and add it to the media hash type, file = sprint_write_file(type, content, file) add_file(type, file) unless type.nil? || file.nil? cnt = cnt + 1 end end ## # Creates a temporary file based on the type def sprint_temp_file(type) file_name = "#{Time.now.to_f}.#{self.class.default_ext(type)}" File.join(msg_tmp_dir(),File.basename(file_name)) end ## # Writes the content to a file and returns the type, file as a tuple. def sprint_write_file(type, content, file = nil) file = sprint_temp_file(type) if file.nil? log("#{self.class} writing file #{file}", :info) # force the encoding to be utf-8 content = content.force_encoding("UTF-8") if content.respond_to?(:force_encoding) File.open(file,'w'){ |f| f.write(content) } return type, file end end end end diff --git a/test/test_mms2r_media.rb b/test/test_mms2r_media.rb index d3db314..0a7c235 100644 --- a/test/test_mms2r_media.rb +++ b/test/test_mms2r_media.rb @@ -1,878 +1,808 @@ # encoding: UTF-8 require "test_helper" class TestMms2rMedia < Test::Unit::TestCase include MMS2R::TestHelper def use_temp_dirs MMS2R::Media.tmp_dir = @tmpdir MMS2R::Media.conf_dir = @confdir end def setup @oldtmpdir = MMS2R::Media.tmp_dir || File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") @oldconfdir = MMS2R::Media.conf_dir || File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") FileUtils.mkdir_p(@oldtmpdir) FileUtils.mkdir_p(@oldconfdir) @tmpdir = File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") FileUtils.mkdir_p(@tmpdir) @confdir = File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") FileUtils.mkdir_p(@confdir) end def teardown FileUtils.rm_rf(@tmpdir) FileUtils.rm_rf(@confdir) MMS2R::Media.tmp_dir = @oldtmpdir MMS2R::Media.conf_dir = @oldconfdir end def stub_mail(vals = {}) attrs = { :from => '[email protected]', :to => '[email protected]', :subject => 'This is a test email', :body => 'a', }.merge(vals) Mail.new do from attrs[:from] to attrs[:to] subject attrs[:subject] body attrs[:body] end end def test_faux_user_agent assert_equal "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.120 Safari/535.2", MMS2R::Media::USER_AGENT end def test_class_parse mms = mail('generic.mail') assert_equal ['[email protected]'], mms.from end def temp_text_file(text) tf = Tempfile.new("test" + rand.to_s) tf.puts(text) tf.close tf.path end def test_tmp_dir use_temp_dirs() MMS2R::Media.tmp_dir = @tmpdir assert_equal @tmpdir, MMS2R::Media.tmp_dir end def test_conf_dir use_temp_dirs() MMS2R::Media.conf_dir = @confdir assert_equal @confdir, MMS2R::Media.conf_dir end def test_safe_message_id mid1_b="1234abcd" mid1_a="1234abcd" mid2_b="<01234567.0123456789012.JavaMail.fooba@foo-bars999>" mid2_a="012345670123456789012JavaMailfoobafoo-bars999" assert_equal mid1_a, MMS2R::Media.safe_message_id(mid1_b) assert_equal mid2_a, MMS2R::Media.safe_message_id(mid2_b) end def test_default_ext assert_equal nil, MMS2R::Media.default_ext(nil) assert_equal 'text', MMS2R::Media.default_ext('text') assert_equal 'txt', MMS2R::Media.default_ext('text/plain') assert_equal 'test', MMS2R::Media.default_ext('example/test') end def test_base_initialize_config_tries_to_open_default_config_yaml f = File.join(MMS2R::Media.conf_dir, 'mms2r_media.yml') YAML.expects(:load_file).once.with(f).returns({}) config = MMS2R::Media.initialize_config(nil) end def test_base_initialize_config config = MMS2R::Media.initialize_config(nil) # test defaults shipped in mms2r_media.yml assert_not_nil config assert_equal true, config['ignore'].is_a?(Hash) assert_equal true, config['transform'].is_a?(Hash) assert_equal true, config['number'].is_a?(Array) end def test_instance_initialize_config mms = MMS2R::Media.new stub_mail config = mms.initialize_config(nil) # test defaults shipped in mms2r_media.yml assert_not_nil config assert_equal true, config['ignore'].is_a?(Hash) assert_equal true, config['transform'].is_a?(Hash) assert_equal true, config['number'].is_a?(Array) end def test_initialize_config_contatenation c = {'ignore' => {'text/plain' => [/A TEST/]}, 'transform' => {'text/plain' => [/FOO/, '']}, 'number' => ['from', /^([^\s]+)\s.*/, '\1'] } config = MMS2R::Media.initialize_config(c) assert_not_nil config['ignore']['text/plain'].detect{|v| v == /A TEST/} assert_not_nil config['transform']['text/plain'].detect{|v| v == /FOO/} assert_not_nil config['number'].first == 'from' end def test_aliased_new_returns_default_processor_instance mms = MMS2R::Media.new stub_mail assert_not_nil mms assert_equal true, mms.respond_to?(:process) assert_equal MMS2R::Media, mms.class end def test_lazy_process_option mms = MMS2R::Media.new stub_mail, :process => :lazy mms.expects(:process).never end def test_logger_option logger = mock() logger.expects(:info).at_least_once mms = MMS2R::Media.new stub_mail, :logger => logger end def test_default_processor_initialize_tries_to_open_config_for_carrier mms_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'mms2r_media.yml')) aliases_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'aliases.yml')) from_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'from.yml')) example_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'example.com.yml')) YAML.expects(:load_file).at_least_once.with(mms_yaml).returns({}) YAML.expects(:load_file).at_least_once.with(aliases_yaml).returns({}) YAML.expects(:load_file).at_least_once.with(from_yaml).returns([]) YAML.expects(:load_file).never.with(example_yaml) mms = MMS2R::Media.new stub_mail end def test_mms_phone_number mail = stub_mail mail.stubs(:from).returns(['[email protected]']) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number end def test_mms_phone_number_from_config mail = stub_mail(:from => '"+2068675309" <[email protected]>') mms = MMS2R::Media.new(mail) mms.expects(:config).once.returns({'number' => ['from', /^([^\s]+)\s.*/, '\1']}) assert_equal '+2068675309', mms.number end def test_mms_phone_number_with_errors mail = stub_mail mail.stubs(:from).returns(nil) mms = MMS2R::Media.new(mail) assert_nothing_raised do assert_equal '', mms.number end end def test_transform_text_plain mail = stub_mail mail.stubs(:from).returns(nil) mms = MMS2R::Media.new(mail) type = 'test/type' text = 'hello' # no match in the config result = [type, text] assert_equal result, mms.transform_text(type, text) # testing the default config assert_equal ['text/plain', ''], mms.transform_text('text/plain', "Sent from my Windows Phone") assert_equal ['text/plain', ''], mms.transform_text('text/plain', "Sent via BlackBerry from T-Mobile") assert_equal ['text/plain', ''], mms.transform_text('text/plain', "Sent from my Verizon Wireless BlackBerry") assert_equal ['text/plain', ''], mms.transform_text('text/plain', 'Sent via iPhone') assert_equal ['text/plain', ''], mms.transform_text('text/plain', 'Sent from my iPhone') assert_equal ['text/plain', ''], mms.transform_text('text/plain', 'Sent from your iPhone.') assert_equal ['text/plain', ''], mms.transform_text('text/plain', " \n\nimage/jpeg") # has a bad regexp mms.expects(:config).at_least_once.returns({'transform' => {type => [['(hello)', 'world']]}}) assert_equal result, mms.transform_text(type, text) # matches in config mms.expects(:config).at_least_once.returns({'transform' => {type => [[/(hello)/, 'world']]}}) assert_equal [type, 'world'], mms.transform_text(type, text) mms.expects(:config).at_least_once.returns({'transform' => {type => [[/^Ignore this part, (.+)/, '\1']]}}) assert_equal [type, text], mms.transform_text(type, "Ignore this part, " + text) # chaining transforms mms.expects(:config).at_least_once.returns({'transform' => {type => [[/(hello)/, 'world'], [/(world)/, 'mars']]}}) assert_equal [type, 'mars'], mms.transform_text(type, text) # has a Iconv problem mms.expects(:config).at_least_once.returns({'transform' => {type => [['(hello)', 'world']]}}) assert_equal result, mms.transform_text(type, text) end def test_transform_text_to_utf8 mail = mail('iconv-fr-text-01.mail') mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_equal 1, mms.media['text/plain'].size assert_equal 1, mms.media['text/html'].size file = mms.media['text/plain'][0] assert_not_nil file assert_equal true, File::exist?(file) text_lines = IO.readlines("#{file}") text = text_lines.join # ASCII-8BIT -> D'ici un mois G\xE9orgie # UTF-8 -> D'ici un mois Géorgie if RUBY_VERSION < "1.9" assert_equal("sample email message Fwd: sub D'ici un mois Géorgie", mms.subject) assert_equal("D'ici un mois Géorgie body", text_lines.first.strip) else assert_equal(Iconv.new('UTF-8', 'ISO-8859-1').iconv("sample email message Fwd: sub D'ici un mois Géorgie"), mms.subject) assert_equal(Iconv.new('UTF-8', 'ISO-8859-1').iconv("D'ici un mois G\xE9orgie body"), text_lines.first.strip) end end def test_subject s = 'hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) assert_equal s, mms.subject # second time through shouldn't process the subject again mail.expects(:subject).never assert_equal s, mms.subject end def test_subject_with_bad_mail_subject mail = stub_mail mail.stubs(:subject).returns(nil) mms = MMS2R::Media.new(mail) assert_equal '', mms.subject end def test_subject_with_subject_ignored s = 'hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) mms.stubs(:config).returns({'ignore' => {'text/plain' => [s]}}) assert_equal '', mms.subject end def test_subject_with_subject_transformed s = 'Default Subject: hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) mms.stubs(:config).returns( { 'ignore' => {}, 'transform' => {'text/plain' => [[/Default Subject: (.+)/, '\1']]}}) assert_equal 'hello world', mms.subject end def test_attachment_should_return_nil_if_files_for_type_are_not_found mms = MMS2R::Media.new stub_mail mms.stubs(:media).returns({}) assert_nil mms.send(:attachment, ['text']) end def test_attachment_should_return_nil_if_empty_files_are_found mms = MMS2R::Media.new stub_mail mms.stubs(:media).returns({'text/plain' => [Tempfile.new('test')]}) assert_nil mms.send(:attachment, ['text']) end def test_type_from_filename mms = MMS2R::Media.new stub_mail assert_equal 'image/jpeg', mms.send(:type_from_filename, "example.jpg") end def test_type_from_filename_should_be_nil mms = MMS2R::Media.new stub_mail assert_nil mms.send(:type_from_filename, "example.example") end def test_attachment_should_return_duck_typed_file mms = MMS2R::Media.new stub_mail - temp_big = temp_text_file("hello world") - size = File.size(temp_text_file("hello world")) - temp_small = temp_text_file("hello") - mms.stubs(:media).returns({'text/plain' => [temp_small, temp_big]}) duck_file = mms.send(:attachment, ['text']) - assert_not_nil duck_file - assert_equal true, File::exist?(duck_file) - assert_equal true, File::exist?(temp_big) - assert_equal temp_big, duck_file.local_path - assert_equal File.basename(temp_big), duck_file.original_filename - assert_equal size, duck_file.size + assert_equal 1, duck_file.size assert_equal 'text/plain', duck_file.content_type + assert_equal "a", open(mms.media['text/plain'].first).read end def test_empty_body mms = MMS2R::Media.new stub_mail mms.stubs(:default_text).returns(nil) assert_equal "", mms.body end def test_body mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") mms.stubs(:default_text).returns(File.new(temp_big)) body = mms.body assert_equal "hello world", body end def test_body_when_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") mms.stubs(:default_html).returns(File.new(temp_big)) assert_equal "hello world teapot", mms.body end def test_default_text mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'text/plain' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_text.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_text.local_path end def test_default_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") temp_small = temp_text_file("<html><head><title>hello</title></head><body>world<body></html>") mms.stubs(:media).returns({'text/html' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_html.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_html.local_path end def test_default_media mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'image/jpeg' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_media.local_path end def test_default_media_treats_image_and_video_equally mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big_image = temp_text_file("hello world") temp_small_image = temp_text_file("hello") temp_big_video = temp_text_file("hello world again") temp_small_video = temp_text_file("hello again") mms.stubs(:media).returns({'image/jpeg' => [temp_small_image, temp_big_image], 'video/mpeg' => [temp_small_video, temp_big_video], }) assert_equal temp_big_video, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big_video, mms.default_media.local_path end #def test_default_media_treats_gif_and_jpg_equally # #it doesn't matter that these are text files, we just need say they are images # temp_big = temp_text_file("hello world") # temp_small = temp_text_file("hello") # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/jpeg' => [temp_big], 'image/gif' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/gif' => [temp_big], 'image/jpg' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path #end def test_purge mms = MMS2R::Media.new stub_mail mms.purge assert_equal false, File.exist?(mms.media_dir) end def test_ignore_media_by_filename_equality name = 'foo.txt' type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [name]}}) # type is not in the ingore part = stub(:body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and filename are in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal true, mms.ignore_media?(type, part) # type but not file name are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_filename name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'foo.txt', mms.filename?(part) end def test_long_filename name = 'x' * 300 + '.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'x' * 251 + '.txt', mms.filename?(part) end def test_filename_when_file_extension_missing_part name = 'foo' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.txt', mms.filename?(part) name = 'foo.janky' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.janky.txt', mms.filename?(part) end def test_ignore_media_by_filename_regexp name = 'foo.txt' regexp = /foo\.txt/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [regexp, 'nil.txt']}}) # type is not in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the filename are in the ingore part = stub(:filename => name) assert_equal true, mms.ignore_media?(type, part) # type but not regexp for filename are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_by_regexp_on_file_content name = 'foo.txt' content = "aaaaaaahello worldbbbbbbbbb" regexp = /.*Hello World.*/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => ['nil.txt', regexp]}}) part = stub(:filename => name, :body => Mail::Body.new(content)) # type is not in the ingore assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the content are in the ingore assert_equal true, mms.ignore_media?(type, part) # type but not regexp for content are in the ignore part = stub(:filename => name, :body => Mail::Body.new('no teapots')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_when_file_content_is_empty mms = MMS2R::Media.new stub_mail # there is no conf but the part's body is empty part = stub(:filename => 'foo.txt', :body => Mail::Body.new) assert_equal true, mms.ignore_media?('text/test', part) # there is no conf but the part's body is white space part = stub(:filename => 'foo.txt', :body => Mail::Body.new("\t\n\t\n ")) assert_equal true, mms.ignore_media?('text/test', part) end def test_add_file mail = stub_mail mail.stubs(:from).returns(['[email protected]']) mms = MMS2R::Media.new(mail) mms.stubs(:media).returns({}) assert_nil mms.media['text/html'] mms.add_file('text/html', '/tmp/foo.html') assert_equal ['/tmp/foo.html'], mms.media['text/html'] mms.add_file('text/html', '/tmp/bar.html') assert_equal ['/tmp/foo.html', '/tmp/bar.html'], mms.media['text/html'] end def test_temp_file name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal name, File.basename(mms.temp_file(part)) end def test_process_media_for_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', 'hello world']) result = mms.process_media(part) assert_equal 'text/plain', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_with_empty_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', '']) assert_equal ['text/plain', nil], mms.process_media(part) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_application_smil name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['application/smil', nil]) part = stub(:filename => name, :content_type => 'application/smil', :part_type? => 'application/smil', :main_type => 'application') assert_equal ['application/smil', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['application/smil', 'hello world']) result = mms.process_media(part) assert_equal 'application/smil', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_application_octet_stream_when_image name = 'fake.jpg' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'application/octet-stream', :part_type? => 'application/octet-stream', :body => Mail::Body.new("data"), :main_type => 'application') result = mms.process_media(part) assert_equal 'image/jpeg', result.first assert_match(/fake\.jpg$/, result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_all_other_media name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :main_type => 'faux', :part_type? => 'faux/text', :body => Mail::Body.new(nil)) assert_equal ['faux/text', nil], mms.process_media(part) part = stub(:filename => name, :main_type => 'faux', :part_type? => 'faux/text', :body => Mail::Body.new('hello world')) result = mms.process_media(part) assert_equal 'faux/text', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process mms = MMS2R::Media.new stub_mail assert_equal 1, mms.media.size assert_not_nil mms.media['text/plain'] assert_equal 1, mms.media['text/plain'].size assert_equal true, File.exist?(mms.media['text/plain'].first) assert_equal 1, File.size(mms.media['text/plain'].first) mms.purge end def test_process_with_multipart_double_parts mail = mail('apple-double-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_not_nil mms.media['application/applefile'] assert_equal 1, mms.media['application/applefile'].size assert_not_nil mms.media['image/jpeg'] assert_equal 1, mms.media['image/jpeg'].size assert_match(/DSCN1715\.jpg$/, mms.media['image/jpeg'].first) assert_file_size mms.media['image/jpeg'].first, 337 mms.purge end - def test_process_with_multipart_alternative_parts - mail = stub_mail - - plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new('a'), :main_type => 'text') - plain.stubs(:multipart?).at_least_once.returns(false) - - html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new('a'), :main_type => 'text') - html.stubs(:multipart?).at_least_once.returns(false) - - multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) - multi.stubs(:multipart?).at_least_once.returns(true) - - mail.stubs(:multipart?).at_least_once.returns(true) - mail.stubs(:parts).at_least_once.returns([multi]) - - # the multipart/alternative should get flattend to text and html - mms = MMS2R::Media.new(mail) - assert_equal 2, mms.media.size - assert_equal 2, mms.media.size - assert_not_nil mms.media['text/plain'] - assert_not_nil mms.media['text/html'] - assert_equal 1, mms.media['text/plain'].size - assert_equal 1, mms.media['text/html'].size - assert_equal 'message.txt', File.basename(mms.media['text/plain'].first) - assert_equal 'message.html', File.basename(mms.media['text/html'].first) - assert_equal true, File.exist?(mms.media['text/plain'].first) - assert_equal true, File.exist?(mms.media['text/html'].first) - assert_equal 1, File.size(mms.media['text/plain'].first) - assert_equal 1, File.size(mms.media['text/html'].first) - mms.purge + def test_folding_with_multipart_alternative_parts + mail = mail('helio-message-01.mail') + mms = MMS2R::Media.new(Mail.new) + assert_equal 5, mms.send(:folded_parts, mail.parts).size end def test_process_when_media_is_ignored - mail = stub_mail - plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new(''), :main_type => 'text') - plain.stubs(:multipart?).at_least_once.returns(false) - - html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new(''), :main_type => 'text') - html.stubs(:multipart?).at_least_once.returns(false) - - - multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) - multi.stubs(:multipart?).at_least_once.returns(true) - - mail.stubs(:multipart?).at_least_once.returns(true) - mail.stubs(:parts).at_least_once.returns([multi]) - - mms = MMS2R::Media.new(mail, :process => :lazy) - mms.stubs(:config).returns({'ignore' => {'text/plain' => ['message.txt'], - 'text/html' => ['message.html']}}) - assert_nothing_raised { mms.process } - # the multipart/alternative should get flattend to text and html and then - # what's flattened is ignored - assert_equal 0, mms.media.size - mms.purge + # TODO - I'd like to get away from mocks and test on real data, and + # this is covered repeatedly for various samples from the carrier end def test_process_when_yielding_to_a_block - mail = stub_mail - - plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new('a'), :main_type => 'text') - plain.stubs(:multipart?).at_least_once.returns(false) - - html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new('b'), :main_type => 'text') - html.stubs(:multipart?).at_least_once.returns(false) - - multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) - multi.stubs(:multipart?).at_least_once.returns(true) - - mail.stubs(:multipart?).at_least_once.returns(true) - mail.stubs(:parts).at_least_once.returns([multi]) - - # the multipart/alternative should get flattend to text and html + mail = mail('att-image-01.mail') mms = MMS2R::Media.new(mail) - assert_equal 2, mms.media.size mms.process do |type, files| assert_equal 1, files.size - assert_equal true, type == 'text/plain' || type == 'text/html' - assert_equal true, File.basename(files.first) == 'message.txt' || - File.basename(files.first) == 'message.html' + assert_equal true, type == 'image/jpeg' + assert_equal true, File.basename(files.first) == 'Photo_12.jpg' assert_equal true, File::exist?(files.first) end mms.purge end def test_domain_from_return_path mail = mock() mail.expects(:from).at_least_once.returns([]) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'null.example.com', domain end def test_domain_from_from mail = mock() mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'null.example.com', domain end def test_domain_from_from_yaml f = File.join(MMS2R::Media.conf_dir, 'from.yml') YAML.expects(:load_file).once.with(f).returns(['example.com']) mail = mock() mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'example.com', domain end def test_unknown_device_type mail = mail('generic.mail') mms = MMS2R::Media.new(mail) assert_equal :unknown, mms.device_type? assert_equal false, mms.is_mobile? end def test_iphone_device_type_by_header iphones = ['att-iphone-01.mail', 'iphone-image-01.mail'] iphones.each do |iphone| mail = mail(iphone) mms = MMS2R::Media.new(mail) assert_equal :iphone, mms.device_type?, "fixture #{iphone} was not a iphone" assert_equal true, mms.is_mobile? end end def test_exif mail = smart_phone_mock mms = MMS2R::Media.new(mail) assert_equal 'iPhone', mms.exif.model end def test_iphone_device_type_by_exif mail = smart_phone_mock mms = MMS2R::Media.new(mail) assert_equal :iphone, mms.device_type? assert_equal true, mms.is_mobile? end def test_faux_tiff_iphone_device_type_by_exif mail = smart_phone_mock('Apple', 'iPhone', nil, jpeg = false) mms = MMS2R::Media.new(mail) assert_equal :iphone, mms.device_type? assert_equal true, mms.is_mobile? end def test_iphone_device_type_by_filename_jpg mail = smart_phone_mock('Hipstamatic', '201') mms = MMS2R::Media.new(mail) assert_equal :apple, mms.device_type? assert_equal true, mms.is_mobile? end def test_iphone_device_type_by_filename_png mail = mail('iphone-image-02.mail') mms = MMS2R::Media.new(mail) assert_equal true, mms.is_mobile? assert_equal :iphone, mms.device_type? end def test_blackberry_device_type_by_exif_make_model mail = smart_phone_mock('Research In Motion', 'BlackBerry') mms = MMS2R::Media.new(mail) assert_equal :blackberry, mms.device_type? assert_equal true, mms.is_mobile? end def test_blackberry_device_type_by_exif_software mail = smart_phone_mock(nil, nil, "Rim Exif Version1.00a") mms = MMS2R::Media.new(mail) assert_equal :blackberry, mms.device_type? assert_equal true, mms.is_mobile? end def test_dash_device_type_by_exif mail = smart_phone_mock('T-Mobile Dash', 'T-Mobile Dash') mms = MMS2R::Media.new(mail) assert_equal :dash, mms.device_type? assert_equal true, mms.is_mobile? end def test_droid_device_type_by_exif mail = smart_phone_mock('Motorola', 'Droid') mms = MMS2R::Media.new(mail) assert_equal :droid, mms.device_type? assert_equal true, mms.is_mobile? end def test_htc_eris_device_type_by_exif mail = smart_phone_mock('HTC', 'Eris') mms = MMS2R::Media.new(mail) assert_equal :htc, mms.device_type? assert_equal true, mms.is_mobile? end def test_htc_hero_device_type_by_exif mail = smart_phone_mock('HTC', 'HERO200') mms = MMS2R::Media.new(mail) assert_equal :htc, mms.device_type? assert_equal true, mms.is_mobile? end def test_android_app_by_exif mail = smart_phone_mock('Retro Camera Android', "Xoloroid 2000") mms = MMS2R::Media.new(mail) assert_equal :android, mms.device_type? assert_equal true, mms.is_mobile? end def test_handsets_by_exif handsets = YAML.load_file(fixture('handsets.yml')) handsets.each do |handset| mail = smart_phone_mock(handset.first, handset.last) mms = MMS2R::Media.new(mail) assert_equal true, mms.is_mobile?, "mms with make #{mms.exif.make}, and model #{mms.exif.model}, should be considered a mobile device" end end def test_blackberry_device_type berries = ['att-blackberry.mail', 'suncom-blackberry.mail', 'tmobile-blackberry-02.mail', 'tmobile-blackberry.mail', 'tmo.blackberry.net-image-01.mail', 'verizon-blackberry.mail', 'verizon-blackberry.mail'] berries.each do |berry| mms = MMS2R::Media.new(mail(berry)) assert_equal :blackberry, mms.device_type?, "fixture #{berry} was not a blackberrry" assert_equal true, mms.is_mobile? end end def test_handset_device_type mail = mail('att-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal :handset, mms.device_type? assert_equal true, mms.is_mobile? end end diff --git a/test/test_mms_myhelio_com.rb b/test/test_mms_myhelio_com.rb index 6157980..6069179 100644 --- a/test/test_mms_myhelio_com.rb +++ b/test/test_mms_myhelio_com.rb @@ -1,66 +1,67 @@ require "test_helper" class TestMmsMyhelioCom < Test::Unit::TestCase include MMS2R::TestHelper def test_only_valid_content_should_be_retained_for_mms_with_image_and_text mail = mail('helio-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal "5551234", mms.number assert_equal "mms.myhelio.com", mms.carrier assert_equal 2, mms.media.size assert_equal 1, mms.media['image/jpeg'].size assert_equal 1, mms.media['text/plain'].size mms.purge end def test_only_valid_content_should_be_retained_for_mms_with_text mail = mail('helio-message-01.mail') mms = MMS2R::Media.new(mail) assert_equal "5551234", mms.number assert_equal "mms.myhelio.com", mms.carrier assert_equal 1, mms.media.size assert_equal 1, mms.media['text/plain'].size + assert_equal "Test message", open(mms.media['text/plain'].first).read mms.purge end def test_number_should_return_correct_number mail = mail('helio-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal "5551234", mms.number assert_equal "mms.myhelio.com", mms.carrier mms.purge end def test_subject_should_return_correct_subject mail = mail('helio-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal "5551234", mms.number assert_equal "mms.myhelio.com", mms.carrier title = mms.subject() assert_equal title, "Test image" mms.purge end def test_body_should_return_correct_body mail = mail('helio-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal "5551234", mms.number assert_equal "mms.myhelio.com", mms.carrier body = mms.body() assert_equal body, "Test image" mms.purge end def test_attachment_should_return_jpeg mail = mail('helio-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal "5551234", mms.number assert_equal "mms.myhelio.com", mms.carrier image = mms.default_media() assert_not_nil mms.media['image/jpeg'][0] assert_match(/0628070005.jpg$/, mms.media['image/jpeg'][0]) mms.purge end end diff --git a/test/test_pm_sprint_com.rb b/test/test_pm_sprint_com.rb index c5a6b23..8bd31e0 100644 --- a/test/test_pm_sprint_com.rb +++ b/test/test_pm_sprint_com.rb @@ -1,320 +1,319 @@ require "test_helper" class TestPmSprintCom < Test::Unit::TestCase include MMS2R::TestHelper def mock_sprint_image(message_id) response = mock('response') body = mock('body') connection = mock('connection') response.expects(:content_type).twice.returns('image/jpeg') response.expects(:body).returns(body) response.expects(:code).never Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection connection.expects(:get2).with( # 1.9.2 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90&ext=.jpg&iconifyVideo=true&wm=1' # 1.8.7 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&outquality=90&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU' kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).once.returns(response) end def mock_sprint_purged_image(message_id) response = mock('response') body = mock('body') connection = mock('connection') response.expects(:content_type).once.returns('text/html') response.expects(:body).returns(body) response.expects(:code).once.returns('500') Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection connection.expects(:get2).with( # 1.9.2 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90&ext=.jpg&iconifyVideo=true&wm=1' # 1.8.7 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&outquality=90&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU' kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).once.returns(response) end def mock_sprint_ajax response = mock('response') body = mock('body') # this is a response from a real sprint message file = File.open("./test/fixtures/sprint-ajax-response-success.json", "rb") json = file.read body.expects(:to_str).returns json connection = mock('connection') connection.stubs(:use_ssl=).returns(true) response.expects(:body).twice.returns(body) response.expects(:code).once.returns('200') response.expects(:content_type).twice.returns('text/html') Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).twice.returns connection connection.expects(:get2).with( # 1.9.2 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90&ext=.jpg&iconifyVideo=true&wm=1' # 1.8.7 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&outquality=90&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU' kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).twice.returns(response) end def mock_sprint_ajax_purged response = mock('response') body = mock('body') # this is a response from a real sprint message file = File.open("./test/fixtures/sprint-ajax-response-failure.html", "rb") error_html = file.read body.expects(:to_str).returns error_html connection = mock('connection') connection.stubs(:use_ssl=).returns(true) response.expects(:body).twice.returns(body) response.expects(:code).once.returns('500') response.expects(:content_type).once.returns('text/html') Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).twice.returns connection connection.expects(:get2).with( # 1.9.2 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90&ext=.jpg&iconifyVideo=true&wm=1' # 1.8.7 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&outquality=90&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU' kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).twice.returns(response) end def test_mms_should_have_text mail = mail('sprint-text-01.mail') mms = MMS2R::Media.new(mail) assert_equal "2068765309", mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_equal 1, mms.media['text/plain'].size file = mms.media['text/plain'].first assert_equal true, File.exist?(file) assert_match(/\.txt$/, File.basename(file)) assert_equal "Tea Pot", IO.read(file) mms.purge end def test_mms_should_have_a_phone_number mail = mail('sprint-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier mms.purge end def test_should_have_simple_video mail = mail('sprint-video-01.mail') response = mock('response') body = mock('body') connection = mock('connection') response.expects(:content_type).twice.returns('video/quicktime') response.expects(:body).returns(body) response.expects(:code).never Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection connection.expects(:get2).with( kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).once.returns(response) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_not_nil mms.media['video/quicktime'] assert_equal 1, mms.media['video/quicktime'].size assert_equal "000_259e41e851be9b1d_1-0.mov", File.basename(mms.media['video/quicktime'][0]) mms.purge end def test_should_have_simple_image mail = mail('sprint-image-01.mail') mock_sprint_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_not_nil mms.media['image/jpeg'][0] assert_match(/001_2066c7013e7ca833_1-0.jpg$/, mms.media['image/jpeg'][0]) mms.purge end def test_collect_image_using_block mail = mail('sprint-image-01.mail') mock_sprint_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size file_array = nil mms.process do |k, v| file_array = v if (k == 'image/jpeg') assert_equal 1, file_array.size file = file_array.first assert_not_nil file = file_array.first assert_equal "001_2066c7013e7ca833_1-0.jpg", File.basename(file) end mms.purge end def test_process_internals_should_only_be_executed_once mail = mail('sprint-image-01.mail') mock_sprint_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size # second time through shouldn't go into the was_processed block mms.mail.expects(:parts).never mms.process{|k, v| } mms.purge end def test_should_have_two_images mail = mail('sprint-two-images-01.mail') response = mock('response') body = mock('body') connection = mock('connection') response.expects(:content_type).times(4).returns('image/jpeg') response.expects(:body).twice.returns(body) response.expects(:code).never Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).twice.returns connection connection.expects(:get2).with( kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).twice.returns(response) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_equal 2, mms.media['image/jpeg'].size assert_not_nil mms.media['image/jpeg'][0] assert_not_nil mms.media['image/jpeg'][1] assert_match(/001_104058d23d79fb6a_1-0.jpg$/, mms.media['image/jpeg'][0]) assert_match(/001_104058d23d79fb6a_1-1.jpg$/, mms.media['image/jpeg'][1]) mms.purge end def test_image_should_be_missing # this test is questionable mail = mail('sprint-broken-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 0, mms.media.size mms.purge end def test_message_is_missing_in_mail # this test is questionable mail = mail('sprint-image-missing-message.mail') mock_sprint_ajax mms = MMS2R::Media.new(mail) assert_equal 2, mms.media['text/plain'].size # test that the message was extracted from the ajax response message = IO.readlines(mms.media['text/plain'].first).join("") assert_equal "First text content.", message # test that the &nbsp; was removed () assert message.last.bytes.to_a != [194, 160] mms.purge end def test_message_is_missing_in_mail_purged_from_content_server # this test is questionable mail = mail('sprint-image-missing-message.mail') mock_sprint_ajax_purged mms = MMS2R::Media.new(mail) assert_equal '5135455555', mms.number assert_equal "pm.sprint.com", mms.carrier - assert_equal 0, mms.media.size mms.purge end def test_image_should_be_purged_from_content_server mail = mail('sprint-image-01.mail') mock_sprint_purged_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 0, mms.media.size mms.purge end def test_body_should_return_empty_when_there_is_no_user_text mail = mail('sprint-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal "", mms.body end def test_sprint_write_file mail = mock(:message_id => 'a') mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') mms = MMS2R::Media.new(mail, :process => :lazy) type = 'text/plain' content = 'foo' file = Tempfile.new('sprint') file.close type, file = mms.send(:sprint_write_file, type, content, file.path) assert_equal 'text/plain', type assert_equal content, IO.read(file) end def test_subject mail = mail('sprint-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal "", mms.subject end def test_new_subject mail = mail('sprint-new-image-01.mail') mock_sprint_ajax mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal "", mms.subject end end
monde/mms2r
dd48f0a1fa88d8523bebc33503db3b9ab71d3c58
Additional rules on what parts to ignore from Sprint
diff --git a/conf/pm.sprint.com.yml b/conf/pm.sprint.com.yml index 616196b..bff55ff 100644 --- a/conf/pm.sprint.com.yml +++ b/conf/pm.sprint.com.yml @@ -1,14 +1,16 @@ --- ignore: text/html: - !ruby/regexp /We're sorry, this page is not available. We apologize for the inconvenience./mi text/plain: - !ruby/regexp /You have new [Picture|Video] Mail!\s+Click Go\/View to see now./mi + - !ruby/regexp /You have received a Picture Mail from /mi + - !ruby/regexp /Click Go\/View to see/mi transform: text/plain: - - !ruby/regexp /^You have new Picture Mail!$/i - "" - - !ruby/regexp /^New Message$/i - "" - - !ruby/regexp /^PictureMail$/i - ""
monde/mms2r
96d250d656581d15b9988133f9a9d941e536f6b1
print debugging info about an mms2r object
diff --git a/lib/mms2r.rb b/lib/mms2r.rb index c0a8133..66e9651 100644 --- a/lib/mms2r.rb +++ b/lib/mms2r.rb @@ -1,78 +1,131 @@ #-- # Copyright (c) 2007-2012 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ module MMS2R ## # A hash of MMS2R processors keyed by MMS carrier domain. CARRIERS = {} ## # Registers a class as a processor for a MMS domain. Should only be # used in special cases such as MMS2R::Media::Sprint for 'pm.sprint.com' def self.register(domain, processor_class) MMS2R::CARRIERS[domain] = processor_class end ## # A hash of file extensions for common mime-types EXT = { 'text/plain' => 'text', 'text/plain' => 'txt', 'text/html' => 'html', 'image/png' => 'png', 'image/gif' => 'gif', 'image/jpeg' => 'jpeg', 'image/jpeg' => 'jpg', 'video/quicktime' => 'mov', 'video/3gpp2' => '3g2' } class MMS2R::Media ## # Spoof User-Agent, primarily for the Sprint CDN USER_AGENT = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.120 Safari/535.2" end + ## # Simple convenience function to make it a one-liner: - # MMS2R.parse raw_mail or MMS2R.parse File.load(raw_mail) + # MMS2R.parse raw_mail or + # MMS2R.parse File.load(file) + # MMS2R.parse File.load(path_to_file) # Combined w/ the method_missing delegation, this should behave as an enhanced Mail object, more or less. - def self.parse raw_mail, options = {} - mail = Mail.new raw_mail + + def self.parse thing, options = {} + mail = case + when File.exist?(thing); Mail.new(open(thing).read) + when thing.respond_to?(:read); Mail.new(thing.read) + else + Mail.new(thing) + end + MMS2R::Media.new(mail, options) end + ## + # Compare original MMS2R results with original mail values and other metrics. + # + # Takes a file path, mms2r object, mail object, or mail text blob. + + def self.debug(thing, options = {}) + mms = case thing + when MMS2R::Media; thing + when Mail::Message; MMS2R::Media.new(thing, options) + else + self.parse(thing, options) + end + + <<OUT +#{'-' * 80} + + original mail + #{'from:'.ljust(15)} #{mms.mail.from} + #{'to:'.ljust(15)} #{mms.mail.to} + #{'subject:'.ljust(15)} #{mms.mail.subject} + + mms2r + #{'from:'.ljust(15)} #{mms.from} + #{'to:'.ljust(15)} #{mms.to} + #{'subject:'.ljust(15)} #{mms.subject} + #{'number:'.ljust(15)} #{mms.number} + + default media + #{mms.default_media.inspect} + + default text + #{mms.default_text.inspect} + #{mms.default_text.read if mms.default_text} + + all plain text + #{(mms.media['text/plain']||[]).each {|t| open(t).read}.join("\n\n")} + + media hash + #{mms.media.inspect} + +OUT + end + end %W{ yaml mail fileutils pathname tmpdir yaml digest/sha1 iconv exifr }.each do |g| begin require g rescue LoadError require 'rubygems' require g end end if RUBY_VERSION >= "1.9" begin require 'psych' YAML::ENGINE.yamler= 'syck' if defined?(YAML::ENGINE) rescue LoadError end end require File.join(File.dirname(__FILE__), 'ext/mail') require File.join(File.dirname(__FILE__), 'ext/object') require File.join(File.dirname(__FILE__), 'mms2r/media') require File.join(File.dirname(__FILE__), 'mms2r/media/sprint') MMS2R.register('pm.sprint.com', MMS2R::Media::Sprint)
monde/mms2r
b2600aa1a3fe68804f6167d0c1a95fec454cdb40
Tidy some grammar.
diff --git a/README.rdoc b/README.rdoc index 07beded..d44dd12 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,222 +1,222 @@ = mms2r https://github.com/monde/mms2r == DESCRIPTION MMS2R by Mike Mondragon https://github.com/monde/mms2r https://rubygems.org/gems/mms2r http://peepcode.com/products/mms2r-pdf -MMS2R is a library that decodes the parts of an MMS message to disk while +MMS2R is a library that decodes the parts of a MMS message to disk while stripping out advertising injected by the mobile carriers. MMS messages are multipart email and the carriers often inject branding into these messages. Use MMS2R if you want to get at the real user generated content from a MMS without having to deal with the cruft from the carriers. If MMS2R is not aware of a particular carrier no extra processing is done to the MMS other than decoding and consolidating its media. MMS2R can be used to process any multipart email to conveniently access the parts the mail is comprised of. Contact the author to add additional carriers to be processed by the library. Suggestions and patches appreciated and welcomed! === Corpus of carriers currently processed by MMS2R: * 1nbox/Idea: 1nbox.net * 3 Ireland: mms.3ireland.ie * Alltel: mms.alltel.com * AT&T/Cingular/Legacy: mms.att.net, mm.att.net, txt.att.net, mmode.com, mms.mycingular.com, cingularme.com, mobile.mycingular.com pics.cingularme.com * Bell Canada: txt.bell.ca * Bell South / Suncom / SBC Global: bellsouth.net, sbcglobal.net * Cricket Wireless: mms.mycricket.com * Dobson/Cellular One: mms.dobson.net * Helio: mms.myhelio.com * Hutchison 3G UK Ltd: mms.three.co.uk * INDOSAT M2: mobile.indosat.net.id * LUXGSM S.A.: mms.luxgsm.lu * Maroc Telecom / mms.mobileiam.ma * MTM South Africa: mms.mtn.co.za * NetCom (Norway): mms.netcom.no * Nextel: messaging.nextel.com * O2 Germany: mms.o2online.de * O2 UK: mediamessaging.o2.co.uk * Orange & Regional Oranges: orangemms.net, mmsemail.orange.pl, orange.fr * PLSPICTURES.COM mms hosting: waw.plspictures.com * PXT New Zealand: pxt.vodafone.net.nz * Rogers of Canada: rci.rogers.com * SaskTel: sasktel.com, sms.sasktel.com, cdma.sasktel.com * Sprint: pm.sprint.com, messaging.sprintpcs.com, sprintpcs.com * T-Mobile: tmomail.net, mmsreply.t-mobile.co.uk, tmo.blackberry.net * TELUS Corporation (Canada): mms.telusmobility.com, msg.telus.com * U.S. Cellular: mms.uscc.net * UAE MMS: mms.ae * Unicel: unicel.com, info2go.com (note: mobile number is tucked away in a text/plain part for unicel.com) * Verizon: vzwpix.com, vtext.com, labwig.net * Virgin Mobile: vmpix.com, pixmbl.com, vmobl.com, yrmobl.com * Virgin Mobile of Canada: vmobile.ca * Vodacom: mms.vodacom4me.co.za === Corpus of smart phones known to MMS2R: * Apple iPhone variants * Blackberry / Research In Motion variants * Casio variants * Droid variants * Google / Nexus One variants * HTC variants (T-Mobile Dash, Sprint HERO) * LG Electronics variants * Motorola variants * Pantech variants * Qualcom variants * Samsung variants * Sprint variants * UTStarCom variants === As Seen On The Internets - sites known to be using MMS2R in some fashion * twitpic.com[http://www.twitpic.com/] * Simplton[http://simplton.com/] * fanchatter.com[http://www.fanchatter.com/] * camura.com[http://www.camura.com/] * eachday.com[http://www.eachday.com/] * beenup2.com[http://www.beenup2.com/] * snapmylife.com[http://www.snapmylife.com/] * email the author to be listed here == FEATURES * #default_media and #default_text methods return a File that can be used in attachment_fu or Paperclip * #process supports blocks for enumerating over the content of the MMS * #process can be made lazy when :process => :lazy is passed to new * logging is enabled when :logger => your_logger is passed to new * an mms instance acts like a Mail object, any methods not defined on the instance are delegated to it's underlying Mail object * #device_type? returns a symbol representing a device or smartphone type Known smartphones thus far: iPhone, BlackBerry, T-Mobile Dash, Droid, Samsung == BOOKS MMS2R, Making email useful http://peepcode.com/products/mms2r-pdf == SYNOPSIS begin require 'mms2r' rescue LoadError require 'rubygems' require 'mms2r' end # required for the example require 'fileutils' mail = MMS2R::Media.new(Mail.read('some_saved_mail.file')) puts "mail has default carrier subject" if mail.subject.empty? # access the sender's phone number puts "mail was from phone #{mail.number}" # most mail are either image or video, default_media will return the largest # (non-advertising) video or image found file = mail.default_media puts "mail had a media: #{file.inspect}" unless file.nil? # finds the largest (non-advertising) text found file = mail.default_text puts "mail had some text: #{file.inspect}" unless file.nil? # mail.media is a hash that is indexed by mime-type. # The mime-type key returns an array of filepaths # to media that were extract from the mail and # are of that type mail.media['image/jpeg'].each {|f| puts "#{f}"} mail.media['text/plain'].each {|f| puts "#{f}"} # print the text (assumes mail had text) text = IO.readlines(mail.media['text/plain'].first).join puts text # save the image (assumes mail had a jpeg) FileUtils.cp mail.media['image/jpeg'].first, '/some/where/useful', :verbose => true puts "does the mail have quicktime video? #{!mail.media['video/quicktime'].nil?}" puts "plus run anything that Mail provides, e.g. #{mail.to.inspect}" # check if the mail is from a mobile phone puts "mail is from a mobile phone #{mail.is_mobile?}" # determine the device type of the phone puts "mail is from a mobile phone of type #{mail.device_type?}" # inspect default media's exif data if exifr gem is installed and default # media is a jpeg or tiff puts "mail's default media's exif data is:" puts mail.exif.inspect # Block support, process and receive all media types of video. mail.process do |media_type, files| # assumes a Clip model that is an AttachmentFu Clip.create(:uploaded_data => files.first, :title => "From phone") if media_type =~ /video/ end # Another AttachmentFu example, Picture model is an AttachmentFu picture = Picture.new picture.title = mail.subject picture.uploaded_data = mail.default_media picture.save! #remove all the media that was put to temporary disk mail.purge == REQUIREMENTS * Mail (mail) * Nokogiri (nokogiri) * UUIDTools (uuidtools) * EXIF Reader (exif) == INSTALL * sudo gem install mms2r == SOURCE git clone git://github.com/monde/mms2r.git == AUTHORS Copyright (c) 2007-2012 by Mike Mondragon blog[http://plasti.cx/] MMS2R's {Flickr page}[http://www.flickr.com/photos/8627919@N05/] == CONTRIBUTORS * Luke Francl - blog[http://railspikes.com/] * Will Jessup - blog[http://www.willjessup.com/] * Shane Vitarana - blog[http://www.shanesbrain.net/] * Layton Wedgeworth - company[http://www.beenup2.com/] * Jason Haruska - blog[http://software.haruska.com/] * Dave Myron - company[http://contentfree.com/] * Vijay Yellapragada * Jesse Dp - {github profile}[http://github.com/jessedp] * David Alm * Jeremy Wilkins * Matt Conway - {github profile}[http://github.com/wr0ngway] * Kai Kai * Michael DelGaudio * Sai Emrys - blog[http://saizai.com] * Brendan Lim - {github profile}[http://github.com/brendanlim] * Scott Taylor - {github profile}[http://github.com/smtlaissezfaire] * Jaap van der Meer - {github profile}[http://github.com/japetheape] * Karl Baum - {github profile}[http://github.com/kbaum] * James McGrath - blog[http://jamespmcgrath.com] diff --git a/mms2r.gemspec b/mms2r.gemspec index 6525e3e..23e4244 100644 --- a/mms2r.gemspec +++ b/mms2r.gemspec @@ -1,33 +1,33 @@ $:.unshift File.expand_path("../lib", __FILE__) require "mms2r/version" Gem::Specification.new do |gem| gem.add_dependency 'rake', ['= 0.9.2.2'] gem.add_dependency 'nokogiri', ['>= 1.5.0'] gem.add_dependency 'mail', ['>= 2.4.0'] gem.add_dependency 'exifr', ['>= 1.0.3'] gem.add_dependency 'json', ['>= 1.6.0'] gem.add_development_dependency "rdoc" gem.add_development_dependency "simplecov" gem.add_development_dependency 'test-unit' gem.add_development_dependency 'mocha' gem.name = "mms2r" gem.version = MMS2R::Version.to_s gem.platform = Gem::Platform::RUBY gem.authors = ["Mike Mondragon"] gem.email = ["[email protected]"] gem.homepage = "https://github.com/monde/mms2r" gem.summary = "Extract user media from MMS (and not carrier cruft)" - gem.description = "MMS2R is a library that decodes the parts of an MMS message to disk while stripping out advertising injected by the mobile carriers." + gem.description = "MMS2R is a library that decodes the parts of a MMS message to disk while stripping out advertising injected by the mobile carriers." gem.rubyforge_project = "mms2r" gem.rubygems_version = ">= 1.3.6" gem.files = `git ls-files`.split("\n") gem.require_path = ['lib'] gem.rdoc_options = ["--main", "README.rdoc"] gem.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.TMail.txt", "README.rdoc"] gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") end
monde/mms2r
89521560f2d3589617aa54e5d6ac361ab604688e
clean up README refs for gem packaging
diff --git a/Manifest.txt b/Manifest.txt index 87d3878..ea3661f 100644 --- a/Manifest.txt +++ b/Manifest.txt @@ -1,188 +1,188 @@ .gitignore Gemfile Gemfile.lock History.txt LICENSE Manifest.txt README.TMail.txt -README.txt +README.rdoc Rakefile conf/1nbox.net.yml conf/aliases.yml conf/bellsouth.net.yml conf/from.yml conf/mediamessaging.o2.co.uk.yml conf/messaging.nextel.com.yml conf/mms.3ireland.ie.yml conf/mms.ae.yml conf/mms.alltel.com.yml conf/mms.att.net.yml conf/mms.dobson.net.yml conf/mms.luxgsm.lu.yml conf/mms.mobileiam.ma.yml conf/mms.mtn.co.za.yml conf/mms.mycricket.com.yml conf/mms.myhelio.com.yml conf/mms.netcom.no.yml conf/mms.o2online.de.yml conf/mms.three.co.uk.yml conf/mms.uscc.net.yml conf/mms.vodacom4me.co.za.yml conf/mms2r_media.yml conf/mobile.indosat.net.id.yml conf/msg.telus.com.yml conf/orangemms.net.yml conf/pm.sprint.com.yml conf/pxt.vodafone.net.nz.yml conf/rci.rogers.com.yml conf/sms.sasktel.com.yml conf/tmomail.net.yml conf/txt.bell.ca.yml conf/unicel.com.yml conf/vmpix.com.yml conf/vzwpix.com.yml conf/waw.plspictures.com.yml dev_tools/anonymizer.rb dev_tools/debug_sprint_nokogiri_parsing.rb init.rb lib/ext/mail.rb lib/ext/object.rb lib/mms2r.rb lib/mms2r/media.rb lib/mms2r/version.rb lib/mms2r/media/sprint.rb mms2r.gemspec test/fixtures/1nbox-2images-01.mail test/fixtures/1nbox-2images-02.mail test/fixtures/1nbox-2images-03.mail test/fixtures/1nbox-2images-04.mail test/fixtures/3ireland-mms-01.mail test/fixtures/ad_new.txt test/fixtures/alltel-image-01.mail test/fixtures/alltel-mms-01.mail test/fixtures/alltel-mms-03.mail test/fixtures/apple-double-image-01.mail test/fixtures/att-blackberry-02.mail test/fixtures/att-blackberry.mail test/fixtures/att-image-01.mail test/fixtures/att-image-02.mail test/fixtures/att-iphone-01.mail test/fixtures/att-iphone-02.mail test/fixtures/att-iphone-03.mail test/fixtures/att-text-01.mail test/fixtures/bell-canada-image-01.mail test/fixtures/cingularme-text-01.mail test/fixtures/cingularme-text-02.mail test/fixtures/dici_un_mois_georgie.txt test/fixtures/dobson-image-01.mail test/fixtures/dot.jpg test/fixtures/generic.mail test/fixtures/handsets.yml test/fixtures/helio-image-01.mail test/fixtures/helio-message-01.mail test/fixtures/iconv-fr-text-01.mail test/fixtures/indosat-image-01.mail test/fixtures/indosat-image-02.mail test/fixtures/info2go-image-01.mail test/fixtures/invalid-byte-seq-outlook.mail test/fixtures/iphone-image-01.mail test/fixtures/iphone-image-02.mail test/fixtures/luxgsm-image-01.mail test/fixtures/maroctelecom-france-mms-01.mail test/fixtures/mediamessaging_o2_co_uk-image-01.mail test/fixtures/mmode-image-01.mail test/fixtures/mms.ae-image-01.mail test/fixtures/mms.mycricket.com-pic-and-text.mail test/fixtures/mms.mycricket.com-pic.mail test/fixtures/mmsreply.t-mobile.co.uk-text-image-01.mail test/fixtures/mobile.mycingular.com-text-01.mail test/fixtures/mtn-southafrica-mms.mail test/fixtures/mycingular-image-01.mail test/fixtures/netcom-image-01.mail test/fixtures/nextel-image-01.mail test/fixtures/nextel-image-02.mail test/fixtures/nextel-image-03.mail test/fixtures/nextel-image-04.mail test/fixtures/o2-de-image-01.mail test/fixtures/orange-uk-image-01.mail test/fixtures/orangefrance-text-and-image.mail test/fixtures/orangepoland-text-01.mail test/fixtures/orangepoland-text-02.mail test/fixtures/pics.cingularme.com-image-01.mail test/fixtures/pxt-image-01.mail test/fixtures/rogers-canada-mms-01.mail test/fixtures/sasktel-image-01.mail test/fixtures/sprint-blackberry-01.mail test/fixtures/sprint-broken-image-01.mail test/fixtures/sprint-image-01.mail test/fixtures/sprint-new-image-01.mail test/fixtures/sprint-pcs-text-01.mail test/fixtures/sprint-purged-image-01.mail test/fixtures/sprint-text-01.mail test/fixtures/sprint-two-images-01.mail test/fixtures/sprint-video-01.mail test/fixtures/sprint.mov test/fixtures/suncom-blackberry.mail test/fixtures/telus-image-01.mail test/fixtures/three-uk-image-01.mail test/fixtures/tmo.blackberry.net-image-01.mail test/fixtures/tmobile-blackberry-02.mail test/fixtures/tmobile-blackberry.mail test/fixtures/tmobile-image-01.mail test/fixtures/tmobile-image-02.mail test/fixtures/unicel-image-01.mail test/fixtures/us-cellular-image-01.mail test/fixtures/verizon-blackberry.mail test/fixtures/verizon-image-01.mail test/fixtures/verizon-image-02.mail test/fixtures/verizon-image-03.mail test/fixtures/verizon-text-01.mail test/fixtures/verizon-video-01.mail test/fixtures/virgin-mobile-image-01.mail test/fixtures/virgin.ca-text-01.mail test/fixtures/vodacom4me-co-za-01.mail test/fixtures/vodacom4me-co-za-02.mail test/fixtures/vodacom4me-southafrica-mms-01.mail test/fixtures/vodacom4me-southafrica-mms-04.mail test/fixtures/vtext-text-01.mail test/fixtures/vzwpix.com-image-01.mail test/fixtures/waw.plspictures.com-image-01.mail test/test_1nbox_net.rb test/test_bell_canada.rb test/test_bellsouth_net.rb test/test_helper.rb test/test_invalid_byte_seq_outlook.rb test/test_mediamessaging_o2_co_uk.rb test/test_messaging_nextel_com.rb test/test_messaging_sprintpcs_com.rb test/test_mms2r_media.rb test/test_mms_3ireland_ie.rb test/test_mms_ae.rb test/test_mms_alltel_com.rb test/test_mms_att_net.rb test/test_mms_dobson_net.rb test/test_mms_luxgsm_lu.rb test/test_mms_mobileiam_ma.rb test/test_mms_mtn_co_za.rb test/test_mms_mycricket_com.rb test/test_mms_myhelio_com.rb test/test_mms_netcom_no.rb test/test_mms_o2online_de.rb test/test_mms_three_co_uk.rb test/test_mms_uscc_net.rb test/test_mms_vodacom4me_co_za.rb test/test_mobile_indosat_net_id.rb test/test_msg_telus_com.rb test/test_orangemms_net.rb test/test_pm_sprint_com.rb test/test_pxt_vodafone_net_nz.rb test/test_rci_rogers_com.rb test/test_sms_sasktel_com.rb test/test_sprint.rb test/test_tmomail_net.rb test/test_unicel_com.rb test/test_vmpix_com.rb test/test_vzwpix_com.rb test/test_waw_plspictures_com.rb vendor/plugins/mms2r/lib/autotest/discover.rb vendor/plugins/mms2r/lib/autotest/mms2r.rb diff --git a/lib/mms2r/media.rb b/lib/mms2r/media.rb index 4fc665a..85290ca 100644 --- a/lib/mms2r/media.rb +++ b/lib/mms2r/media.rb @@ -1,562 +1,562 @@ #-- # Copyright (c) 2007-2012 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ ## # = Synopsis # # MMS2R is a library to collect media files from MMS messages. MMS messages # are multipart emails and mobile carriers often inject branding into these # messages. MMS2R strips the advertising from an MMS leaving the actual user # generated media. # # The Tracker for MMS2R is located at # http://rubyforge.org/tracker/?group_id=3065 # Please submit bugs and feature requests using the Tracker. # # If MMS from a carrier not known by MMS2R is encountered please submit a # sample to the author for inclusion in this project. # # == Stand Alone Example # # begin # require 'mms2r' # rescue LoadError # require 'rubygems' # require 'mms2r' # end # mail = Mail.read("sample-MMS.file") # mms = MMS2R::Media.new(mail) # subject = mms.subject # number = mms.number # file = mms.default_media # mms.purge # # == Rails ActionMailer#receive w/ AttachmentFu Example # # def receive(mail) # mms = MMS2R::Media.new(mail) # picture = Picture.new # picture is an attachemnt_fu model # picture.title = mms.subject # picture.uploaded_data = mms.default_media # picture.save! # mms.purge # end # # == More Examples # -# See the README.txt file for more examples +# See the README.rdoc file for more examples # # == Built In Configuration # # A custom configuration can be created for processing the MMS from carriers # that are not currently known by MMS2R. In the conf/ directory create a # YAML file named by combining the domain name of the MMS sender plus a .yml # extension. For instance the configuration of senders from AT&T's cellular # service with a Sender pattern of [email protected] have a configuration # named conf/mms.att.net.yml # # The YAML configuration contains a Hash with instructions for determining what # is content generated by the user and what is content inserted by the carrier. # # The root hash itself has two hashes under the keys 'ignore' and 'transform', # and an array under the 'number' key. # Each hash is itself keyed by mime-type. The value pointed to by the mime-type # key is an array. The ignore arrays are first inspected as regular expressions # else are used as a equality for a string filename. Ignores # work by filename # for the multi-part of the MMS that is being inspected. The array pointed to # by the 'number' key represents an alternate mail header where the sender's # number can be found with a regular expression and replacement value for a # gsub. # # The transform arrays are themselves an array of two element arrays. The elements # are regexp parameters for gsub. # # Ignore instructions are honored first then transform instructions. In the sample, # masthead.jpg is ignored as a regular expression, and spacer.gif is ignored as a # filename comparison. The transform has a match and a replacement, see the gsub # documentation for more information about match and replace. # # -- # ignore: # image/jpeg: # - /^masthead.jpg$/i # image/gif: # - spacer.gif # text/plain: # - /\AThis message was sent using PIX-FLIX Messaging service from .*/m # transform: # text/plain: # - - /\A(.+?)\s+This message was sent using PIX-FLIX Messaging .*/m # - "\1" # number: # - from # - /^([^\s]+)\s.*/ # - "\1" # # Carriers often provide their services under many different domain names. # The conf/aliases.yml is a YAML file with a hash that maps alternative or # legacy carrier names to the most common name of their service. For example # in terms of MMS2R txt.att.net is an alias for mms.att.net. Therefore when # an MMS with a Sender of txt.att.net is processed MMS2R will use the # mms.att.net configuration to process the message. module MMS2R class MMS2R::Media # Pass off everything we don't do to the Mail object # TODO: refactor to explicit addition a la http://blog.jayfields.com/2008/02/ruby-replace-methodmissing-with-dynamic.html def method_missing method, *args, &block mail.send method, *args, &block end ## # Mail object that the media files were derived from. attr_reader :mail ## # media returns the hash of media. The media hash is keyed by mime-type # such as 'text/plain' and the value mapped to the key is an array of # media that are of that type. attr_reader :media ## # Carrier is the domain name of the carrier. If the carrier is not known # the carrier will be set to 'mms2r.media' attr_reader :carrier ## # Base working dir where media for a unique mms message are dropped attr_reader :media_dir ## # Determine if return-path or from is going to be used to desiginate the # origin carrier. If the domain in the From header is listed in # conf/from.yaml then that is the carrier domain. Else if there is a # Return-Path header its address's domain is the carrier doamin, else # use From header's address domain. def self.domain(mail) return_path = case when mail.return_path mail.return_path ? mail.return_path.split('@').last : '' else '' end from_domain = case when mail.from && mail.from.first mail.from.first.split('@').last else '' end f = File.expand_path(File.join(self.conf_dir(), "from.yml")) from = YAML::load_file(f) ret = case when from.include?(from_domain) from_domain when return_path.present? return_path else from_domain end ret end ## # Initialize a new MMS2R::Media comprised of a mail. # # Specify options to initialize with: # :logger => some_logger for logging # :process => :lazy, for non-greedy processing upon initialization # # #process will have to be called explicitly if the lazy process option # is chosen. def initialize(mail, opts={}) @mail = mail @logger = opts[:logger] log("#{self.class} created", :info) @carrier = self.class.domain(mail) @dir_count = 0 sha = Digest::SHA1.hexdigest("#{@carrier}-#{Time.now.to_i}-#{rand}") @media_dir = File.expand_path( File.join(self.tmp_dir(), "#{self.safe_message_id(@mail.message_id)}_#{sha}")) @media = {} @was_processed = false @number = nil @subject = nil @body = nil @exif = nil @default_media = nil @default_text = nil @default_html = nil f = File.expand_path(File.join(self.conf_dir(), "aliases.yml")) @aliases = YAML::load_file(f) conf = "#{@aliases[@carrier] || @carrier}.yml" f = File.expand_path(File.join(self.conf_dir(), conf)) c = File.exist?(f) ? YAML::load_file(f) : {} @config = self.class.initialize_config(c) processor_module = MMS2R::CARRIERS[@carrier] extend processor_module if processor_module lazy = (opts[:process] == :lazy) rescue false self.process() unless lazy end ## # Get the phone number associated with this MMS if it exists. The value # returned is simplistic, it is just the user name of the from address # before the @ symbol. Validation of the number is left to you. Most # carriers are using the real phone number as the username. def number unless @number params = config['number'] if params && params.any? && (header = mail.header[params[0]]) @number = header.to_s.gsub(params[1], params[2]) end if @number.nil? || @number.blank? @number = mail.from.first.split(/@|\//).first rescue "" end end @number end ## # Return the Subject for this message, returns "" for default carrier # subject such as 'Multimedia message' for ATT&T carrier. def subject unless @subject subject = mail.subject.strip rescue "" ignores = config['ignore']['text/plain'] if ignores && ignores.detect{|s| s == subject} @subject = "" else @subject = transform_text('text/plain', subject).last end end @subject end # Convenience method that returns a string including all the text of the # default text/plain file found. If the plain text is blank then it returns # stripped down version of the title and body of default text/html. Returns # empty string if no body text is found. def body text_file = default_text @body = text_file ? IO.readlines(text_file.path).join.strip : "" @body.force_encoding("ISO-8859-1") if RUBY_VERSION >= "1.9" && @body.encoding == "ASCII-8BIT" begin ic = Iconv.new('UTF-8', 'ISO-8859-1' ) @body = ic.iconv(@body) @body << ic.iconv(nil) ic.close rescue Exception => e end if @body.blank? && html_file = default_html html = Nokogiri::HTML(IO.read(html_file.path)) @body = (html.xpath("//head/title").map(&:text) + html.xpath("//body/*").map(&:text)).join(" ") end @body end # Returns a File with the most likely candidate for the user-submitted # media. Given that most MMS messages only have one file attached, this # method will try to return that file. Singleton methods are added to # the File object so it can be used in place of a CGI upload (local_path, # original_filename, size, and content_type) such as in conjunction with # AttachementFu. The largest file found in terms of bytes is returned. # # Returns nil if there are not any video or image Files found. def default_media @default_media ||= attachment(['video', 'image', 'application', 'text']) end # Returns a File with the most likely candidate that is text, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_text @default_text ||= attachment(['text/plain']) end # Returns a File with the most likely candidate that is html, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_html @default_html ||= attachment(['text/html']) end ## # process is a template method and collects all the media in a MMS. # Override helper methods to this template to clean out advertising and/or # ignore media that are advertising. This method should not be overridden # unless there is an extreme special case in processing the media of a MMS # (like Sprint) # # Helper methods for the process template: # * ignore_media? -- true if the media contained in a part should be ignored. # * process_media -- retrieves media to temporary file, returns path to file. # * transform_text -- called by process_media, strips out advertising. # * temp_file -- creates a temporary filepath based on information from the part. # # Block support: # Call process() with a block to automatically iterate through media. # For example, to process and receive only media of video type: # mms.process do |media_type, file| # results << file if media_type =~ /video/ # end # # note: purge must be explicitly called to remove the media files # mms2r extracts from an mms message. def process() # :yields: media_type, file unless @was_processed log("#{self.class} processing", :info) parts = mail.multipart? ? mail.parts : [mail] # Double check for multipart/related, if it exists replace it with its # children parts. Do this twice as multipart/alternative can have # children and we want to fold everything down for i in 1..2 flat = [] parts.each do |p| if p.multipart? p.parts.each {|mp| flat << mp } else flat << p end end parts = flat.dup end # get to work parts.each do |p| t = p.part_type? unless ignore_media?(t,p) t,f = process_media(p) add_file(t,f) unless t.nil? || f.nil? end end @was_processed = true end # when process acts upon a block if block_given? media.each do |k, v| yield(k, v) end end end ## # Helper for process template method to determine if media contained in a # part should be ignored. Producers should override this method to return # true for media such as images that are advertising, carrier logos, etc. # See the ignore section in the discussion of the built-in configuration. def ignore_media?(type, part) ignores = config['ignore'][type] || [] ignore = ignores.detect{ |test| filename?(part) == test} ignore ||= ignores.detect{ |test| filename?(part) =~ test if test.is_a?(Regexp) } ignore ||= ignores.detect{ |test| part.body.decoded.strip =~ test if test.is_a?(Regexp) } ignore ||= (part.body.decoded.strip.size == 0 ? true : nil) ignore.nil? ? false : true end ## # Helper for process template method to decode the part based on its type # and write its content to a temporary file. Returns path to temporary # file that holds the content. Parts with a main type of text will have # their contents transformed with a call to transform_text # # Producers should only override this method if the parts of the MMS need # special treatment besides what is expected for a normal mime part (like # Sprint). # # Returns a tuple of content type, file path def process_media(part) # Mail body auto-magically decodes quoted # printable for text/html type. file = temp_file(part) if part.part_type? =~ /^text\// || part.part_type? == 'application/smil' type, content = transform_text_part(part) mode = 'wb' else if part.part_type? == 'application/octet-stream' type = type_from_filename(filename?(part)) else type = part.part_type? end content = part.body.decoded mode = 'wb' # open with binary bit for Windows for non text end return type, nil if content.nil? || content.empty? log("#{self.class} writing file #{file}", :info) File.open(file, mode){ |f| f.write(content) } return type, file end ## # Helper for process_media template method to transform text. # See the transform section in the discussion of the built-in # configuration. def transform_text(type, text, original_encoding = 'ISO-8859-1') return type, text if !config['transform'] || !(transforms = config['transform'][type]) begin ic = Iconv.new('UTF-8', original_encoding ) utf_t = ic.iconv(text) utf_t << ic.iconv(nil) ic.close rescue Exception => e utf_t = text end transforms.each do |transform| next unless transform.size == 2 p = transform.first r = transform.last utf_t = utf_t.gsub(p, r) rescue utf_t end return type, utf_t end ## # Helper for process_media template method to transform text. def transform_text_part(part) type = part.part_type? text = part.body.decoded.strip transform_text(type, text) end ## # Helper for process template method to name a temporary filepath based on # information in the part. This version attempts to honor the name of the # media as labeled in the part header and creates a unique temporary # directory for writing the file so filename collision does not occur. # Consumers of this method expect the directory structure to the file # exists, if the method is overridden it is mandatory that this behavior is # retained. def temp_file(part) file_name = filename?(part) File.expand_path(File.join(msg_tmp_dir(),File.basename(file_name))) end ## # Purges the unique MMS2R::Media.media_dir directory created # for this producer and all of the media that it contains. def purge() log("#{self.class} purging #{@media_dir} and all its contents", :info) FileUtils.rm_rf(@media_dir) end ## # Helper to add a file to the media hash. def add_file(type, file) media[type] = [] unless media[type] media[type] << file end ## # Helper to temp_file to create a unique temporary directory that is a # child of tmp_dir This version is based on the message_id of the mail. def msg_tmp_dir() @dir_count += 1 dir = File.expand_path(File.join(@media_dir, "#{@dir_count}")) FileUtils.mkdir_p(dir) dir end ## # returns a filename declared for a part, or a default if its not defined def filename?(part) name = part.filename if (name.nil? || name.empty?) if part.content_id && (matched = /^<(.+)>$/.match(part.content_id)) name = matched[1] else name = "#{Time.now.to_f}.#{self.default_ext(part.part_type?)}" end end # FIXME FWIW, janky look for dot extension 1 to 4 chars long name = (name =~ /\..{1,4}$/ ? name : "#{name}.#{self.default_ext(part.part_type?)}").strip # handle excessively large filenames if name.size > 255 ext = File.extname(name) base = File.basename(name, ext) name = "#{base[0, 255 - ext.size]}#{ext}" end name end def aliases @aliases end ## # Best guess of the mobile device type. Simple heuristics thus far by # inspecting mail headers and jpeg/tiff exif metadata, and file name. # Known smart phone types thus far are # # * :blackberry # * :dash # * :droid # * :htc # * :iphone # * :lge # * :motorola # * :nokia # * :palm # * :pantech # * :samsung # diff --git a/mms2r.gemspec b/mms2r.gemspec index 81ba18a..6525e3e 100644 --- a/mms2r.gemspec +++ b/mms2r.gemspec @@ -1,33 +1,33 @@ $:.unshift File.expand_path("../lib", __FILE__) require "mms2r/version" Gem::Specification.new do |gem| gem.add_dependency 'rake', ['= 0.9.2.2'] gem.add_dependency 'nokogiri', ['>= 1.5.0'] gem.add_dependency 'mail', ['>= 2.4.0'] gem.add_dependency 'exifr', ['>= 1.0.3'] gem.add_dependency 'json', ['>= 1.6.0'] gem.add_development_dependency "rdoc" gem.add_development_dependency "simplecov" gem.add_development_dependency 'test-unit' gem.add_development_dependency 'mocha' gem.name = "mms2r" gem.version = MMS2R::Version.to_s gem.platform = Gem::Platform::RUBY gem.authors = ["Mike Mondragon"] gem.email = ["[email protected]"] gem.homepage = "https://github.com/monde/mms2r" gem.summary = "Extract user media from MMS (and not carrier cruft)" gem.description = "MMS2R is a library that decodes the parts of an MMS message to disk while stripping out advertising injected by the mobile carriers." gem.rubyforge_project = "mms2r" gem.rubygems_version = ">= 1.3.6" gem.files = `git ls-files`.split("\n") gem.require_path = ['lib'] - gem.rdoc_options = ["--main", "README.txt"] - gem.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.TMail.txt", "README.txt"] + gem.rdoc_options = ["--main", "README.rdoc"] + gem.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.TMail.txt", "README.rdoc"] gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") end
monde/mms2r
5b3ae8db2ace126d77fbf191f61093fd2e01f587
prepping 3.7.1 release
diff --git a/Gemfile.lock b/Gemfile.lock index 7b9c3fe..b860b79 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,48 +1,48 @@ PATH remote: . specs: - mms2r (3.7.0) + mms2r (3.7.1) exifr (>= 1.0.3) json (>= 1.6.0) mail (>= 2.4.0) nokogiri (>= 1.5.0) rake (= 0.9.2.2) GEM remote: https://rubygems.org/ specs: - exifr (1.1.2) + exifr (1.1.3) i18n (0.6.0) json (1.7.3) mail (2.4.4) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) metaclass (0.0.1) mime-types (1.18) mocha (0.11.4) metaclass (~> 0.0.1) multi_json (1.3.5) nokogiri (1.5.2) polyglot (0.3.3) rake (0.9.2.2) rdoc (3.12) json (~> 1.4) simplecov (0.6.4) multi_json (~> 1.0) simplecov-html (~> 0.5.3) simplecov-html (0.5.3) test-unit (2.4.8) treetop (1.4.10) polyglot polyglot (>= 0.3.1) PLATFORMS ruby DEPENDENCIES mms2r! mocha rdoc simplecov test-unit diff --git a/History.txt b/History.txt index 11810bb..b6441a9 100644 --- a/History.txt +++ b/History.txt @@ -1,434 +1,440 @@ +### 3.7.1 / 2012-06-04 (Abrigail Remeltindtdrinc - The Record Cleaner) + +* 2 minor enhancements + * Improve processing of Sprint media - James McGrath + * RDoc format documentation - James McGrath + ### 3.7.0 / 2012-05-31 (The Teenager - Edgar's brother via Eric's face) * 2 major enhancements * Improve processing of Sprint media - James McGrath * Remove Hoe and gemcutter dependencies ### 3.6.4 / 2012-04-22 (Molly - Pickles' mother) * 1 minor enhancement * strip a variation of the iphone default footer ### 3.6.3 / 2012-03-25 (Dethklok Minute Host - host of The Dethklok Minute) * 1 minor enhancement * strip Windows phone default footer ### 3.6.2 / 2012-02-12 (Mr. Gojira - Owner Mr. Gojira's Driving School - retake driver's exam) * 1 minor enhancement * Change user agent given to Sprint so it returns a properly sized image. ### 3.6.1 / 2012-02-11 (Mr. Gojira - Owner Mr. Gojira's Driving School) * 1 minor enhancement * use Net::HTTP#get2 to fetch Sprint content ### 3.6.0 / 2012-01-19 (Agent 216 - assassin, master of infiltration and sabotage) * 1 major enhancement * Ruby 1.8.7, 1.9.2, and 1.9.3 compatible * 1 bug fix * A fix for the utf-8 encoding issue with ruby 1.9.2 - minimul / Christian ### 3.5.1 / 2011-12-11 (Mashed Potato Johnson - oldest living blues guitarist in the world) * 1 bug fix * A fix for the utf-8 encoding issue with ruby 1.9.2 - James McGrath ### 3.5.0 / 2011-12-01 (Dr. Milminiman Lamilim Swimwambli - Marriage expert) * 1 major bug fix * In Ruby 1.9.X MMS2R::Media::Sprint was not fetching content from Sprint's CDN correctly because the implementation of Net::HTTP in 1.9.X passes a User-Agent header of "Ruby" to which Sprint responds with a fake 500 - with help from James McGrath ### 3.4.1 / 2011-11-06 (Fatty Ding-Dongs, Dethklok foster child) * 2 major enhancements * Additional means to detect android, iphone, motorola, nokia, palm handsets * Additional known SMS/MMS domains mm.att.net, labwig.net, cdma.sasktel.com ### 3.4.0 / 2011-10-31 (Serveta Skwigelf, Skwisgaar's hot mom) * 2 major enhancements * regexp's in yaml configs are store as a ruby regexp and not a string that is evaled. * character encoding capability with 1.8 rubies and 1.9 rubies. ### 3.3.1 / 2011-01-01 (Reverend Aslaug Wartooth (deceased), Toki's dad) * 2 minor enhancements * new method #default_html returns the default html attachment * #body will return the default plain text, or default stripped html text ### 3.3.0 / 2010-12-31 (Charles Foster Offdensen - CFO, dethklok) * 1 major enhancement * MMS2R::Media::Sprint is now a module that is extended in for processing Sprint content rather than being child class of MMS2R::Media Extension is the strategy to use for overwriting template methods now * 1 minor enhancement * process new Sprint subject - Jason Hooper * new SaskTel mms/sms domain alias sasktel.com * new Virgin Mobile mms/sms domain alias yrmobl.com ### 3.2.0 / 2010-08-17 (Antonio "Tony" DiMarco Thunderbottom - bassist) * 3 minor enhancements * updated readme with latest sites known to use mms2r * bundler assimilated * loading rubygems only if it's required, like rake ### 3.1.0 / 2010-07-09 (Dick "Magic Ears" Knubbler - music producer) * 8 minor enhancements * Detects additional Bell/AT&T domain sbcglobal.net as a handset * Detects additional Virgin mobile domains pixmbl.com vmobl.com as a handset * Expanded mobile phone detection for handset makers by : Casio, Google Nexus One, LG Electronics, Motorola, Pantech, Qualcom, Samsung, Sprint, UTStarCom * EXIF Reader (exifr) is integral to MMS2R and is now a required gem * upgrade Mail to 2.2.5 * depend on latest gems * corrected example - Jason Hooper * added As Seen On The Internet to README that lists sites known to be using MMS2R in some fashion ### 3.0.1 / 2010-03-28 (Lavona Succuboso - leader of "Succuboso Explosion") * 1 minor enhancement * support for U.S. Cellular ### 3.0.0 / 2010-02-24 (General Crozier - Chairman of the Joint Chiefs of Staff) * 1 new feature * dependence upon Mail gem rather than TMail gem ### 2.4.1 / 2010-02-07 (Vater Orlaag - political and spiritual specialist) * 3 minor enhancements * make sure filename is free of new lines - laurynas * recognize HTC HERO200 as a smart phone * recognize HTC Eris as a smart phone ### 2.4.0 / 2009-12-20 (Dr. Nanemiltred Philtendrieden - specialist on celebrity death) * 1 new feature * replace Hpricot with Nokogiri for html parsing of Sprint data * 3 minor enhancements * smartphone identities stored in conf/mms2r_media.yml * identify Motorola Droid as a smartphone * identify T-Mobile Dash as a smartphone * use uuidtools for naming temp directories - kbaum ### 2.3.0 / 2009-08-30 (Snakes 'n' Barrels Greatest Hits) * 5 new features * detect smartphone status/type based on model metadata from jpeg and tiff exif data using exifr gem, access exif data with MMS2R::Media#exif * make MMS2R Rails gem packaging friendly with an init.rb - Scott Taylor, smtlaissezfaire * delegate missing methods to mms2r's tmail object so that mms2r behaves as if it were a tmail object - Sai Emrys, saizai * default_media can return an attachment of application content type - Brendan Lim, brendanlim * MMS2R.parse(raw_mail) convenience class method that parses and returns an mms2r from a mail file - saizai * 4 minor enhancements * make examples more 'mail' specific to enforce the fact that an mms is a multipart email - saizai * update for text in vzwpix.com default carrier message * detecting smartphone (blackberries and iphones for now) is more versatile from reading mail headers * expanded filtering of carrier advertising text in mms from smartphones ### 2.2.0 / 2009-01-04 (Rikki Kixx - owner of a franchise of rehab centers) * 3 new features * MMS2R::Media#is_mobile? best guess if the sender was a mobile device * MMS2R::Media#device_type? best guess of the mobile device type. Simple heuristics thus far for :blackberry :iphone :handset :unknown could be expanded for exif probing or additinal shifting of mail header * from array in conf/from.yml to provide granularity to determine carrier domain (caused by tmo.blackberry.net) * 4 minor enhancements * support for Virgin Canada messaging service vmobile.ca * support for text service messaging.sprintpcs.com * additional BlackBerry coverage from T-Mobile tmo.blackberry.net provider * legacy support for mobile.mycingular.com, pics.cingularme.com * 3 bug fixes * iPhone default subject - jesse dp http://rubyforge.org/tracker/?func=detail&atid=11789&aid=22951&group_id=3065 * add sprintpcs.com to pm.sprint.com aliases * fix OS X long filename issues - Matt Conway ### 2.1.3 / 2008-11-06 (Dr. Ramonolith Chesterfield - Military pharmaceutical psychotropic drug manufacturing expert * 1 minor enhancement * added mms.ae support ### 2.1.2 / 2008-10-21 (Toki's mom, Anja Wartooth) * 2 minor enhancments * Sprint subject update - jesse dp * Virgin Mobile support vmpix.com ### 2.1.1 / 2008-09-24 (Lavona Succuboso, Nathan Explosion uber-groupie) * 4 minor enhancments * Bell Canada support txt.bell.ca - Matt Conway / Snap My Life - http://github.com/wr0ngway, http://github.com/sml * Unicel support unicel.com - Michael DelGaudio * info2go.com support / Unicel * TELUS Corporation support mms.telusmobility.com, msg.telus.com * add test to check that gem builds correctly as a github gem * 1 bug fix * Iconv utf8 fix - Kai Kai ### 2.1.0 / 2008-07-30 (Dr. Gibbons – Birthday expert and Murderface expert) * 1 major enhancement: * opens up TMail for improved query method patterned code in MMS2R * 2 minor enhancements: * UK O2 support mediamessaging.o2.co.uk - Jeremy Wilkins * Write non text files with binary bit set on Windows - David Alm * source hosted on github: git clone git://github.com/monde/mms2r.git ### 2.0.5 / 2008-07-17 (Dr. Ralphus Galkensmelter - Psychological death expert) * Deal with Apple Mail multipart/appledouble - jesse dp ### 2.0.4 / 2008-04-28 (Mr. Selatcia - elder member of The Tribunal) * updated mms.vodacom4me.co.za Vodacom South Africa - Vijay Yellapragada * 1nbox.net / Idea cellular 1nbox.net - Vijay Yellapragada * mms.3ireland.ie / 3 Ireland - Vijay Yellapragada * mms.alltel.com / Alltel (reverted message.alltel.com) - Vijay Yellapragada * mms.mobileiam.ma / Maroc Telecom - Vijay Yellapragada * mms.mtn.co.za / MTM South Africa - Vijay Yellapragada * rci.rogers.com / Rogers of Canada - Vijay Yellapragada * mmsreply.t-mobile.co.uk / T-Mobile UK - Vijay Yellapragada * waw.plspictures.com / PLSPICTURES.COM mms hosting service ### 2.0.3 / 2008-04-15 (Enter Taxman - The 1040 MMS Form) * fix case when part is image/jpeg declared 'application/octet-stream' * trim dangling image/jpeg text from blackberry messages * file extensions added to filenames that are missing extensions in part headers * anonymize images in fixtures to reduce gem size * T-Mobile update - jesse dp * AT&T/T-Mobile Blackberrry update - Dave Myron ### 2.0.2 / 2008-02-22 (The Jomfru Brothers - proprietors of diefordethklok.com) * added support for mms.vodacom4me.co.za Vodacom South Africa - Jason Haruska * added support for bellsouth.net - Jason Haruska * added support for mms.mycricket.com * Improved Blackberry and iPhone suport - Jason Haruska * added :number key to configuration to provide rules for specifying alternative phone number location * return sender's phone number for mobile.indosat.net.id * return sender's phone number for mms.luxgsm.lu * return sender's phone number for mms.vodacom4me.co.za ### 2.0.1 / 2008-02-08 (Professor Jerry Gustav Munndig - Child control expert) * strip out common blackberry and iPhone signatures * handle carriers that use external mail services such as Yahoo! as the From address * Add support for mobile.indosat.net.id (and yahoo.co.id) - Jason Haruska * Add support for sms.sasktel.com - Jason Haruska ### 2.0.0 / 2008-01-23 (Skwisgaar Skwigelf - fastest guitarist alive) * added support for pxt.vodafone.net.nz PXT New Zealand * added support for mms.o2online.de O2 Germany * added support for orangemms.net Orange UK * added support for txt.att.net AT&T * added support for mms.luxgsm.lu LUXGSM S.A. * added support for mms.netcom.no NetCom (Norway) * added support for mms.three.co.uk Hutchison 3G UK Ltd * removed deprecated #get_number use #number * removed deprecated #get_subject use #subject * removed deprecated #get_body use #body * removed deprecated #get_media use #default_media * removed deprecated #get_text use #default_text * removed deprecated #get_attachment use #attachment * fixed error when Sprint content server responds 500 * better yaml configs * moved TMail dependency from Rails ActionMailer SVN to 'official' Gem * ::new greedily processes MMS unless otherwise specified as an initialize option :process => :lazy * logger moved to initialize option :logger => some_logger * testing using mocks and stubs instead of duck raped Net::HTTP * fixed typo in name of method #attachement to #attachment * fixed broken downloading of Sprint videos ### 1.1.12 / 2007-10-21 (Dr. Ronald von Moldenberg - Endorsement specialist) * fetch original images from Sprint content server (Layton Wedgeworth) * ignore Sprint messages when requested content has been purged from their content server ### 1.1.11 / 2007-10-20 (Dr. Armand Skagerakk Frederickshaven - Mythology expert) * minor fix for attachment_fu where it might call #path on the cgi temp file that is returned by get_attachment * renamed a_t_t_media.rb to att_media.rb to make it autotest happy * masthead.jpg misplaced in mms2r_t_mobile_media_ignore.yml (Layton Wedgeworth) * overridden SprintMedia#process failed to accept block (Layton Wedgeworth) * added method_deprecated to help mark methods that are going to be deprecated in preparation of 1.2.x release * #get_number marked deprecated, use #number instead * #get_subject marked deprecated, use #subject instead * #get_body marked deprecated, use #body instead * #get_text marked deprecated, use #default_text instead * #get_attachment marked deprecated, use #attachment instead * #get_media marked deprecated, use #default_media instead ### 1.1.10 / 2007-09-30 (Face Bones) * fixed a case for a nil match on From in the create method (Luke Francl) * added support for Alltel message.alltel.com (Ben Wood) ### 1.1.9 / 2007-09-08 (Rebecca Nightrod - controlling girlfriend of Nathan Explosion) * fixed broken support for act_as_attachment and attachment_fu ### 1.1.8 / 2007-09-08 (James Grishnack - Head of Behemoth Productions, producer of Blood Ocean) * Added support for Orange of France, Orange orange.fr (Julian Biard) * purge in the process block removed, purge must be called explicitly after processing to clean up extracted temporary media files. ### 1.1.7 / 2007-08-25 (Adam Nergal, friend of Skwisgaar, but not Pickles) * Added support for Orange of Poland, Orange mmsemail.orange.pl (Zbigniew Sobiecki) * Cleaned up documentation modifiers * Cleaned out non-Ruby code idioms ### 1.1.6 / 2007-08-11 (Mustakrakish, the Lake Troll part 2) * Redo of release mistake of 1.1.5 ### 1.1.5 / 2007-08-11 (Mustakrakish, the Lake Troll) * AT&T => mms.att.net not clearing out default "multimedia message" subject to nil (Will Jessup) * Ignore case on default subject for all carriers in corresponding conf/mms2r_XXX_media_subject.yml ### 1.1.4 / 2007-08-07 (Dr. Rockso) * AT&T => mms.att.net support (thanks Mike Chen and Dave Myron) * get_body returns nil when there is not user text (sorry Will!) ### 1.1.3 / 2007-07-10 (Charles Foster Ofdensen) * Helio support by Will Jessup * get_subject returns nil on default carrier subjects ### 1.1.2 / 2007-06-13 (Dethklok roadie #2) * placed versioned hpricot dependency in Hoe's extra_deps (an attempt to appease firebrigade gods or not cause Gem::RemoteInstallationCancelled whichever you prefer) ### 1.1.1 / 2007-06-11 (Dethklok roadie) * rescue rcov non-dependency in Rakefile to make firebrigade happy ### 1.1.0 / 2007-06-08 (Toki Wartooth) * get_body to return body text (Luke Francl) * get_subject returns "" for default subjects now * default subjects listed in yaml by carrier in conf directory * added granularity to Cingular, Sprint, and Verizon carrier services (Will Jessup) * refactored Sprint instance to process all media (Will Jessup + Mike) * optimized text transformations (Will Jessup) * properly handle ISO-8859-1 and UTF-8 text (Will Jessup) * autotest powers activate! (ZenTest autotest discovery enabled) * configuration file ignores, transforms, and subjects all store Regexp's * Put vendor Text::Format & TMail::Mail as an external subversion dependency to the 1.2 stable branch of Rails ActionMailer * added get_number method to return the phone number associated with this MMS * get_media and get_text attachment_fu helper return the largest piece of media of that type if the more than one exits in the media (Luke Francl) * added block support to process() method (Shane Vitarana) ### 1.0.7 / 2007-04-27 (Senator Stampingston) * patch submitted by Luke Francl * added a get_subject method that returns nil when any MMS has a default carrier subject * get_subject returns nil for '', 'Multimedia message', '(no subject)', 'You have new Picture Mail!' ### 1.0.6 / 2007-04-24 (Pickles the Drummer) * patch submitted by Luke Francl * added support for mms.dobson.net (Dobson aka Cellular One) (Luke) * DRY'd up unit tests (Luke) * added get_media instance method that returns first video or image as File (Luke) * File from get_media can be used by/with attachment_fu (Luke) * added get_text instance method that returns first non advertising text * File from get_text can be used by/with attachment_fu ### 1.0.5 / 2007-04-10 (William Murderface) * patch submitted by Luke Francl * made ignore_media? start its text check from the start of the file (Luke) * added new text transform for Verizon messages (Luke) * updated Nextel ignore conf (Luke) * added additional samples and tests for T-Mobile & Verizon (Luke) * cleaned up MMS2R::Media documentation * added Sprint broken image test for when media goes stale on their content server * fixed teardown typo in lots of plases * added tests for 4 three samples of unique variants of Sprint/Nextel text * 100% test coverage! ### 1.0.4 / 2007-04-09 (Metalocalypse) * fix teardown in test_mms2r_sprint.rb (shanesbrain.net) * clean up Net::HTTP in MMS2R::SprintMedia (shanesbrain.net) * added accessor MMS2R::Media.media_dir * fixed a nil issue with underlying tmp working dir * added exception handling around Net::HTTP in MMS2R::SprintMedia ### 1.0.3 / 2007-04-05 (Paper Cut) * Cleaned up packaging and errors in example found by Shane V. http://shanesbrain.net/ ### 1.0.2 / 2007-03-07 * Reorganized tests and fixtures * Added carriers: * Cingular => cingularme.com * Nextel => messaging.nextel.com * Verizon => vtext.com ### 1.0.1 / 2007-03-07 * Flubbed RubyForge release ... do not use this. ### 1.0.0 / 2007-03-06 * Birthday! * AT&T/Cingular => mmode.com * Cingular => mms.mycingular.com * Sprint => pm.sprint.com * Sprint => messaging.sprintpcs.com * T-Mobile => tmomail.net * Verizon => vzwpix.com diff --git a/lib/mms2r/version.rb b/lib/mms2r/version.rb index ad58e7e..627ea75 100644 --- a/lib/mms2r/version.rb +++ b/lib/mms2r/version.rb @@ -1,25 +1,25 @@ module MMS2R class Version def self.major 3 end def self.minor 7 end def self.patch - 0 + 1 end def self.pre nil end def self.to_s [major, minor, patch, pre].compact.join('.') end end end diff --git a/mms2r.gemspec b/mms2r.gemspec index 30385bc..81ba18a 100644 --- a/mms2r.gemspec +++ b/mms2r.gemspec @@ -1,33 +1,33 @@ $:.unshift File.expand_path("../lib", __FILE__) require "mms2r/version" Gem::Specification.new do |gem| gem.add_dependency 'rake', ['= 0.9.2.2'] gem.add_dependency 'nokogiri', ['>= 1.5.0'] gem.add_dependency 'mail', ['>= 2.4.0'] gem.add_dependency 'exifr', ['>= 1.0.3'] gem.add_dependency 'json', ['>= 1.6.0'] gem.add_development_dependency "rdoc" gem.add_development_dependency "simplecov" gem.add_development_dependency 'test-unit' gem.add_development_dependency 'mocha' gem.name = "mms2r" gem.version = MMS2R::Version.to_s gem.platform = Gem::Platform::RUBY gem.authors = ["Mike Mondragon"] gem.email = ["[email protected]"] gem.homepage = "https://github.com/monde/mms2r" gem.summary = "Extract user media from MMS (and not carrier cruft)" - gem.description = open(File.join(File.dirname(__FILE__), 'README.txt')).readlines[6...22].join + gem.description = "MMS2R is a library that decodes the parts of an MMS message to disk while stripping out advertising injected by the mobile carriers." gem.rubyforge_project = "mms2r" gem.rubygems_version = ">= 1.3.6" gem.files = `git ls-files`.split("\n") gem.require_path = ['lib'] gem.rdoc_options = ["--main", "README.txt"] gem.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.TMail.txt", "README.txt"] gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") end
monde/mms2r
f03e21cf772e9e8809d692182ab1c7376fec1fa2
Fixed typo for missing bracket.
diff --git a/README.rdoc b/README.rdoc index 4bc7c74..07beded 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,222 +1,222 @@ = mms2r https://github.com/monde/mms2r == DESCRIPTION MMS2R by Mike Mondragon https://github.com/monde/mms2r https://rubygems.org/gems/mms2r http://peepcode.com/products/mms2r-pdf MMS2R is a library that decodes the parts of an MMS message to disk while stripping out advertising injected by the mobile carriers. MMS messages are multipart email and the carriers often inject branding into these messages. Use MMS2R if you want to get at the real user generated content from a MMS without having to deal with the cruft from the carriers. If MMS2R is not aware of a particular carrier no extra processing is done to the MMS other than decoding and consolidating its media. MMS2R can be used to process any multipart email to conveniently access the parts the mail is comprised of. Contact the author to add additional carriers to be processed by the library. Suggestions and patches appreciated and welcomed! === Corpus of carriers currently processed by MMS2R: * 1nbox/Idea: 1nbox.net * 3 Ireland: mms.3ireland.ie * Alltel: mms.alltel.com * AT&T/Cingular/Legacy: mms.att.net, mm.att.net, txt.att.net, mmode.com, mms.mycingular.com, cingularme.com, mobile.mycingular.com pics.cingularme.com * Bell Canada: txt.bell.ca * Bell South / Suncom / SBC Global: bellsouth.net, sbcglobal.net * Cricket Wireless: mms.mycricket.com * Dobson/Cellular One: mms.dobson.net * Helio: mms.myhelio.com * Hutchison 3G UK Ltd: mms.three.co.uk * INDOSAT M2: mobile.indosat.net.id * LUXGSM S.A.: mms.luxgsm.lu * Maroc Telecom / mms.mobileiam.ma * MTM South Africa: mms.mtn.co.za * NetCom (Norway): mms.netcom.no * Nextel: messaging.nextel.com * O2 Germany: mms.o2online.de * O2 UK: mediamessaging.o2.co.uk * Orange & Regional Oranges: orangemms.net, mmsemail.orange.pl, orange.fr * PLSPICTURES.COM mms hosting: waw.plspictures.com * PXT New Zealand: pxt.vodafone.net.nz * Rogers of Canada: rci.rogers.com * SaskTel: sasktel.com, sms.sasktel.com, cdma.sasktel.com * Sprint: pm.sprint.com, messaging.sprintpcs.com, sprintpcs.com * T-Mobile: tmomail.net, mmsreply.t-mobile.co.uk, tmo.blackberry.net * TELUS Corporation (Canada): mms.telusmobility.com, msg.telus.com * U.S. Cellular: mms.uscc.net * UAE MMS: mms.ae * Unicel: unicel.com, info2go.com (note: mobile number is tucked away in a text/plain part for unicel.com) * Verizon: vzwpix.com, vtext.com, labwig.net * Virgin Mobile: vmpix.com, pixmbl.com, vmobl.com, yrmobl.com * Virgin Mobile of Canada: vmobile.ca * Vodacom: mms.vodacom4me.co.za === Corpus of smart phones known to MMS2R: * Apple iPhone variants * Blackberry / Research In Motion variants * Casio variants * Droid variants * Google / Nexus One variants * HTC variants (T-Mobile Dash, Sprint HERO) * LG Electronics variants * Motorola variants * Pantech variants * Qualcom variants * Samsung variants * Sprint variants * UTStarCom variants === As Seen On The Internets - sites known to be using MMS2R in some fashion * twitpic.com[http://www.twitpic.com/] * Simplton[http://simplton.com/] * fanchatter.com[http://www.fanchatter.com/] * camura.com[http://www.camura.com/] * eachday.com[http://www.eachday.com/] * beenup2.com[http://www.beenup2.com/] * snapmylife.com[http://www.snapmylife.com/] * email the author to be listed here == FEATURES * #default_media and #default_text methods return a File that can be used in attachment_fu or Paperclip * #process supports blocks for enumerating over the content of the MMS * #process can be made lazy when :process => :lazy is passed to new * logging is enabled when :logger => your_logger is passed to new * an mms instance acts like a Mail object, any methods not defined on the instance are delegated to it's underlying Mail object * #device_type? returns a symbol representing a device or smartphone type Known smartphones thus far: iPhone, BlackBerry, T-Mobile Dash, Droid, Samsung == BOOKS MMS2R, Making email useful http://peepcode.com/products/mms2r-pdf == SYNOPSIS begin require 'mms2r' rescue LoadError require 'rubygems' require 'mms2r' end # required for the example require 'fileutils' mail = MMS2R::Media.new(Mail.read('some_saved_mail.file')) puts "mail has default carrier subject" if mail.subject.empty? # access the sender's phone number puts "mail was from phone #{mail.number}" # most mail are either image or video, default_media will return the largest # (non-advertising) video or image found file = mail.default_media puts "mail had a media: #{file.inspect}" unless file.nil? # finds the largest (non-advertising) text found file = mail.default_text puts "mail had some text: #{file.inspect}" unless file.nil? # mail.media is a hash that is indexed by mime-type. # The mime-type key returns an array of filepaths # to media that were extract from the mail and # are of that type mail.media['image/jpeg'].each {|f| puts "#{f}"} mail.media['text/plain'].each {|f| puts "#{f}"} # print the text (assumes mail had text) text = IO.readlines(mail.media['text/plain'].first).join puts text # save the image (assumes mail had a jpeg) FileUtils.cp mail.media['image/jpeg'].first, '/some/where/useful', :verbose => true puts "does the mail have quicktime video? #{!mail.media['video/quicktime'].nil?}" puts "plus run anything that Mail provides, e.g. #{mail.to.inspect}" # check if the mail is from a mobile phone puts "mail is from a mobile phone #{mail.is_mobile?}" # determine the device type of the phone puts "mail is from a mobile phone of type #{mail.device_type?}" # inspect default media's exif data if exifr gem is installed and default # media is a jpeg or tiff puts "mail's default media's exif data is:" puts mail.exif.inspect # Block support, process and receive all media types of video. mail.process do |media_type, files| # assumes a Clip model that is an AttachmentFu Clip.create(:uploaded_data => files.first, :title => "From phone") if media_type =~ /video/ end # Another AttachmentFu example, Picture model is an AttachmentFu picture = Picture.new picture.title = mail.subject picture.uploaded_data = mail.default_media picture.save! #remove all the media that was put to temporary disk mail.purge == REQUIREMENTS * Mail (mail) * Nokogiri (nokogiri) * UUIDTools (uuidtools) * EXIF Reader (exif) == INSTALL * sudo gem install mms2r == SOURCE git clone git://github.com/monde/mms2r.git == AUTHORS Copyright (c) 2007-2012 by Mike Mondragon blog[http://plasti.cx/] -MMS2R's {Flickr page}(http://www.flickr.com/photos/8627919@N05/] +MMS2R's {Flickr page}[http://www.flickr.com/photos/8627919@N05/] == CONTRIBUTORS * Luke Francl - blog[http://railspikes.com/] * Will Jessup - blog[http://www.willjessup.com/] * Shane Vitarana - blog[http://www.shanesbrain.net/] * Layton Wedgeworth - company[http://www.beenup2.com/] * Jason Haruska - blog[http://software.haruska.com/] * Dave Myron - company[http://contentfree.com/] * Vijay Yellapragada * Jesse Dp - {github profile}[http://github.com/jessedp] * David Alm * Jeremy Wilkins * Matt Conway - {github profile}[http://github.com/wr0ngway] * Kai Kai * Michael DelGaudio * Sai Emrys - blog[http://saizai.com] * Brendan Lim - {github profile}[http://github.com/brendanlim] * Scott Taylor - {github profile}[http://github.com/smtlaissezfaire] * Jaap van der Meer - {github profile}[http://github.com/japetheape] * Karl Baum - {github profile}[http://github.com/kbaum] * James McGrath - blog[http://jamespmcgrath.com]
monde/mms2r
8121ee36ecc30eaccb907998218c19abe22a573d
formatted one more minor heading.
diff --git a/README.rdoc b/README.rdoc index 2bf8c09..4bc7c74 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,222 +1,222 @@ = mms2r https://github.com/monde/mms2r == DESCRIPTION MMS2R by Mike Mondragon https://github.com/monde/mms2r https://rubygems.org/gems/mms2r http://peepcode.com/products/mms2r-pdf MMS2R is a library that decodes the parts of an MMS message to disk while stripping out advertising injected by the mobile carriers. MMS messages are multipart email and the carriers often inject branding into these messages. Use MMS2R if you want to get at the real user generated content from a MMS without having to deal with the cruft from the carriers. If MMS2R is not aware of a particular carrier no extra processing is done to the MMS other than decoding and consolidating its media. MMS2R can be used to process any multipart email to conveniently access the parts the mail is comprised of. Contact the author to add additional carriers to be processed by the library. Suggestions and patches appreciated and welcomed! === Corpus of carriers currently processed by MMS2R: * 1nbox/Idea: 1nbox.net * 3 Ireland: mms.3ireland.ie * Alltel: mms.alltel.com * AT&T/Cingular/Legacy: mms.att.net, mm.att.net, txt.att.net, mmode.com, mms.mycingular.com, cingularme.com, mobile.mycingular.com pics.cingularme.com * Bell Canada: txt.bell.ca * Bell South / Suncom / SBC Global: bellsouth.net, sbcglobal.net * Cricket Wireless: mms.mycricket.com * Dobson/Cellular One: mms.dobson.net * Helio: mms.myhelio.com * Hutchison 3G UK Ltd: mms.three.co.uk * INDOSAT M2: mobile.indosat.net.id * LUXGSM S.A.: mms.luxgsm.lu * Maroc Telecom / mms.mobileiam.ma * MTM South Africa: mms.mtn.co.za * NetCom (Norway): mms.netcom.no * Nextel: messaging.nextel.com * O2 Germany: mms.o2online.de * O2 UK: mediamessaging.o2.co.uk * Orange & Regional Oranges: orangemms.net, mmsemail.orange.pl, orange.fr * PLSPICTURES.COM mms hosting: waw.plspictures.com * PXT New Zealand: pxt.vodafone.net.nz * Rogers of Canada: rci.rogers.com * SaskTel: sasktel.com, sms.sasktel.com, cdma.sasktel.com * Sprint: pm.sprint.com, messaging.sprintpcs.com, sprintpcs.com * T-Mobile: tmomail.net, mmsreply.t-mobile.co.uk, tmo.blackberry.net * TELUS Corporation (Canada): mms.telusmobility.com, msg.telus.com * U.S. Cellular: mms.uscc.net * UAE MMS: mms.ae * Unicel: unicel.com, info2go.com (note: mobile number is tucked away in a text/plain part for unicel.com) * Verizon: vzwpix.com, vtext.com, labwig.net * Virgin Mobile: vmpix.com, pixmbl.com, vmobl.com, yrmobl.com * Virgin Mobile of Canada: vmobile.ca * Vodacom: mms.vodacom4me.co.za === Corpus of smart phones known to MMS2R: * Apple iPhone variants * Blackberry / Research In Motion variants * Casio variants * Droid variants * Google / Nexus One variants * HTC variants (T-Mobile Dash, Sprint HERO) * LG Electronics variants * Motorola variants * Pantech variants * Qualcom variants * Samsung variants * Sprint variants * UTStarCom variants -As Seen On The Internets - sites known to be using MMS2R in some fashion +=== As Seen On The Internets - sites known to be using MMS2R in some fashion * twitpic.com[http://www.twitpic.com/] * Simplton[http://simplton.com/] * fanchatter.com[http://www.fanchatter.com/] * camura.com[http://www.camura.com/] * eachday.com[http://www.eachday.com/] * beenup2.com[http://www.beenup2.com/] * snapmylife.com[http://www.snapmylife.com/] * email the author to be listed here == FEATURES * #default_media and #default_text methods return a File that can be used in attachment_fu or Paperclip * #process supports blocks for enumerating over the content of the MMS * #process can be made lazy when :process => :lazy is passed to new * logging is enabled when :logger => your_logger is passed to new * an mms instance acts like a Mail object, any methods not defined on the instance are delegated to it's underlying Mail object * #device_type? returns a symbol representing a device or smartphone type Known smartphones thus far: iPhone, BlackBerry, T-Mobile Dash, Droid, Samsung == BOOKS MMS2R, Making email useful http://peepcode.com/products/mms2r-pdf == SYNOPSIS begin require 'mms2r' rescue LoadError require 'rubygems' require 'mms2r' end # required for the example require 'fileutils' mail = MMS2R::Media.new(Mail.read('some_saved_mail.file')) puts "mail has default carrier subject" if mail.subject.empty? # access the sender's phone number puts "mail was from phone #{mail.number}" # most mail are either image or video, default_media will return the largest # (non-advertising) video or image found file = mail.default_media puts "mail had a media: #{file.inspect}" unless file.nil? # finds the largest (non-advertising) text found file = mail.default_text puts "mail had some text: #{file.inspect}" unless file.nil? # mail.media is a hash that is indexed by mime-type. # The mime-type key returns an array of filepaths # to media that were extract from the mail and # are of that type mail.media['image/jpeg'].each {|f| puts "#{f}"} mail.media['text/plain'].each {|f| puts "#{f}"} # print the text (assumes mail had text) text = IO.readlines(mail.media['text/plain'].first).join puts text # save the image (assumes mail had a jpeg) FileUtils.cp mail.media['image/jpeg'].first, '/some/where/useful', :verbose => true puts "does the mail have quicktime video? #{!mail.media['video/quicktime'].nil?}" puts "plus run anything that Mail provides, e.g. #{mail.to.inspect}" # check if the mail is from a mobile phone puts "mail is from a mobile phone #{mail.is_mobile?}" # determine the device type of the phone puts "mail is from a mobile phone of type #{mail.device_type?}" # inspect default media's exif data if exifr gem is installed and default # media is a jpeg or tiff puts "mail's default media's exif data is:" puts mail.exif.inspect # Block support, process and receive all media types of video. mail.process do |media_type, files| # assumes a Clip model that is an AttachmentFu Clip.create(:uploaded_data => files.first, :title => "From phone") if media_type =~ /video/ end # Another AttachmentFu example, Picture model is an AttachmentFu picture = Picture.new picture.title = mail.subject picture.uploaded_data = mail.default_media picture.save! #remove all the media that was put to temporary disk mail.purge == REQUIREMENTS * Mail (mail) * Nokogiri (nokogiri) * UUIDTools (uuidtools) * EXIF Reader (exif) == INSTALL * sudo gem install mms2r == SOURCE git clone git://github.com/monde/mms2r.git == AUTHORS Copyright (c) 2007-2012 by Mike Mondragon blog[http://plasti.cx/] MMS2R's {Flickr page}(http://www.flickr.com/photos/8627919@N05/] == CONTRIBUTORS * Luke Francl - blog[http://railspikes.com/] * Will Jessup - blog[http://www.willjessup.com/] * Shane Vitarana - blog[http://www.shanesbrain.net/] * Layton Wedgeworth - company[http://www.beenup2.com/] * Jason Haruska - blog[http://software.haruska.com/] * Dave Myron - company[http://contentfree.com/] * Vijay Yellapragada * Jesse Dp - {github profile}[http://github.com/jessedp] * David Alm * Jeremy Wilkins * Matt Conway - {github profile}[http://github.com/wr0ngway] * Kai Kai * Michael DelGaudio * Sai Emrys - blog[http://saizai.com] * Brendan Lim - {github profile}[http://github.com/brendanlim] * Scott Taylor - {github profile}[http://github.com/smtlaissezfaire] * Jaap van der Meer - {github profile}[http://github.com/japetheape] * Karl Baum - {github profile}[http://github.com/kbaum] * James McGrath - blog[http://jamespmcgrath.com]
monde/mms2r
d69d817ecef9fbd0840ee5d9e55a601f55b50be3
more fixes to formatting.
diff --git a/README.rdoc b/README.rdoc index 853d698..2bf8c09 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,222 +1,222 @@ = mms2r https://github.com/monde/mms2r == DESCRIPTION MMS2R by Mike Mondragon https://github.com/monde/mms2r https://rubygems.org/gems/mms2r http://peepcode.com/products/mms2r-pdf MMS2R is a library that decodes the parts of an MMS message to disk while stripping out advertising injected by the mobile carriers. MMS messages are multipart email and the carriers often inject branding into these messages. Use MMS2R if you want to get at the real user generated content from a MMS without having to deal with the cruft from the carriers. If MMS2R is not aware of a particular carrier no extra processing is done to the MMS other than decoding and consolidating its media. MMS2R can be used to process any multipart email to conveniently access the parts the mail is comprised of. Contact the author to add additional carriers to be processed by the library. Suggestions and patches appreciated and welcomed! === Corpus of carriers currently processed by MMS2R: * 1nbox/Idea: 1nbox.net * 3 Ireland: mms.3ireland.ie * Alltel: mms.alltel.com * AT&T/Cingular/Legacy: mms.att.net, mm.att.net, txt.att.net, mmode.com, mms.mycingular.com, cingularme.com, mobile.mycingular.com pics.cingularme.com * Bell Canada: txt.bell.ca * Bell South / Suncom / SBC Global: bellsouth.net, sbcglobal.net * Cricket Wireless: mms.mycricket.com * Dobson/Cellular One: mms.dobson.net * Helio: mms.myhelio.com * Hutchison 3G UK Ltd: mms.three.co.uk * INDOSAT M2: mobile.indosat.net.id * LUXGSM S.A.: mms.luxgsm.lu * Maroc Telecom / mms.mobileiam.ma * MTM South Africa: mms.mtn.co.za * NetCom (Norway): mms.netcom.no * Nextel: messaging.nextel.com * O2 Germany: mms.o2online.de * O2 UK: mediamessaging.o2.co.uk * Orange & Regional Oranges: orangemms.net, mmsemail.orange.pl, orange.fr * PLSPICTURES.COM mms hosting: waw.plspictures.com * PXT New Zealand: pxt.vodafone.net.nz * Rogers of Canada: rci.rogers.com * SaskTel: sasktel.com, sms.sasktel.com, cdma.sasktel.com * Sprint: pm.sprint.com, messaging.sprintpcs.com, sprintpcs.com * T-Mobile: tmomail.net, mmsreply.t-mobile.co.uk, tmo.blackberry.net * TELUS Corporation (Canada): mms.telusmobility.com, msg.telus.com * U.S. Cellular: mms.uscc.net * UAE MMS: mms.ae * Unicel: unicel.com, info2go.com (note: mobile number is tucked away in a text/plain part for unicel.com) * Verizon: vzwpix.com, vtext.com, labwig.net * Virgin Mobile: vmpix.com, pixmbl.com, vmobl.com, yrmobl.com * Virgin Mobile of Canada: vmobile.ca * Vodacom: mms.vodacom4me.co.za === Corpus of smart phones known to MMS2R: * Apple iPhone variants * Blackberry / Research In Motion variants * Casio variants * Droid variants * Google / Nexus One variants * HTC variants (T-Mobile Dash, Sprint HERO) * LG Electronics variants * Motorola variants * Pantech variants * Qualcom variants * Samsung variants * Sprint variants * UTStarCom variants As Seen On The Internets - sites known to be using MMS2R in some fashion -* (twitpic.com)[http://www.twitpic.com/] +* twitpic.com[http://www.twitpic.com/] * Simplton[http://simplton.com/] -* (fanchatter.com)[http://www.fanchatter.com/] -* (camura.com)[http://www.camura.com/] -* (eachday.com)[http://www.eachday.com/] -* (beenup2.com)[http://www.beenup2.com/] -* (snapmylife.com)[http://www.snapmylife.com/] +* fanchatter.com[http://www.fanchatter.com/] +* camura.com[http://www.camura.com/] +* eachday.com[http://www.eachday.com/] +* beenup2.com[http://www.beenup2.com/] +* snapmylife.com[http://www.snapmylife.com/] * email the author to be listed here == FEATURES * #default_media and #default_text methods return a File that can be used in attachment_fu or Paperclip * #process supports blocks for enumerating over the content of the MMS * #process can be made lazy when :process => :lazy is passed to new * logging is enabled when :logger => your_logger is passed to new * an mms instance acts like a Mail object, any methods not defined on the instance are delegated to it's underlying Mail object * #device_type? returns a symbol representing a device or smartphone type Known smartphones thus far: iPhone, BlackBerry, T-Mobile Dash, Droid, Samsung == BOOKS MMS2R, Making email useful http://peepcode.com/products/mms2r-pdf == SYNOPSIS begin require 'mms2r' rescue LoadError require 'rubygems' require 'mms2r' end # required for the example require 'fileutils' mail = MMS2R::Media.new(Mail.read('some_saved_mail.file')) puts "mail has default carrier subject" if mail.subject.empty? # access the sender's phone number puts "mail was from phone #{mail.number}" # most mail are either image or video, default_media will return the largest # (non-advertising) video or image found file = mail.default_media puts "mail had a media: #{file.inspect}" unless file.nil? # finds the largest (non-advertising) text found file = mail.default_text puts "mail had some text: #{file.inspect}" unless file.nil? # mail.media is a hash that is indexed by mime-type. # The mime-type key returns an array of filepaths # to media that were extract from the mail and # are of that type mail.media['image/jpeg'].each {|f| puts "#{f}"} mail.media['text/plain'].each {|f| puts "#{f}"} # print the text (assumes mail had text) text = IO.readlines(mail.media['text/plain'].first).join puts text # save the image (assumes mail had a jpeg) FileUtils.cp mail.media['image/jpeg'].first, '/some/where/useful', :verbose => true puts "does the mail have quicktime video? #{!mail.media['video/quicktime'].nil?}" puts "plus run anything that Mail provides, e.g. #{mail.to.inspect}" # check if the mail is from a mobile phone puts "mail is from a mobile phone #{mail.is_mobile?}" # determine the device type of the phone puts "mail is from a mobile phone of type #{mail.device_type?}" # inspect default media's exif data if exifr gem is installed and default # media is a jpeg or tiff puts "mail's default media's exif data is:" puts mail.exif.inspect # Block support, process and receive all media types of video. mail.process do |media_type, files| # assumes a Clip model that is an AttachmentFu Clip.create(:uploaded_data => files.first, :title => "From phone") if media_type =~ /video/ end # Another AttachmentFu example, Picture model is an AttachmentFu picture = Picture.new picture.title = mail.subject picture.uploaded_data = mail.default_media picture.save! #remove all the media that was put to temporary disk mail.purge == REQUIREMENTS * Mail (mail) * Nokogiri (nokogiri) * UUIDTools (uuidtools) * EXIF Reader (exif) == INSTALL * sudo gem install mms2r == SOURCE git clone git://github.com/monde/mms2r.git == AUTHORS Copyright (c) 2007-2012 by Mike Mondragon blog[http://plasti.cx/] -MMS2R's [Flickr page](http://www.flickr.com/photos/8627919@N05/] +MMS2R's {Flickr page}(http://www.flickr.com/photos/8627919@N05/] == CONTRIBUTORS -* Luke Francl blog[http://railspikes.com/] -* Will Jessup blog[http://www.willjessup.com/] -* Shane Vitarana blog[http://www.shanesbrain.net/] -* Layton Wedgeworth company[http://www.beenup2.com/] -* Jason Haruska blog[http://software.haruska.com/] -* Dave Myron company[http://contentfree.com/] +* Luke Francl - blog[http://railspikes.com/] +* Will Jessup - blog[http://www.willjessup.com/] +* Shane Vitarana - blog[http://www.shanesbrain.net/] +* Layton Wedgeworth - company[http://www.beenup2.com/] +* Jason Haruska - blog[http://software.haruska.com/] +* Dave Myron - company[http://contentfree.com/] * Vijay Yellapragada -* Jesse Dp (github profile)[http://github.com/jessedp] +* Jesse Dp - {github profile}[http://github.com/jessedp] * David Alm * Jeremy Wilkins -* Matt Conway (github profile)[http://github.com/wr0ngway] +* Matt Conway - {github profile}[http://github.com/wr0ngway] * Kai Kai * Michael DelGaudio -* Sai Emrys blog[http://saizai.com] -* Brendan Lim (github profile)[http://github.com/brendanlim] -* Scott Taylor (github profile)[http://github.com/smtlaissezfaire] -* Jaap van der Meer (github profile)[http://github.com/japetheape] -* Karl Baum (github profile)[http://github.com/kbaum] -* James McGrath blog[http://jamespmcgrath.com] +* Sai Emrys - blog[http://saizai.com] +* Brendan Lim - {github profile}[http://github.com/brendanlim] +* Scott Taylor - {github profile}[http://github.com/smtlaissezfaire] +* Jaap van der Meer - {github profile}[http://github.com/japetheape] +* Karl Baum - {github profile}[http://github.com/kbaum] +* James McGrath - blog[http://jamespmcgrath.com]
monde/mms2r
3678d7ba59e49fac7147427da03f1585a923c03f
fixed formatting of readme links to be consistent with RDoc markup.
diff --git a/README.rdoc b/README.rdoc index e0aa123..853d698 100644 --- a/README.rdoc +++ b/README.rdoc @@ -1,222 +1,222 @@ = mms2r https://github.com/monde/mms2r == DESCRIPTION MMS2R by Mike Mondragon https://github.com/monde/mms2r https://rubygems.org/gems/mms2r http://peepcode.com/products/mms2r-pdf MMS2R is a library that decodes the parts of an MMS message to disk while stripping out advertising injected by the mobile carriers. MMS messages are multipart email and the carriers often inject branding into these messages. Use MMS2R if you want to get at the real user generated content from a MMS without having to deal with the cruft from the carriers. If MMS2R is not aware of a particular carrier no extra processing is done to the MMS other than decoding and consolidating its media. MMS2R can be used to process any multipart email to conveniently access the parts the mail is comprised of. Contact the author to add additional carriers to be processed by the library. Suggestions and patches appreciated and welcomed! -Corpus of carriers currently processed by MMS2R: +=== Corpus of carriers currently processed by MMS2R: * 1nbox/Idea: 1nbox.net * 3 Ireland: mms.3ireland.ie * Alltel: mms.alltel.com * AT&T/Cingular/Legacy: mms.att.net, mm.att.net, txt.att.net, mmode.com, mms.mycingular.com, cingularme.com, mobile.mycingular.com pics.cingularme.com * Bell Canada: txt.bell.ca * Bell South / Suncom / SBC Global: bellsouth.net, sbcglobal.net * Cricket Wireless: mms.mycricket.com * Dobson/Cellular One: mms.dobson.net * Helio: mms.myhelio.com * Hutchison 3G UK Ltd: mms.three.co.uk * INDOSAT M2: mobile.indosat.net.id * LUXGSM S.A.: mms.luxgsm.lu * Maroc Telecom / mms.mobileiam.ma * MTM South Africa: mms.mtn.co.za * NetCom (Norway): mms.netcom.no * Nextel: messaging.nextel.com * O2 Germany: mms.o2online.de * O2 UK: mediamessaging.o2.co.uk * Orange & Regional Oranges: orangemms.net, mmsemail.orange.pl, orange.fr * PLSPICTURES.COM mms hosting: waw.plspictures.com * PXT New Zealand: pxt.vodafone.net.nz * Rogers of Canada: rci.rogers.com * SaskTel: sasktel.com, sms.sasktel.com, cdma.sasktel.com * Sprint: pm.sprint.com, messaging.sprintpcs.com, sprintpcs.com * T-Mobile: tmomail.net, mmsreply.t-mobile.co.uk, tmo.blackberry.net * TELUS Corporation (Canada): mms.telusmobility.com, msg.telus.com * U.S. Cellular: mms.uscc.net * UAE MMS: mms.ae * Unicel: unicel.com, info2go.com (note: mobile number is tucked away in a text/plain part for unicel.com) * Verizon: vzwpix.com, vtext.com, labwig.net * Virgin Mobile: vmpix.com, pixmbl.com, vmobl.com, yrmobl.com * Virgin Mobile of Canada: vmobile.ca * Vodacom: mms.vodacom4me.co.za -Corpus of smart phones known to MMS2R: +=== Corpus of smart phones known to MMS2R: * Apple iPhone variants * Blackberry / Research In Motion variants * Casio variants * Droid variants * Google / Nexus One variants * HTC variants (T-Mobile Dash, Sprint HERO) * LG Electronics variants * Motorola variants * Pantech variants * Qualcom variants * Samsung variants * Sprint variants * UTStarCom variants As Seen On The Internets - sites known to be using MMS2R in some fashion -* [twitpic.com](http://www.twitpic.com/) -* [Simplton](http://simplton.com/) -* [fanchatter.com](http://www.fanchatter.com/) -* [camura.com](http://www.camura.com/) -* [eachday.com](http://www.eachday.com/) -* [beenup2.com](http://www.beenup2.com/) -* [snapmylife.com](http://www.snapmylife.com/) +* (twitpic.com)[http://www.twitpic.com/] +* Simplton[http://simplton.com/] +* (fanchatter.com)[http://www.fanchatter.com/] +* (camura.com)[http://www.camura.com/] +* (eachday.com)[http://www.eachday.com/] +* (beenup2.com)[http://www.beenup2.com/] +* (snapmylife.com)[http://www.snapmylife.com/] * email the author to be listed here == FEATURES * #default_media and #default_text methods return a File that can be used in attachment_fu or Paperclip * #process supports blocks for enumerating over the content of the MMS * #process can be made lazy when :process => :lazy is passed to new * logging is enabled when :logger => your_logger is passed to new * an mms instance acts like a Mail object, any methods not defined on the instance are delegated to it's underlying Mail object * #device_type? returns a symbol representing a device or smartphone type Known smartphones thus far: iPhone, BlackBerry, T-Mobile Dash, Droid, Samsung == BOOKS MMS2R, Making email useful http://peepcode.com/products/mms2r-pdf == SYNOPSIS begin require 'mms2r' rescue LoadError require 'rubygems' require 'mms2r' end # required for the example require 'fileutils' mail = MMS2R::Media.new(Mail.read('some_saved_mail.file')) puts "mail has default carrier subject" if mail.subject.empty? # access the sender's phone number puts "mail was from phone #{mail.number}" # most mail are either image or video, default_media will return the largest # (non-advertising) video or image found file = mail.default_media puts "mail had a media: #{file.inspect}" unless file.nil? # finds the largest (non-advertising) text found file = mail.default_text puts "mail had some text: #{file.inspect}" unless file.nil? # mail.media is a hash that is indexed by mime-type. # The mime-type key returns an array of filepaths # to media that were extract from the mail and # are of that type mail.media['image/jpeg'].each {|f| puts "#{f}"} mail.media['text/plain'].each {|f| puts "#{f}"} # print the text (assumes mail had text) text = IO.readlines(mail.media['text/plain'].first).join puts text # save the image (assumes mail had a jpeg) FileUtils.cp mail.media['image/jpeg'].first, '/some/where/useful', :verbose => true puts "does the mail have quicktime video? #{!mail.media['video/quicktime'].nil?}" puts "plus run anything that Mail provides, e.g. #{mail.to.inspect}" # check if the mail is from a mobile phone puts "mail is from a mobile phone #{mail.is_mobile?}" # determine the device type of the phone puts "mail is from a mobile phone of type #{mail.device_type?}" # inspect default media's exif data if exifr gem is installed and default # media is a jpeg or tiff puts "mail's default media's exif data is:" puts mail.exif.inspect # Block support, process and receive all media types of video. mail.process do |media_type, files| # assumes a Clip model that is an AttachmentFu Clip.create(:uploaded_data => files.first, :title => "From phone") if media_type =~ /video/ end # Another AttachmentFu example, Picture model is an AttachmentFu picture = Picture.new picture.title = mail.subject picture.uploaded_data = mail.default_media picture.save! #remove all the media that was put to temporary disk mail.purge == REQUIREMENTS * Mail (mail) * Nokogiri (nokogiri) * UUIDTools (uuidtools) * EXIF Reader (exif) == INSTALL * sudo gem install mms2r == SOURCE git clone git://github.com/monde/mms2r.git == AUTHORS -Copyright (c) 2007-2012 by Mike Mondragon [blog](http://plasti.cx/) +Copyright (c) 2007-2012 by Mike Mondragon blog[http://plasti.cx/] -MMS2R's [Flickr page](http://www.flickr.com/photos/8627919@N05/) +MMS2R's [Flickr page](http://www.flickr.com/photos/8627919@N05/] == CONTRIBUTORS -* Luke Francl [blog](http://railspikes.com/) -* Will Jessup [blog](http://www.willjessup.com/) -* Shane Vitarana [blog](http://www.shanesbrain.net/) -* Layton Wedgeworth [company](http://www.beenup2.com/) -* Jason Haruska [blog](http://software.haruska.com/) -* Dave Myron [company](http://contentfree.com/) +* Luke Francl blog[http://railspikes.com/] +* Will Jessup blog[http://www.willjessup.com/] +* Shane Vitarana blog[http://www.shanesbrain.net/] +* Layton Wedgeworth company[http://www.beenup2.com/] +* Jason Haruska blog[http://software.haruska.com/] +* Dave Myron company[http://contentfree.com/] * Vijay Yellapragada -* Jesse Dp [github profile](http://github.com/jessedp) +* Jesse Dp (github profile)[http://github.com/jessedp] * David Alm * Jeremy Wilkins -* Matt Conway [github profile](http://github.com/wr0ngway) +* Matt Conway (github profile)[http://github.com/wr0ngway] * Kai Kai * Michael DelGaudio -* Sai Emrys [blog](http://saizai.com) -* Brendan Lim [github profile](http://github.com/brendanlim) -* Scott Taylor [github profile](http://github.com/smtlaissezfaire) -* Jaap van der Meer [github profile](http://github.com/japetheape) -* Karl Baum [github profile](http://github.com/kbaum) -* James McGrath (blog)[http://jamespmcgrath.com] +* Sai Emrys blog[http://saizai.com] +* Brendan Lim (github profile)[http://github.com/brendanlim] +* Scott Taylor (github profile)[http://github.com/smtlaissezfaire] +* Jaap van der Meer (github profile)[http://github.com/japetheape] +* Karl Baum (github profile)[http://github.com/kbaum] +* James McGrath blog[http://jamespmcgrath.com]
monde/mms2r
5990894faf41e290eaefb64daacdc87fb202b45c
fixed the formatting of the links in readme.txt
diff --git a/README.txt b/README.txt index 2e11bb9..10a89e1 100644 --- a/README.txt +++ b/README.txt @@ -1,222 +1,222 @@ = mms2r https://github.com/monde/mms2r == DESCRIPTION MMS2R by Mike Mondragon https://github.com/monde/mms2r https://rubygems.org/gems/mms2r http://peepcode.com/products/mms2r-pdf MMS2R is a library that decodes the parts of an MMS message to disk while stripping out advertising injected by the mobile carriers. MMS messages are multipart email and the carriers often inject branding into these messages. Use MMS2R if you want to get at the real user generated content from a MMS without having to deal with the cruft from the carriers. If MMS2R is not aware of a particular carrier no extra processing is done to the MMS other than decoding and consolidating its media. MMS2R can be used to process any multipart email to conveniently access the parts the mail is comprised of. Contact the author to add additional carriers to be processed by the library. Suggestions and patches appreciated and welcomed! Corpus of carriers currently processed by MMS2R: * 1nbox/Idea: 1nbox.net * 3 Ireland: mms.3ireland.ie * Alltel: mms.alltel.com * AT&T/Cingular/Legacy: mms.att.net, mm.att.net, txt.att.net, mmode.com, mms.mycingular.com, cingularme.com, mobile.mycingular.com pics.cingularme.com * Bell Canada: txt.bell.ca * Bell South / Suncom / SBC Global: bellsouth.net, sbcglobal.net * Cricket Wireless: mms.mycricket.com * Dobson/Cellular One: mms.dobson.net * Helio: mms.myhelio.com * Hutchison 3G UK Ltd: mms.three.co.uk * INDOSAT M2: mobile.indosat.net.id * LUXGSM S.A.: mms.luxgsm.lu * Maroc Telecom / mms.mobileiam.ma * MTM South Africa: mms.mtn.co.za * NetCom (Norway): mms.netcom.no * Nextel: messaging.nextel.com * O2 Germany: mms.o2online.de * O2 UK: mediamessaging.o2.co.uk * Orange & Regional Oranges: orangemms.net, mmsemail.orange.pl, orange.fr * PLSPICTURES.COM mms hosting: waw.plspictures.com * PXT New Zealand: pxt.vodafone.net.nz * Rogers of Canada: rci.rogers.com * SaskTel: sasktel.com, sms.sasktel.com, cdma.sasktel.com * Sprint: pm.sprint.com, messaging.sprintpcs.com, sprintpcs.com * T-Mobile: tmomail.net, mmsreply.t-mobile.co.uk, tmo.blackberry.net * TELUS Corporation (Canada): mms.telusmobility.com, msg.telus.com * U.S. Cellular: mms.uscc.net * UAE MMS: mms.ae * Unicel: unicel.com, info2go.com (note: mobile number is tucked away in a text/plain part for unicel.com) * Verizon: vzwpix.com, vtext.com, labwig.net * Virgin Mobile: vmpix.com, pixmbl.com, vmobl.com, yrmobl.com * Virgin Mobile of Canada: vmobile.ca * Vodacom: mms.vodacom4me.co.za Corpus of smart phones known to MMS2R: * Apple iPhone variants * Blackberry / Research In Motion variants * Casio variants * Droid variants * Google / Nexus One variants * HTC variants (T-Mobile Dash, Sprint HERO) * LG Electronics variants * Motorola variants * Pantech variants * Qualcom variants * Samsung variants * Sprint variants * UTStarCom variants As Seen On The Internets - sites known to be using MMS2R in some fashion -* twitpic.com [http://www.twitpic.com/] -* Simplton [http://simplton.com/] -* fanchatter.com [http://www.fanchatter.com/] -* camura.com [http://www.camura.com/] -* eachday.com [http://www.eachday.com/] -* beenup2.com [http://www.beenup2.com/] -* snapmylife.com [http://www.snapmylife.com/] +* [twitpic.com](http://www.twitpic.com/) +* [Simplton](http://simplton.com/) +* [fanchatter.com](http://www.fanchatter.com/) +* [camura.com](http://www.camura.com/) +* [eachday.com](http://www.eachday.com/) +* [beenup2.com](http://www.beenup2.com/) +* [snapmylife.com](http://www.snapmylife.com/) * email the author to be listed here == FEATURES * #default_media and #default_text methods return a File that can be used in attachment_fu or Paperclip * #process supports blocks for enumerating over the content of the MMS * #process can be made lazy when :process => :lazy is passed to new * logging is enabled when :logger => your_logger is passed to new * an mms instance acts like a Mail object, any methods not defined on the instance are delegated to it's underlying Mail object * #device_type? returns a symbol representing a device or smartphone type Known smartphones thus far: iPhone, BlackBerry, T-Mobile Dash, Droid, Samsung == BOOKS MMS2R, Making email useful http://peepcode.com/products/mms2r-pdf == SYNOPSIS begin require 'mms2r' rescue LoadError require 'rubygems' require 'mms2r' end # required for the example require 'fileutils' mail = MMS2R::Media.new(Mail.read('some_saved_mail.file')) puts "mail has default carrier subject" if mail.subject.empty? # access the sender's phone number puts "mail was from phone #{mail.number}" # most mail are either image or video, default_media will return the largest # (non-advertising) video or image found file = mail.default_media puts "mail had a media: #{file.inspect}" unless file.nil? # finds the largest (non-advertising) text found file = mail.default_text puts "mail had some text: #{file.inspect}" unless file.nil? # mail.media is a hash that is indexed by mime-type. # The mime-type key returns an array of filepaths # to media that were extract from the mail and # are of that type mail.media['image/jpeg'].each {|f| puts "#{f}"} mail.media['text/plain'].each {|f| puts "#{f}"} # print the text (assumes mail had text) text = IO.readlines(mail.media['text/plain'].first).join puts text # save the image (assumes mail had a jpeg) FileUtils.cp mail.media['image/jpeg'].first, '/some/where/useful', :verbose => true puts "does the mail have quicktime video? #{!mail.media['video/quicktime'].nil?}" puts "plus run anything that Mail provides, e.g. #{mail.to.inspect}" # check if the mail is from a mobile phone puts "mail is from a mobile phone #{mail.is_mobile?}" # determine the device type of the phone puts "mail is from a mobile phone of type #{mail.device_type?}" # inspect default media's exif data if exifr gem is installed and default # media is a jpeg or tiff puts "mail's default media's exif data is:" puts mail.exif.inspect # Block support, process and receive all media types of video. mail.process do |media_type, files| # assumes a Clip model that is an AttachmentFu Clip.create(:uploaded_data => files.first, :title => "From phone") if media_type =~ /video/ end # Another AttachmentFu example, Picture model is an AttachmentFu picture = Picture.new picture.title = mail.subject picture.uploaded_data = mail.default_media picture.save! #remove all the media that was put to temporary disk mail.purge == REQUIREMENTS * Mail (mail) * Nokogiri (nokogiri) * UUIDTools (uuidtools) * EXIF Reader (exif) == INSTALL * sudo gem install mms2r == SOURCE git clone git://github.com/monde/mms2r.git == AUTHORS -Copyright (c) 2007-2012 by Mike Mondragon (blog[http://plasti.cx/]) +Copyright (c) 2007-2012 by Mike Mondragon [blog](http://plasti.cx/) -MMS2R's Flickr page[http://www.flickr.com/photos/8627919@N05/] +MMS2R's [Flickr page](http://www.flickr.com/photos/8627919@N05/) == CONTRIBUTORS -* Luke Francl (blog[http://railspikes.com/]) -* Will Jessup (blog[http://www.willjessup.com/]) -* Shane Vitarana (blog[http://www.shanesbrain.net/]) -* Layton Wedgeworth (http://www.beenup2.com/) -* Jason Haruska (blog[http://software.haruska.com/]) -* Dave Myron (company[http://contentfree.com/]) +* Luke Francl [blog](http://railspikes.com/) +* Will Jessup [blog](http://www.willjessup.com/) +* Shane Vitarana [blog](http://www.shanesbrain.net/) +* Layton Wedgeworth [company](http://www.beenup2.com/) +* Jason Haruska [blog](http://software.haruska.com/) +* Dave Myron [company](http://contentfree.com/) * Vijay Yellapragada -* Jesse Dp (github profile[http://github.com/jessedp]) +* Jesse Dp [github profile](http://github.com/jessedp) * David Alm * Jeremy Wilkins -* Matt Conway (github profile[http://github.com/wr0ngway]) +* Matt Conway [github profile](http://github.com/wr0ngway) * Kai Kai * Michael DelGaudio -* Sai Emrys (blog[http://saizai.com]) -* Brendan Lim (github profile[http://github.com/brendanlim]) -* Scott Taylor (github profile[http://github.com/smtlaissezfaire]) -* Jaap van der Meer (github profile[http://github.com/japetheape]) -* Karl Baum (github profile[http://github.com/kbaum]) -* James McGrath (blog[http://jamespmcgrath.com]) +* Sai Emrys [blog](http://saizai.com) +* Brendan Lim [github profile](http://github.com/brendanlim) +* Scott Taylor [github profile](http://github.com/smtlaissezfaire) +* Jaap van der Meer [github profile](http://github.com/japetheape) +* Karl Baum [github profile](http://github.com/kbaum) +* James McGrath [blog](http://jamespmcgrath.com)
monde/mms2r
8800e3edc7c0ab313058663c40fe13692a2ec333
Added myself to contributors list to satify my vanity :-)
diff --git a/README.txt b/README.txt index 4761048..2e11bb9 100644 --- a/README.txt +++ b/README.txt @@ -1,221 +1,222 @@ = mms2r https://github.com/monde/mms2r == DESCRIPTION MMS2R by Mike Mondragon https://github.com/monde/mms2r https://rubygems.org/gems/mms2r http://peepcode.com/products/mms2r-pdf MMS2R is a library that decodes the parts of an MMS message to disk while stripping out advertising injected by the mobile carriers. MMS messages are multipart email and the carriers often inject branding into these messages. Use MMS2R if you want to get at the real user generated content from a MMS without having to deal with the cruft from the carriers. If MMS2R is not aware of a particular carrier no extra processing is done to the MMS other than decoding and consolidating its media. MMS2R can be used to process any multipart email to conveniently access the parts the mail is comprised of. Contact the author to add additional carriers to be processed by the library. Suggestions and patches appreciated and welcomed! Corpus of carriers currently processed by MMS2R: * 1nbox/Idea: 1nbox.net * 3 Ireland: mms.3ireland.ie * Alltel: mms.alltel.com * AT&T/Cingular/Legacy: mms.att.net, mm.att.net, txt.att.net, mmode.com, mms.mycingular.com, cingularme.com, mobile.mycingular.com pics.cingularme.com * Bell Canada: txt.bell.ca * Bell South / Suncom / SBC Global: bellsouth.net, sbcglobal.net * Cricket Wireless: mms.mycricket.com * Dobson/Cellular One: mms.dobson.net * Helio: mms.myhelio.com * Hutchison 3G UK Ltd: mms.three.co.uk * INDOSAT M2: mobile.indosat.net.id * LUXGSM S.A.: mms.luxgsm.lu * Maroc Telecom / mms.mobileiam.ma * MTM South Africa: mms.mtn.co.za * NetCom (Norway): mms.netcom.no * Nextel: messaging.nextel.com * O2 Germany: mms.o2online.de * O2 UK: mediamessaging.o2.co.uk * Orange & Regional Oranges: orangemms.net, mmsemail.orange.pl, orange.fr * PLSPICTURES.COM mms hosting: waw.plspictures.com * PXT New Zealand: pxt.vodafone.net.nz * Rogers of Canada: rci.rogers.com * SaskTel: sasktel.com, sms.sasktel.com, cdma.sasktel.com * Sprint: pm.sprint.com, messaging.sprintpcs.com, sprintpcs.com * T-Mobile: tmomail.net, mmsreply.t-mobile.co.uk, tmo.blackberry.net * TELUS Corporation (Canada): mms.telusmobility.com, msg.telus.com * U.S. Cellular: mms.uscc.net * UAE MMS: mms.ae * Unicel: unicel.com, info2go.com (note: mobile number is tucked away in a text/plain part for unicel.com) * Verizon: vzwpix.com, vtext.com, labwig.net * Virgin Mobile: vmpix.com, pixmbl.com, vmobl.com, yrmobl.com * Virgin Mobile of Canada: vmobile.ca * Vodacom: mms.vodacom4me.co.za Corpus of smart phones known to MMS2R: * Apple iPhone variants * Blackberry / Research In Motion variants * Casio variants * Droid variants * Google / Nexus One variants * HTC variants (T-Mobile Dash, Sprint HERO) * LG Electronics variants * Motorola variants * Pantech variants * Qualcom variants * Samsung variants * Sprint variants * UTStarCom variants As Seen On The Internets - sites known to be using MMS2R in some fashion * twitpic.com [http://www.twitpic.com/] * Simplton [http://simplton.com/] * fanchatter.com [http://www.fanchatter.com/] * camura.com [http://www.camura.com/] * eachday.com [http://www.eachday.com/] * beenup2.com [http://www.beenup2.com/] * snapmylife.com [http://www.snapmylife.com/] * email the author to be listed here == FEATURES * #default_media and #default_text methods return a File that can be used in attachment_fu or Paperclip * #process supports blocks for enumerating over the content of the MMS * #process can be made lazy when :process => :lazy is passed to new * logging is enabled when :logger => your_logger is passed to new * an mms instance acts like a Mail object, any methods not defined on the instance are delegated to it's underlying Mail object * #device_type? returns a symbol representing a device or smartphone type Known smartphones thus far: iPhone, BlackBerry, T-Mobile Dash, Droid, Samsung == BOOKS MMS2R, Making email useful http://peepcode.com/products/mms2r-pdf == SYNOPSIS begin require 'mms2r' rescue LoadError require 'rubygems' require 'mms2r' end # required for the example require 'fileutils' mail = MMS2R::Media.new(Mail.read('some_saved_mail.file')) puts "mail has default carrier subject" if mail.subject.empty? # access the sender's phone number puts "mail was from phone #{mail.number}" # most mail are either image or video, default_media will return the largest # (non-advertising) video or image found file = mail.default_media puts "mail had a media: #{file.inspect}" unless file.nil? # finds the largest (non-advertising) text found file = mail.default_text puts "mail had some text: #{file.inspect}" unless file.nil? # mail.media is a hash that is indexed by mime-type. # The mime-type key returns an array of filepaths # to media that were extract from the mail and # are of that type mail.media['image/jpeg'].each {|f| puts "#{f}"} mail.media['text/plain'].each {|f| puts "#{f}"} # print the text (assumes mail had text) text = IO.readlines(mail.media['text/plain'].first).join puts text # save the image (assumes mail had a jpeg) FileUtils.cp mail.media['image/jpeg'].first, '/some/where/useful', :verbose => true puts "does the mail have quicktime video? #{!mail.media['video/quicktime'].nil?}" puts "plus run anything that Mail provides, e.g. #{mail.to.inspect}" # check if the mail is from a mobile phone puts "mail is from a mobile phone #{mail.is_mobile?}" # determine the device type of the phone puts "mail is from a mobile phone of type #{mail.device_type?}" # inspect default media's exif data if exifr gem is installed and default # media is a jpeg or tiff puts "mail's default media's exif data is:" puts mail.exif.inspect # Block support, process and receive all media types of video. mail.process do |media_type, files| # assumes a Clip model that is an AttachmentFu Clip.create(:uploaded_data => files.first, :title => "From phone") if media_type =~ /video/ end # Another AttachmentFu example, Picture model is an AttachmentFu picture = Picture.new picture.title = mail.subject picture.uploaded_data = mail.default_media picture.save! #remove all the media that was put to temporary disk mail.purge == REQUIREMENTS * Mail (mail) * Nokogiri (nokogiri) * UUIDTools (uuidtools) * EXIF Reader (exif) == INSTALL * sudo gem install mms2r == SOURCE git clone git://github.com/monde/mms2r.git == AUTHORS Copyright (c) 2007-2012 by Mike Mondragon (blog[http://plasti.cx/]) MMS2R's Flickr page[http://www.flickr.com/photos/8627919@N05/] == CONTRIBUTORS * Luke Francl (blog[http://railspikes.com/]) * Will Jessup (blog[http://www.willjessup.com/]) * Shane Vitarana (blog[http://www.shanesbrain.net/]) * Layton Wedgeworth (http://www.beenup2.com/) * Jason Haruska (blog[http://software.haruska.com/]) * Dave Myron (company[http://contentfree.com/]) * Vijay Yellapragada * Jesse Dp (github profile[http://github.com/jessedp]) * David Alm * Jeremy Wilkins * Matt Conway (github profile[http://github.com/wr0ngway]) * Kai Kai * Michael DelGaudio * Sai Emrys (blog[http://saizai.com]) * Brendan Lim (github profile[http://github.com/brendanlim]) * Scott Taylor (github profile[http://github.com/smtlaissezfaire]) * Jaap van der Meer (github profile[http://github.com/japetheape]) * Karl Baum (github profile[http://github.com/kbaum]) +* James McGrath (blog[http://jamespmcgrath.com])
monde/mms2r
ed782e003ac405fedbf33e4aa582917da5cf20c1
Sprint is returning html &nbsp; in the json response that contains the text message that comes with some photos. This commit implements a search and replace on the returned message string to replace all POSIX spaces with regular spaces " ". Also updated the test suite to include an nbsp in the json response fixture file. NOTE: This file is encoded as ASCII-8BIT NOT UTF-8, this is necessary for the text to be effective.
diff --git a/lib/mms2r/media/sprint.rb b/lib/mms2r/media/sprint.rb index bab8f57..08cfe94 100644 --- a/lib/mms2r/media/sprint.rb +++ b/lib/mms2r/media/sprint.rb @@ -1,248 +1,249 @@ #-- # Copyright (c) 2007-2012 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ require 'net/http' require 'nokogiri' require 'cgi' require 'json' module MMS2R class Media ## # Sprint version of MMS2R::Media # # Sprint is an annoying carrier because they don't actually transmit user # generated content (like images or videos) directly in the MMS message. # Instead, they hijack the media that is sent from the cellular subscriber # and place that content on a content server. In place of the media # the recipient receives a HTML message with unsolicited Sprint # advertising and links back to their content server. The recipient has # to click through Sprint more pages to view the content. # # The default subject on these messages from the # carrier is "You have new Picture Mail!" module Sprint ## # Override process() because Sprint doesn't attach media (images, video, # etc.) to its MMS. Media such as images and videos are hosted on a # Sprint content server. MMS2R::Media::Sprint has to pick apart an # HTML attachment to find the URL to the media on Sprint's content # server and download each piece of content. Any text message part of # the MMS if it exists is embedded in the html. def process unless @was_processed log("#{self.class} processing", :info) #sprint MMS are multipart parts = @mail.parts #find the payload html doc = nil parts.each do |p| next unless p.part_type? == 'text/html' d = Nokogiri(p.body.decoded) title = d.at('title').inner_html if title =~ /You have new Picture Mail!/ doc = d @is_video = (p.body.decoded =~ /type=&quot;VIDEO&quot;&gt;/m ? true : false) end end return if doc.nil? # it was a dud @is_video ||= false # break it down sprint_phone_number(doc) sprint_process_text(doc) sprint_process_media(doc) @was_processed = true end # when process acts upon a block if block_given? media.each do |k, v| yield(k, v) end end end private ## # Digs out where Sprint hides the phone number def sprint_phone_number(doc) c = doc.search("/html/head/comment()").last t = c.content.gsub(/\s+/m," ").strip #@number returned in parent's #number @number = / name=&quot;MDN&quot;&gt;(\d+)&lt;/.match(t)[1] end ## # Pulls out the user text form the MMS and adds the text to media hash def sprint_process_text(doc) # there is at least one <pre> with MMS text if text has been included by # the user. (note) we'll have to verify that if they attach multiple texts # to the MMS then Sprint stacks it up in multiple <pre>'s. The only <pre> # tag in the document is for text from the user. # if there is no text media found in the mail body - then we go to more # extreme measures. text_found = false doc.search("/html/body//pre").each do |pre| type = 'text/plain' text = pre.inner_html.strip next if text.empty? text_found = true type, text = transform_text(type, text) type, file = sprint_write_file(type, text.strip) add_file(type, file) unless type.nil? || file.nil? end # if no text was found, there still might be a message with images # that can be seen at the end of the "View Entire Message" link if !text_found view_entire_message_link = doc.search("a").find { |link| link.inner_html == "View Entire Message"} # if we can't find the view entire message link, give up if view_entire_message_link # Sprint uses AJAX/json to serve up the content at the end of the link so this is conveluted url = view_entire_message_link.attr("href") # extract the "invite" param out of the url - this will be the id we pass to the ajax path below inviteMessageId = CGI::parse(URI::parse(url).query)["invite"].first if inviteMessageId json_url = "http://pictures.sprintpcs.com/ui-refresh/guest/getMessageContainerJSON.do%3FcomponentType%3DmediaDetail&invite=#{inviteMessageId}&externalMessageId=#{inviteMessageId}" # pull down the json from the url and parse it uri = URI.parse(json_url) connection = Net::HTTP.new(uri.host, uri.port) response = connection.get2( uri.request_uri, { "User-Agent" => MMS2R::Media::USER_AGENT } ) content = response.body # if the content has expired, sprint sends back html "content expired page # json will fail to parse begin json = JSON.parse(content) # there may be multiple "results" in the json - due to multiple images # cycle through them and extract the "description" which is the text # message the sender sent with the images json["Results"].each do |result| type = 'text/plain' - text = result["description"] ? result["description"].strip : nil + # remove any &nbsp; chars from the resulting text + text = result["description"] ? result["description"].gsub(/[[:space:]]/, " ").strip : nil next if text.empty? type, text = transform_text(type, text) type, file = sprint_write_file(type, text.strip) add_file(type, file) unless type.nil? || file.nil? end rescue JSON::ParserError => e log("#{self.class} processing error, #{$!}", :error) end end end end end ## # Fetch all the media that is referred to in the doc def sprint_process_media(doc) srcs = Array.new # collect all the images in the document, even though # they are <img> tag some might actually refer to video. # To know the link refers to vide one must look at the # content type on the http GET response. imgs = doc.search("/html/body//img") imgs.each do |i| src = i.attributes['src'] next unless src src = src.text # we don't want to double fetch content and we only # want to fetch media from the content server, you get # a clue about that as there is a RECIPIENT in the URI path # of real content next unless /mmps\/RECIPIENT\//.match(src) next if srcs.detect{|s| s.eql?(src)} srcs << src end #we've got the payload now, go fetch them cnt = 0 srcs.each do |src| begin uri = URI.parse(CGI.unescapeHTML(src)) unless @is_video query={} uri.query.split('&').each{|a| p=a.split('='); query[p[0]] = p[1]} query.delete_if{|k, v| k == 'limitsize' || k == 'squareoutput' } uri.query = query.map{|k,v| "#{k}=#{v}"}.join("&") end # sprint is a ghetto, they expect to see &amp; for video request uri.query = uri.query.gsub(/&/, "&amp;") if @is_video connection = Net::HTTP.new(uri.host, uri.port) #connection.set_debug_output $stdout response = connection.get2( uri.request_uri, { "User-Agent" => MMS2R::Media::USER_AGENT } ) content = response.body rescue StandardError => err log("#{self.class} processing error, #{$!}", :error) next end # if the Sprint content server uses response code 500 when the content is purged # the content type will text/html and the body will be the message if response.content_type == 'text/html' && response.code == "500" log("Sprint content server returned response code 500", :error) next end # setup the file path and file base = /\/RECIPIENT\/([^\/]+)\//.match(src)[1] type = response.content_type file_name = "#{base}-#{cnt}.#{self.class.default_ext(type)}" file = File.join(msg_tmp_dir(),File.basename(file_name)) # write it and add it to the media hash type, file = sprint_write_file(type, content, file) add_file(type, file) unless type.nil? || file.nil? cnt = cnt + 1 end end ## # Creates a temporary file based on the type def sprint_temp_file(type) file_name = "#{Time.now.to_f}.#{self.class.default_ext(type)}" File.join(msg_tmp_dir(),File.basename(file_name)) end ## # Writes the content to a file and returns the type, file as a tuple. def sprint_write_file(type, content, file = nil) file = sprint_temp_file(type) if file.nil? log("#{self.class} writing file #{file}", :info) # force the encoding to be utf-8 content = content.force_encoding("UTF-8") if content.respond_to?(:force_encoding) File.open(file,'w'){ |f| f.write(content) } return type, file end end end end diff --git a/test/fixtures/sprint-ajax-response-success.json b/test/fixtures/sprint-ajax-response-success.json index a080747..8feb749 100644 --- a/test/fixtures/sprint-ajax-response-success.json +++ b/test/fixtures/sprint-ajax-response-success.json @@ -1 +1 @@ -{"totalMediaItems":1,"shareType":"normal","nomediaItem":"false","isOnlyVideo":null,"creationDate":"Apr 16, 2012","from":"(513)545-5510","offset":null,"externalMessageId":"GEc4YYms2Y7KAkmhaoFL","Results":[{"elementID":"2","hasVoiceCaption":false,"URL":{"elementID":"2","indexCount":0,"audio":null,"thumb":"http:\/\/pictures.sprintpcs.com:80\/mmps\/031_36415d1a9c3c73f0_1\/2.jpg?partExt=.jpg&&&outquality=90&ext=.jpg&&size=40,40&squareoutput=255,255,255&aspectcrop=0.5,0.5,1.0,1.0,1.0","annotationVoiceID":null,"image":"http:\/\/pictures.sprintpcs.com:80\/mmps\/031_36415d1a9c3c73f0_1\/2.jpg?partExt=.jpg&&&outquality=90&ext=.jpg","video":null},"description":"Just testing the caption on Sprint","mediaItemNum":0,"isDRMProtected":false,"externalMessageId":"GEc4YYms2Y7KAkmhaoFL","mediaType":"IMAGE","restOperation":"false","folderFullName":"\/RECIPIENT"}],"invite":null,"tmemo":null,"toAddress":"[email protected]","mediaIndex":0,"subject":"New Message","isDRMProtected":false,"expirationDate":"Expires in 18 days","voiceURL":null,"guest":"true","folderFullName":"\/RECIPIENT"} \ No newline at end of file +{"totalMediaItems":2,"shareType":"normal","nomediaItem":"false","isOnlyVideo":null,"creationDate":"May 31, 2012","from":"(513)545-0000","offset":null,"externalMessageId":"XXXXXXXXXXXXXXXXXX","Results":[{"elementID":"0","hasVoiceCaption":false,"URL":{"elementID":"0","indexCount":0,"audio":null,"thumb":"\/retailers\/PCSNEXTEL\/ui-refresh\/images\/background\/slide_no_media_90x90.gif","annotationVoiceID":null,"image":"\/retailers\/PCSNEXTEL\/ui-refresh\/images\/background\/slide_no_media_90x90.gif","video":null},"description":"First text content. ","mediaItemNum":0,"isDRMProtected":false,"externalMessageId":"XXXXXXXXXXXXXXXXXX","mediaType":"TEXT","restOperation":"false","folderFullName":"\/RECIPIENT"},{"elementID":"3","hasVoiceCaption":false,"URL":{"elementID":"3","indexCount":1,"audio":"","thumb":"http:\/\/pictures.sprintpcs.com:80\/mmps\/048_0736849c3f1a9d27_1\/3.jpg?partExt=.jpg&&&outquality=90&ext=.jpg&&size=40,40&squareoutput=255,255,255&aspectcrop=0.5,0.5,1.0,1.0,1.0","annotationVoiceID":null,"image":"http:\/\/pictures.sprintpcs.com:80\/mmps\/048_0736849c3f1a9d27_1\/3.jpg?partExt=.jpg&&&outquality=90&ext=.jpg","video":""},"description":"Second text content. ","mediaItemNum":1,"isDRMProtected":false,"externalMessageId":"XXXXXXXXXXXXXXXXXX","mediaType":"IMAGE","restOperation":"false","folderFullName":"\/RECIPIENT"}],"invite":null,"tmemo":null,"toAddress":"[email protected]","mediaIndex":0,"subject":"New Message","isDRMProtected":false,"expirationDate":"Expires in 57 Days","voiceURL":null,"guest":"true","folderFullName":"\/RECIPIENT"} diff --git a/test/test_pm_sprint_com.rb b/test/test_pm_sprint_com.rb index 372ccf6..c5a6b23 100644 --- a/test/test_pm_sprint_com.rb +++ b/test/test_pm_sprint_com.rb @@ -1,317 +1,320 @@ require "test_helper" class TestPmSprintCom < Test::Unit::TestCase include MMS2R::TestHelper def mock_sprint_image(message_id) response = mock('response') body = mock('body') connection = mock('connection') response.expects(:content_type).twice.returns('image/jpeg') response.expects(:body).returns(body) response.expects(:code).never Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection connection.expects(:get2).with( # 1.9.2 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90&ext=.jpg&iconifyVideo=true&wm=1' # 1.8.7 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&outquality=90&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU' kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).once.returns(response) end def mock_sprint_purged_image(message_id) response = mock('response') body = mock('body') connection = mock('connection') response.expects(:content_type).once.returns('text/html') response.expects(:body).returns(body) response.expects(:code).once.returns('500') Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection connection.expects(:get2).with( # 1.9.2 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90&ext=.jpg&iconifyVideo=true&wm=1' # 1.8.7 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&outquality=90&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU' kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).once.returns(response) end def mock_sprint_ajax response = mock('response') body = mock('body') # this is a response from a real sprint message file = File.open("./test/fixtures/sprint-ajax-response-success.json", "rb") json = file.read body.expects(:to_str).returns json connection = mock('connection') connection.stubs(:use_ssl=).returns(true) response.expects(:body).twice.returns(body) response.expects(:code).once.returns('200') response.expects(:content_type).twice.returns('text/html') Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).twice.returns connection connection.expects(:get2).with( # 1.9.2 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90&ext=.jpg&iconifyVideo=true&wm=1' # 1.8.7 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&outquality=90&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU' kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).twice.returns(response) end def mock_sprint_ajax_purged response = mock('response') body = mock('body') # this is a response from a real sprint message file = File.open("./test/fixtures/sprint-ajax-response-failure.html", "rb") error_html = file.read body.expects(:to_str).returns error_html connection = mock('connection') connection.stubs(:use_ssl=).returns(true) response.expects(:body).twice.returns(body) response.expects(:code).once.returns('500') response.expects(:content_type).once.returns('text/html') Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).twice.returns connection connection.expects(:get2).with( # 1.9.2 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90&ext=.jpg&iconifyVideo=true&wm=1' # 1.8.7 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&outquality=90&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU' kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).twice.returns(response) end def test_mms_should_have_text mail = mail('sprint-text-01.mail') mms = MMS2R::Media.new(mail) assert_equal "2068765309", mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_equal 1, mms.media['text/plain'].size file = mms.media['text/plain'].first assert_equal true, File.exist?(file) assert_match(/\.txt$/, File.basename(file)) assert_equal "Tea Pot", IO.read(file) mms.purge end def test_mms_should_have_a_phone_number mail = mail('sprint-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier mms.purge end def test_should_have_simple_video mail = mail('sprint-video-01.mail') response = mock('response') body = mock('body') connection = mock('connection') response.expects(:content_type).twice.returns('video/quicktime') response.expects(:body).returns(body) response.expects(:code).never Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection connection.expects(:get2).with( kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).once.returns(response) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_not_nil mms.media['video/quicktime'] assert_equal 1, mms.media['video/quicktime'].size assert_equal "000_259e41e851be9b1d_1-0.mov", File.basename(mms.media['video/quicktime'][0]) mms.purge end def test_should_have_simple_image mail = mail('sprint-image-01.mail') mock_sprint_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_not_nil mms.media['image/jpeg'][0] assert_match(/001_2066c7013e7ca833_1-0.jpg$/, mms.media['image/jpeg'][0]) mms.purge end def test_collect_image_using_block mail = mail('sprint-image-01.mail') mock_sprint_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size file_array = nil mms.process do |k, v| file_array = v if (k == 'image/jpeg') assert_equal 1, file_array.size file = file_array.first assert_not_nil file = file_array.first assert_equal "001_2066c7013e7ca833_1-0.jpg", File.basename(file) end mms.purge end def test_process_internals_should_only_be_executed_once mail = mail('sprint-image-01.mail') mock_sprint_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size # second time through shouldn't go into the was_processed block mms.mail.expects(:parts).never mms.process{|k, v| } mms.purge end def test_should_have_two_images mail = mail('sprint-two-images-01.mail') response = mock('response') body = mock('body') connection = mock('connection') response.expects(:content_type).times(4).returns('image/jpeg') response.expects(:body).twice.returns(body) response.expects(:code).never Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).twice.returns connection connection.expects(:get2).with( kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).twice.returns(response) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_equal 2, mms.media['image/jpeg'].size assert_not_nil mms.media['image/jpeg'][0] assert_not_nil mms.media['image/jpeg'][1] assert_match(/001_104058d23d79fb6a_1-0.jpg$/, mms.media['image/jpeg'][0]) assert_match(/001_104058d23d79fb6a_1-1.jpg$/, mms.media['image/jpeg'][1]) mms.purge end def test_image_should_be_missing # this test is questionable mail = mail('sprint-broken-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 0, mms.media.size mms.purge end def test_message_is_missing_in_mail # this test is questionable mail = mail('sprint-image-missing-message.mail') mock_sprint_ajax mms = MMS2R::Media.new(mail) - assert_equal 1, mms.media['text/plain'].size - + assert_equal 2, mms.media['text/plain'].size + # test that the message was extracted from the ajax response message = IO.readlines(mms.media['text/plain'].first).join("") - assert_equal "Just testing the caption on Sprint", message - + assert_equal "First text content.", message + + # test that the &nbsp; was removed () + assert message.last.bytes.to_a != [194, 160] + mms.purge end def test_message_is_missing_in_mail_purged_from_content_server # this test is questionable mail = mail('sprint-image-missing-message.mail') mock_sprint_ajax_purged mms = MMS2R::Media.new(mail) assert_equal '5135455555', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 0, mms.media.size mms.purge end def test_image_should_be_purged_from_content_server mail = mail('sprint-image-01.mail') mock_sprint_purged_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 0, mms.media.size mms.purge end def test_body_should_return_empty_when_there_is_no_user_text mail = mail('sprint-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal "", mms.body end def test_sprint_write_file mail = mock(:message_id => 'a') mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') mms = MMS2R::Media.new(mail, :process => :lazy) type = 'text/plain' content = 'foo' file = Tempfile.new('sprint') file.close type, file = mms.send(:sprint_write_file, type, content, file.path) assert_equal 'text/plain', type assert_equal content, IO.read(file) end def test_subject mail = mail('sprint-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal "", mms.subject end def test_new_subject mail = mail('sprint-new-image-01.mail') mock_sprint_ajax mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal "", mms.subject end end
monde/mms2r
f895ff17a5bc03a0bd140fafccc202e949fa9b30
rake build -> Built 3.7.0
diff --git a/Gemfile.lock b/Gemfile.lock index 855713e..7b9c3fe 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,48 +1,48 @@ PATH remote: . specs: - mms2r (3.6.5) + mms2r (3.7.0) exifr (>= 1.0.3) json (>= 1.6.0) mail (>= 2.4.0) nokogiri (>= 1.5.0) rake (= 0.9.2.2) GEM remote: https://rubygems.org/ specs: exifr (1.1.2) i18n (0.6.0) json (1.7.3) mail (2.4.4) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) metaclass (0.0.1) mime-types (1.18) mocha (0.11.4) metaclass (~> 0.0.1) multi_json (1.3.5) nokogiri (1.5.2) polyglot (0.3.3) rake (0.9.2.2) rdoc (3.12) json (~> 1.4) simplecov (0.6.4) multi_json (~> 1.0) simplecov-html (~> 0.5.3) simplecov-html (0.5.3) test-unit (2.4.8) treetop (1.4.10) polyglot polyglot (>= 0.3.1) PLATFORMS ruby DEPENDENCIES mms2r! mocha rdoc simplecov test-unit
monde/mms2r
e50c334c429e4571d3ddc3a8a5c67c2186ae86f2
Improvements bumped for a 3.7.0 release.
diff --git a/History.txt b/History.txt index 3f8ba80..11810bb 100644 --- a/History.txt +++ b/History.txt @@ -1,423 +1,434 @@ -### 3.6.3 / 2012-03.25 (Dethklok Minute Host - host of The Dethklok Minute) +### 3.7.0 / 2012-05-31 (The Teenager - Edgar's brother via Eric's face) + +* 2 major enhancements + * Improve processing of Sprint media - James McGrath + * Remove Hoe and gemcutter dependencies + +### 3.6.4 / 2012-04-22 (Molly - Pickles' mother) + +* 1 minor enhancement + * strip a variation of the iphone default footer + +### 3.6.3 / 2012-03-25 (Dethklok Minute Host - host of The Dethklok Minute) * 1 minor enhancement * strip Windows phone default footer ### 3.6.2 / 2012-02-12 (Mr. Gojira - Owner Mr. Gojira's Driving School - retake driver's exam) * 1 minor enhancement * Change user agent given to Sprint so it returns a properly sized image. ### 3.6.1 / 2012-02-11 (Mr. Gojira - Owner Mr. Gojira's Driving School) * 1 minor enhancement * use Net::HTTP#get2 to fetch Sprint content ### 3.6.0 / 2012-01-19 (Agent 216 - assassin, master of infiltration and sabotage) * 1 major enhancement * Ruby 1.8.7, 1.9.2, and 1.9.3 compatible * 1 bug fix * A fix for the utf-8 encoding issue with ruby 1.9.2 - minimul / Christian ### 3.5.1 / 2011-12-11 (Mashed Potato Johnson - oldest living blues guitarist in the world) * 1 bug fix * A fix for the utf-8 encoding issue with ruby 1.9.2 - James McGrath ### 3.5.0 / 2011-12-01 (Dr. Milminiman Lamilim Swimwambli - Marriage expert) * 1 major bug fix * In Ruby 1.9.X MMS2R::Media::Sprint was not fetching content from Sprint's CDN correctly because the implementation of Net::HTTP in 1.9.X passes a User-Agent header of "Ruby" to which Sprint responds with a fake 500 - with help from James McGrath ### 3.4.1 / 2011-11-06 (Fatty Ding-Dongs, Dethklok foster child) * 2 major enhancements * Additional means to detect android, iphone, motorola, nokia, palm handsets * Additional known SMS/MMS domains mm.att.net, labwig.net, cdma.sasktel.com ### 3.4.0 / 2011-10-31 (Serveta Skwigelf, Skwisgaar's hot mom) * 2 major enhancements * regexp's in yaml configs are store as a ruby regexp and not a string that is evaled. * character encoding capability with 1.8 rubies and 1.9 rubies. ### 3.3.1 / 2011-01-01 (Reverend Aslaug Wartooth (deceased), Toki's dad) * 2 minor enhancements * new method #default_html returns the default html attachment * #body will return the default plain text, or default stripped html text ### 3.3.0 / 2010-12-31 (Charles Foster Offdensen - CFO, dethklok) * 1 major enhancement * MMS2R::Media::Sprint is now a module that is extended in for processing Sprint content rather than being child class of MMS2R::Media Extension is the strategy to use for overwriting template methods now * 1 minor enhancement * process new Sprint subject - Jason Hooper * new SaskTel mms/sms domain alias sasktel.com * new Virgin Mobile mms/sms domain alias yrmobl.com ### 3.2.0 / 2010-08-17 (Antonio "Tony" DiMarco Thunderbottom - bassist) * 3 minor enhancements * updated readme with latest sites known to use mms2r * bundler assimilated * loading rubygems only if it's required, like rake ### 3.1.0 / 2010-07-09 (Dick "Magic Ears" Knubbler - music producer) * 8 minor enhancements * Detects additional Bell/AT&T domain sbcglobal.net as a handset * Detects additional Virgin mobile domains pixmbl.com vmobl.com as a handset * Expanded mobile phone detection for handset makers by : Casio, Google Nexus One, LG Electronics, Motorola, Pantech, Qualcom, Samsung, Sprint, UTStarCom * EXIF Reader (exifr) is integral to MMS2R and is now a required gem * upgrade Mail to 2.2.5 * depend on latest gems * corrected example - Jason Hooper * added As Seen On The Internet to README that lists sites known to be using MMS2R in some fashion ### 3.0.1 / 2010-03-28 (Lavona Succuboso - leader of "Succuboso Explosion") * 1 minor enhancement * support for U.S. Cellular ### 3.0.0 / 2010-02-24 (General Crozier - Chairman of the Joint Chiefs of Staff) * 1 new feature * dependence upon Mail gem rather than TMail gem ### 2.4.1 / 2010-02-07 (Vater Orlaag - political and spiritual specialist) * 3 minor enhancements * make sure filename is free of new lines - laurynas * recognize HTC HERO200 as a smart phone * recognize HTC Eris as a smart phone ### 2.4.0 / 2009-12-20 (Dr. Nanemiltred Philtendrieden - specialist on celebrity death) * 1 new feature * replace Hpricot with Nokogiri for html parsing of Sprint data * 3 minor enhancements * smartphone identities stored in conf/mms2r_media.yml * identify Motorola Droid as a smartphone * identify T-Mobile Dash as a smartphone * use uuidtools for naming temp directories - kbaum ### 2.3.0 / 2009-08-30 (Snakes 'n' Barrels Greatest Hits) * 5 new features * detect smartphone status/type based on model metadata from jpeg and tiff exif data using exifr gem, access exif data with MMS2R::Media#exif * make MMS2R Rails gem packaging friendly with an init.rb - Scott Taylor, smtlaissezfaire * delegate missing methods to mms2r's tmail object so that mms2r behaves as if it were a tmail object - Sai Emrys, saizai * default_media can return an attachment of application content type - Brendan Lim, brendanlim * MMS2R.parse(raw_mail) convenience class method that parses and returns an mms2r from a mail file - saizai * 4 minor enhancements * make examples more 'mail' specific to enforce the fact that an mms is a multipart email - saizai * update for text in vzwpix.com default carrier message * detecting smartphone (blackberries and iphones for now) is more versatile from reading mail headers * expanded filtering of carrier advertising text in mms from smartphones ### 2.2.0 / 2009-01-04 (Rikki Kixx - owner of a franchise of rehab centers) * 3 new features * MMS2R::Media#is_mobile? best guess if the sender was a mobile device * MMS2R::Media#device_type? best guess of the mobile device type. Simple heuristics thus far for :blackberry :iphone :handset :unknown could be expanded for exif probing or additinal shifting of mail header * from array in conf/from.yml to provide granularity to determine carrier domain (caused by tmo.blackberry.net) * 4 minor enhancements * support for Virgin Canada messaging service vmobile.ca * support for text service messaging.sprintpcs.com * additional BlackBerry coverage from T-Mobile tmo.blackberry.net provider * legacy support for mobile.mycingular.com, pics.cingularme.com * 3 bug fixes * iPhone default subject - jesse dp http://rubyforge.org/tracker/?func=detail&atid=11789&aid=22951&group_id=3065 * add sprintpcs.com to pm.sprint.com aliases * fix OS X long filename issues - Matt Conway ### 2.1.3 / 2008-11-06 (Dr. Ramonolith Chesterfield - Military pharmaceutical psychotropic drug manufacturing expert * 1 minor enhancement * added mms.ae support ### 2.1.2 / 2008-10-21 (Toki's mom, Anja Wartooth) * 2 minor enhancments * Sprint subject update - jesse dp * Virgin Mobile support vmpix.com ### 2.1.1 / 2008-09-24 (Lavona Succuboso, Nathan Explosion uber-groupie) * 4 minor enhancments * Bell Canada support txt.bell.ca - Matt Conway / Snap My Life - http://github.com/wr0ngway, http://github.com/sml * Unicel support unicel.com - Michael DelGaudio * info2go.com support / Unicel * TELUS Corporation support mms.telusmobility.com, msg.telus.com * add test to check that gem builds correctly as a github gem * 1 bug fix * Iconv utf8 fix - Kai Kai ### 2.1.0 / 2008-07-30 (Dr. Gibbons – Birthday expert and Murderface expert) * 1 major enhancement: * opens up TMail for improved query method patterned code in MMS2R * 2 minor enhancements: * UK O2 support mediamessaging.o2.co.uk - Jeremy Wilkins * Write non text files with binary bit set on Windows - David Alm * source hosted on github: git clone git://github.com/monde/mms2r.git ### 2.0.5 / 2008-07-17 (Dr. Ralphus Galkensmelter - Psychological death expert) * Deal with Apple Mail multipart/appledouble - jesse dp ### 2.0.4 / 2008-04-28 (Mr. Selatcia - elder member of The Tribunal) * updated mms.vodacom4me.co.za Vodacom South Africa - Vijay Yellapragada * 1nbox.net / Idea cellular 1nbox.net - Vijay Yellapragada * mms.3ireland.ie / 3 Ireland - Vijay Yellapragada * mms.alltel.com / Alltel (reverted message.alltel.com) - Vijay Yellapragada * mms.mobileiam.ma / Maroc Telecom - Vijay Yellapragada * mms.mtn.co.za / MTM South Africa - Vijay Yellapragada * rci.rogers.com / Rogers of Canada - Vijay Yellapragada * mmsreply.t-mobile.co.uk / T-Mobile UK - Vijay Yellapragada * waw.plspictures.com / PLSPICTURES.COM mms hosting service ### 2.0.3 / 2008-04-15 (Enter Taxman - The 1040 MMS Form) * fix case when part is image/jpeg declared 'application/octet-stream' * trim dangling image/jpeg text from blackberry messages * file extensions added to filenames that are missing extensions in part headers * anonymize images in fixtures to reduce gem size * T-Mobile update - jesse dp * AT&T/T-Mobile Blackberrry update - Dave Myron ### 2.0.2 / 2008-02-22 (The Jomfru Brothers - proprietors of diefordethklok.com) * added support for mms.vodacom4me.co.za Vodacom South Africa - Jason Haruska * added support for bellsouth.net - Jason Haruska * added support for mms.mycricket.com * Improved Blackberry and iPhone suport - Jason Haruska * added :number key to configuration to provide rules for specifying alternative phone number location * return sender's phone number for mobile.indosat.net.id * return sender's phone number for mms.luxgsm.lu * return sender's phone number for mms.vodacom4me.co.za ### 2.0.1 / 2008-02-08 (Professor Jerry Gustav Munndig - Child control expert) * strip out common blackberry and iPhone signatures * handle carriers that use external mail services such as Yahoo! as the From address * Add support for mobile.indosat.net.id (and yahoo.co.id) - Jason Haruska * Add support for sms.sasktel.com - Jason Haruska ### 2.0.0 / 2008-01-23 (Skwisgaar Skwigelf - fastest guitarist alive) * added support for pxt.vodafone.net.nz PXT New Zealand * added support for mms.o2online.de O2 Germany * added support for orangemms.net Orange UK * added support for txt.att.net AT&T * added support for mms.luxgsm.lu LUXGSM S.A. * added support for mms.netcom.no NetCom (Norway) * added support for mms.three.co.uk Hutchison 3G UK Ltd * removed deprecated #get_number use #number * removed deprecated #get_subject use #subject * removed deprecated #get_body use #body * removed deprecated #get_media use #default_media * removed deprecated #get_text use #default_text * removed deprecated #get_attachment use #attachment * fixed error when Sprint content server responds 500 * better yaml configs * moved TMail dependency from Rails ActionMailer SVN to 'official' Gem * ::new greedily processes MMS unless otherwise specified as an initialize option :process => :lazy * logger moved to initialize option :logger => some_logger * testing using mocks and stubs instead of duck raped Net::HTTP * fixed typo in name of method #attachement to #attachment * fixed broken downloading of Sprint videos ### 1.1.12 / 2007-10-21 (Dr. Ronald von Moldenberg - Endorsement specialist) * fetch original images from Sprint content server (Layton Wedgeworth) * ignore Sprint messages when requested content has been purged from their content server ### 1.1.11 / 2007-10-20 (Dr. Armand Skagerakk Frederickshaven - Mythology expert) * minor fix for attachment_fu where it might call #path on the cgi temp file that is returned by get_attachment * renamed a_t_t_media.rb to att_media.rb to make it autotest happy * masthead.jpg misplaced in mms2r_t_mobile_media_ignore.yml (Layton Wedgeworth) * overridden SprintMedia#process failed to accept block (Layton Wedgeworth) * added method_deprecated to help mark methods that are going to be deprecated in preparation of 1.2.x release * #get_number marked deprecated, use #number instead * #get_subject marked deprecated, use #subject instead * #get_body marked deprecated, use #body instead * #get_text marked deprecated, use #default_text instead * #get_attachment marked deprecated, use #attachment instead * #get_media marked deprecated, use #default_media instead ### 1.1.10 / 2007-09-30 (Face Bones) * fixed a case for a nil match on From in the create method (Luke Francl) * added support for Alltel message.alltel.com (Ben Wood) ### 1.1.9 / 2007-09-08 (Rebecca Nightrod - controlling girlfriend of Nathan Explosion) * fixed broken support for act_as_attachment and attachment_fu ### 1.1.8 / 2007-09-08 (James Grishnack - Head of Behemoth Productions, producer of Blood Ocean) * Added support for Orange of France, Orange orange.fr (Julian Biard) * purge in the process block removed, purge must be called explicitly after processing to clean up extracted temporary media files. ### 1.1.7 / 2007-08-25 (Adam Nergal, friend of Skwisgaar, but not Pickles) * Added support for Orange of Poland, Orange mmsemail.orange.pl (Zbigniew Sobiecki) * Cleaned up documentation modifiers * Cleaned out non-Ruby code idioms ### 1.1.6 / 2007-08-11 (Mustakrakish, the Lake Troll part 2) * Redo of release mistake of 1.1.5 ### 1.1.5 / 2007-08-11 (Mustakrakish, the Lake Troll) * AT&T => mms.att.net not clearing out default "multimedia message" subject to nil (Will Jessup) * Ignore case on default subject for all carriers in corresponding conf/mms2r_XXX_media_subject.yml ### 1.1.4 / 2007-08-07 (Dr. Rockso) * AT&T => mms.att.net support (thanks Mike Chen and Dave Myron) * get_body returns nil when there is not user text (sorry Will!) ### 1.1.3 / 2007-07-10 (Charles Foster Ofdensen) * Helio support by Will Jessup * get_subject returns nil on default carrier subjects ### 1.1.2 / 2007-06-13 (Dethklok roadie #2) * placed versioned hpricot dependency in Hoe's extra_deps (an attempt to appease firebrigade gods or not cause Gem::RemoteInstallationCancelled whichever you prefer) ### 1.1.1 / 2007-06-11 (Dethklok roadie) * rescue rcov non-dependency in Rakefile to make firebrigade happy ### 1.1.0 / 2007-06-08 (Toki Wartooth) * get_body to return body text (Luke Francl) * get_subject returns "" for default subjects now * default subjects listed in yaml by carrier in conf directory * added granularity to Cingular, Sprint, and Verizon carrier services (Will Jessup) * refactored Sprint instance to process all media (Will Jessup + Mike) * optimized text transformations (Will Jessup) * properly handle ISO-8859-1 and UTF-8 text (Will Jessup) * autotest powers activate! (ZenTest autotest discovery enabled) * configuration file ignores, transforms, and subjects all store Regexp's * Put vendor Text::Format & TMail::Mail as an external subversion dependency to the 1.2 stable branch of Rails ActionMailer * added get_number method to return the phone number associated with this MMS * get_media and get_text attachment_fu helper return the largest piece of media of that type if the more than one exits in the media (Luke Francl) * added block support to process() method (Shane Vitarana) ### 1.0.7 / 2007-04-27 (Senator Stampingston) * patch submitted by Luke Francl * added a get_subject method that returns nil when any MMS has a default carrier subject * get_subject returns nil for '', 'Multimedia message', '(no subject)', 'You have new Picture Mail!' ### 1.0.6 / 2007-04-24 (Pickles the Drummer) * patch submitted by Luke Francl * added support for mms.dobson.net (Dobson aka Cellular One) (Luke) * DRY'd up unit tests (Luke) * added get_media instance method that returns first video or image as File (Luke) * File from get_media can be used by/with attachment_fu (Luke) * added get_text instance method that returns first non advertising text * File from get_text can be used by/with attachment_fu ### 1.0.5 / 2007-04-10 (William Murderface) * patch submitted by Luke Francl * made ignore_media? start its text check from the start of the file (Luke) * added new text transform for Verizon messages (Luke) * updated Nextel ignore conf (Luke) * added additional samples and tests for T-Mobile & Verizon (Luke) * cleaned up MMS2R::Media documentation * added Sprint broken image test for when media goes stale on their content server * fixed teardown typo in lots of plases * added tests for 4 three samples of unique variants of Sprint/Nextel text * 100% test coverage! ### 1.0.4 / 2007-04-09 (Metalocalypse) * fix teardown in test_mms2r_sprint.rb (shanesbrain.net) * clean up Net::HTTP in MMS2R::SprintMedia (shanesbrain.net) * added accessor MMS2R::Media.media_dir * fixed a nil issue with underlying tmp working dir * added exception handling around Net::HTTP in MMS2R::SprintMedia ### 1.0.3 / 2007-04-05 (Paper Cut) * Cleaned up packaging and errors in example found by Shane V. http://shanesbrain.net/ ### 1.0.2 / 2007-03-07 * Reorganized tests and fixtures * Added carriers: * Cingular => cingularme.com * Nextel => messaging.nextel.com * Verizon => vtext.com ### 1.0.1 / 2007-03-07 * Flubbed RubyForge release ... do not use this. ### 1.0.0 / 2007-03-06 * Birthday! * AT&T/Cingular => mmode.com * Cingular => mms.mycingular.com * Sprint => pm.sprint.com * Sprint => messaging.sprintpcs.com * T-Mobile => tmomail.net * Verizon => vzwpix.com diff --git a/lib/mms2r/version.rb b/lib/mms2r/version.rb index 2762189..ad58e7e 100644 --- a/lib/mms2r/version.rb +++ b/lib/mms2r/version.rb @@ -1,25 +1,25 @@ module MMS2R class Version def self.major 3 end def self.minor - 6 + 7 end def self.patch - 5 + 0 end def self.pre nil end def self.to_s [major, minor, patch, pre].compact.join('.') end end end
monde/mms2r
cba403fcafca3b09800b6caa73db590fbb5cee28
Remove Hoe and Gemcutter deps, build gem solely with bundler, updating gems.
diff --git a/Gemfile b/Gemfile index 8941e45..fa75df1 100644 --- a/Gemfile +++ b/Gemfile @@ -1,21 +1,3 @@ -# -*- ruby -*- +source 'https://rubygems.org' -source :rubygems - -gem "nokogiri" -gem "mail" -gem "exifr" -gem "json" -# gem "psych" - -group :development, :test do - gem "rdoc" - gem "rubyforge" - gem "gemcutter" - gem "hoe" - gem "rcov" - gem "test-unit", "=1.2.3" - gem "mocha" -end - -# vim: syntax=ruby +gemspec diff --git a/Gemfile.lock b/Gemfile.lock index 074dd18..855713e 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,47 +1,48 @@ +PATH + remote: . + specs: + mms2r (3.6.5) + exifr (>= 1.0.3) + json (>= 1.6.0) + mail (>= 2.4.0) + nokogiri (>= 1.5.0) + rake (= 0.9.2.2) + GEM - remote: http://rubygems.org/ + remote: https://rubygems.org/ specs: - exifr (1.1.1) - gemcutter (0.7.1) - hoe (2.12.5) - rake (~> 0.8) + exifr (1.1.2) i18n (0.6.0) - json (1.6.5) - json_pure (1.6.5) - mail (2.4.0) + json (1.7.3) + mail (2.4.4) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) metaclass (0.0.1) - mime-types (1.17.2) - mocha (0.10.2) + mime-types (1.18) + mocha (0.11.4) metaclass (~> 0.0.1) - nokogiri (1.5.0) + multi_json (1.3.5) + nokogiri (1.5.2) polyglot (0.3.3) rake (0.9.2.2) - rcov (0.9.11) rdoc (3.12) json (~> 1.4) - rubyforge (2.0.4) - json_pure (>= 1.1.7) - test-unit (1.2.3) - hoe (>= 1.5.1) + simplecov (0.6.4) + multi_json (~> 1.0) + simplecov-html (~> 0.5.3) + simplecov-html (0.5.3) + test-unit (2.4.8) treetop (1.4.10) polyglot polyglot (>= 0.3.1) PLATFORMS ruby DEPENDENCIES - exifr - gemcutter - hoe - json - mail + mms2r! mocha - nokogiri - rcov rdoc - rubyforge - test-unit (= 1.2.3) + simplecov + test-unit diff --git a/Manifest.txt b/Manifest.txt index ef08e0f..472055b 100644 --- a/Manifest.txt +++ b/Manifest.txt @@ -1,186 +1,187 @@ .gitignore Gemfile Gemfile.lock History.txt Manifest.txt README.TMail.txt README.txt Rakefile conf/1nbox.net.yml conf/aliases.yml conf/bellsouth.net.yml conf/from.yml conf/mediamessaging.o2.co.uk.yml conf/messaging.nextel.com.yml conf/mms.3ireland.ie.yml conf/mms.ae.yml conf/mms.alltel.com.yml conf/mms.att.net.yml conf/mms.dobson.net.yml conf/mms.luxgsm.lu.yml conf/mms.mobileiam.ma.yml conf/mms.mtn.co.za.yml conf/mms.mycricket.com.yml conf/mms.myhelio.com.yml conf/mms.netcom.no.yml conf/mms.o2online.de.yml conf/mms.three.co.uk.yml conf/mms.uscc.net.yml conf/mms.vodacom4me.co.za.yml conf/mms2r_media.yml conf/mobile.indosat.net.id.yml conf/msg.telus.com.yml conf/orangemms.net.yml conf/pm.sprint.com.yml conf/pxt.vodafone.net.nz.yml conf/rci.rogers.com.yml conf/sms.sasktel.com.yml conf/tmomail.net.yml conf/txt.bell.ca.yml conf/unicel.com.yml conf/vmpix.com.yml conf/vzwpix.com.yml conf/waw.plspictures.com.yml dev_tools/anonymizer.rb dev_tools/debug_sprint_nokogiri_parsing.rb init.rb lib/ext/mail.rb lib/ext/object.rb lib/mms2r.rb lib/mms2r/media.rb +lib/mms2r/version.rb lib/mms2r/media/sprint.rb mms2r.gemspec test/fixtures/1nbox-2images-01.mail test/fixtures/1nbox-2images-02.mail test/fixtures/1nbox-2images-03.mail test/fixtures/1nbox-2images-04.mail test/fixtures/3ireland-mms-01.mail test/fixtures/ad_new.txt test/fixtures/alltel-image-01.mail test/fixtures/alltel-mms-01.mail test/fixtures/alltel-mms-03.mail test/fixtures/apple-double-image-01.mail test/fixtures/att-blackberry-02.mail test/fixtures/att-blackberry.mail test/fixtures/att-image-01.mail test/fixtures/att-image-02.mail test/fixtures/att-iphone-01.mail test/fixtures/att-iphone-02.mail test/fixtures/att-iphone-03.mail test/fixtures/att-text-01.mail test/fixtures/bell-canada-image-01.mail test/fixtures/cingularme-text-01.mail test/fixtures/cingularme-text-02.mail test/fixtures/dici_un_mois_georgie.txt test/fixtures/dobson-image-01.mail test/fixtures/dot.jpg test/fixtures/generic.mail test/fixtures/handsets.yml test/fixtures/helio-image-01.mail test/fixtures/helio-message-01.mail test/fixtures/iconv-fr-text-01.mail test/fixtures/indosat-image-01.mail test/fixtures/indosat-image-02.mail test/fixtures/info2go-image-01.mail test/fixtures/invalid-byte-seq-outlook.mail test/fixtures/iphone-image-01.mail test/fixtures/iphone-image-02.mail test/fixtures/luxgsm-image-01.mail test/fixtures/maroctelecom-france-mms-01.mail test/fixtures/mediamessaging_o2_co_uk-image-01.mail test/fixtures/mmode-image-01.mail test/fixtures/mms.ae-image-01.mail test/fixtures/mms.mycricket.com-pic-and-text.mail test/fixtures/mms.mycricket.com-pic.mail test/fixtures/mmsreply.t-mobile.co.uk-text-image-01.mail test/fixtures/mobile.mycingular.com-text-01.mail test/fixtures/mtn-southafrica-mms.mail test/fixtures/mycingular-image-01.mail test/fixtures/netcom-image-01.mail test/fixtures/nextel-image-01.mail test/fixtures/nextel-image-02.mail test/fixtures/nextel-image-03.mail test/fixtures/nextel-image-04.mail test/fixtures/o2-de-image-01.mail test/fixtures/orange-uk-image-01.mail test/fixtures/orangefrance-text-and-image.mail test/fixtures/orangepoland-text-01.mail test/fixtures/orangepoland-text-02.mail test/fixtures/pics.cingularme.com-image-01.mail test/fixtures/pxt-image-01.mail test/fixtures/rogers-canada-mms-01.mail test/fixtures/sasktel-image-01.mail test/fixtures/sprint-blackberry-01.mail test/fixtures/sprint-broken-image-01.mail test/fixtures/sprint-image-01.mail test/fixtures/sprint-new-image-01.mail test/fixtures/sprint-pcs-text-01.mail test/fixtures/sprint-purged-image-01.mail test/fixtures/sprint-text-01.mail test/fixtures/sprint-two-images-01.mail test/fixtures/sprint-video-01.mail test/fixtures/sprint.mov test/fixtures/suncom-blackberry.mail test/fixtures/telus-image-01.mail test/fixtures/three-uk-image-01.mail test/fixtures/tmo.blackberry.net-image-01.mail test/fixtures/tmobile-blackberry-02.mail test/fixtures/tmobile-blackberry.mail test/fixtures/tmobile-image-01.mail test/fixtures/tmobile-image-02.mail test/fixtures/unicel-image-01.mail test/fixtures/us-cellular-image-01.mail test/fixtures/verizon-blackberry.mail test/fixtures/verizon-image-01.mail test/fixtures/verizon-image-02.mail test/fixtures/verizon-image-03.mail test/fixtures/verizon-text-01.mail test/fixtures/verizon-video-01.mail test/fixtures/virgin-mobile-image-01.mail test/fixtures/virgin.ca-text-01.mail test/fixtures/vodacom4me-co-za-01.mail test/fixtures/vodacom4me-co-za-02.mail test/fixtures/vodacom4me-southafrica-mms-01.mail test/fixtures/vodacom4me-southafrica-mms-04.mail test/fixtures/vtext-text-01.mail test/fixtures/vzwpix.com-image-01.mail test/fixtures/waw.plspictures.com-image-01.mail test/test_1nbox_net.rb test/test_bell_canada.rb test/test_bellsouth_net.rb test/test_helper.rb test/test_invalid_byte_seq_outlook.rb test/test_mediamessaging_o2_co_uk.rb test/test_messaging_nextel_com.rb test/test_messaging_sprintpcs_com.rb test/test_mms2r_media.rb test/test_mms_3ireland_ie.rb test/test_mms_ae.rb test/test_mms_alltel_com.rb test/test_mms_att_net.rb test/test_mms_dobson_net.rb test/test_mms_luxgsm_lu.rb test/test_mms_mobileiam_ma.rb test/test_mms_mtn_co_za.rb test/test_mms_mycricket_com.rb test/test_mms_myhelio_com.rb test/test_mms_netcom_no.rb test/test_mms_o2online_de.rb test/test_mms_three_co_uk.rb test/test_mms_uscc_net.rb test/test_mms_vodacom4me_co_za.rb test/test_mobile_indosat_net_id.rb test/test_msg_telus_com.rb test/test_orangemms_net.rb test/test_pm_sprint_com.rb test/test_pxt_vodafone_net_nz.rb test/test_rci_rogers_com.rb test/test_sms_sasktel_com.rb test/test_sprint.rb test/test_tmomail_net.rb test/test_unicel_com.rb test/test_vmpix_com.rb test/test_vzwpix_com.rb test/test_waw_plspictures_com.rb vendor/plugins/mms2r/lib/autotest/discover.rb vendor/plugins/mms2r/lib/autotest/mms2r.rb diff --git a/README.txt b/README.txt index 44d90c9..5f0362b 100644 --- a/README.txt +++ b/README.txt @@ -1,248 +1,247 @@ = mms2r https://github.com/monde/mms2r == DESCRIPTION MMS2R by Mike Mondragon -http://mms2r.rubyforge.org/ https://github.com/monde/mms2r -https://github.com/monde/mms2r/issues +https://rubygems.org/gems/mms2r http://peepcode.com/products/mms2r-pdf MMS2R is a library that decodes the parts of an MMS message to disk while stripping out advertising injected by the mobile carriers. MMS messages are multipart email and the carriers often inject branding into these messages. Use MMS2R if you want to get at the real user generated content from a MMS without having to deal with the cruft from the carriers. If MMS2R is not aware of a particular carrier no extra processing is done to the MMS other than decoding and consolidating its media. MMS2R can be used to process any multipart email to conveniently access the parts the mail is comprised of. Contact the author to add additional carriers to be processed by the library. Suggestions and patches appreciated and welcomed! Corpus of carriers currently processed by MMS2R: * 1nbox/Idea: 1nbox.net * 3 Ireland: mms.3ireland.ie * Alltel: mms.alltel.com * AT&T/Cingular/Legacy: mms.att.net, mm.att.net, txt.att.net, mmode.com, mms.mycingular.com, cingularme.com, mobile.mycingular.com pics.cingularme.com * Bell Canada: txt.bell.ca * Bell South / Suncom / SBC Global: bellsouth.net, sbcglobal.net * Cricket Wireless: mms.mycricket.com * Dobson/Cellular One: mms.dobson.net * Helio: mms.myhelio.com * Hutchison 3G UK Ltd: mms.three.co.uk * INDOSAT M2: mobile.indosat.net.id * LUXGSM S.A.: mms.luxgsm.lu * Maroc Telecom / mms.mobileiam.ma * MTM South Africa: mms.mtn.co.za * NetCom (Norway): mms.netcom.no * Nextel: messaging.nextel.com * O2 Germany: mms.o2online.de * O2 UK: mediamessaging.o2.co.uk * Orange & Regional Oranges: orangemms.net, mmsemail.orange.pl, orange.fr * PLSPICTURES.COM mms hosting: waw.plspictures.com * PXT New Zealand: pxt.vodafone.net.nz * Rogers of Canada: rci.rogers.com * SaskTel: sasktel.com, sms.sasktel.com, cdma.sasktel.com * Sprint: pm.sprint.com, messaging.sprintpcs.com, sprintpcs.com * T-Mobile: tmomail.net, mmsreply.t-mobile.co.uk, tmo.blackberry.net * TELUS Corporation (Canada): mms.telusmobility.com, msg.telus.com * U.S. Cellular: mms.uscc.net * UAE MMS: mms.ae * Unicel: unicel.com, info2go.com (note: mobile number is tucked away in a text/plain part for unicel.com) * Verizon: vzwpix.com, vtext.com, labwig.net * Virgin Mobile: vmpix.com, pixmbl.com, vmobl.com, yrmobl.com * Virgin Mobile of Canada: vmobile.ca * Vodacom: mms.vodacom4me.co.za Corpus of smart phones known to MMS2R: * Apple iPhone variants * Blackberry / Research In Motion variants * Casio variants * Droid variants * Google / Nexus One variants * HTC variants (T-Mobile Dash, Sprint HERO) * LG Electronics variants * Motorola variants * Pantech variants * Qualcom variants * Samsung variants * Sprint variants * UTStarCom variants As Seen On The Internets - sites known to be using MMS2R in some fashion * twitpic.com [http://www.twitpic.com/] * Simplton [http://simplton.com/] * fanchatter.com [http://www.fanchatter.com/] * camura.com [http://www.camura.com/] * eachday.com [http://www.eachday.com/] * beenup2.com [http://www.beenup2.com/] * snapmylife.com [http://www.snapmylife.com/] * email the author to be listed here == FEATURES * #default_media and #default_text methods return a File that can be used in attachment_fu or Paperclip * #process supports blocks for enumerating over the content of the MMS * #process can be made lazy when :process => :lazy is passed to new * logging is enabled when :logger => your_logger is passed to new * an mms instance acts like a Mail object, any methods not defined on the instance are delegated to it's underlying Mail object * #device_type? returns a symbol representing a device or smartphone type Known smartphones thus far: iPhone, BlackBerry, T-Mobile Dash, Droid, Samsung == BOOKS MMS2R, Making email useful http://peepcode.com/products/mms2r-pdf == SYNOPSIS begin require 'mms2r' rescue LoadError require 'rubygems' require 'mms2r' end # required for the example require 'fileutils' mail = MMS2R::Media.new(Mail.read('some_saved_mail.file')) puts "mail has default carrier subject" if mail.subject.empty? # access the sender's phone number puts "mail was from phone #{mail.number}" # most mail are either image or video, default_media will return the largest # (non-advertising) video or image found file = mail.default_media puts "mail had a media: #{file.inspect}" unless file.nil? # finds the largest (non-advertising) text found file = mail.default_text puts "mail had some text: #{file.inspect}" unless file.nil? # mail.media is a hash that is indexed by mime-type. # The mime-type key returns an array of filepaths # to media that were extract from the mail and # are of that type mail.media['image/jpeg'].each {|f| puts "#{f}"} mail.media['text/plain'].each {|f| puts "#{f}"} # print the text (assumes mail had text) text = IO.readlines(mail.media['text/plain'].first).join puts text # save the image (assumes mail had a jpeg) FileUtils.cp mail.media['image/jpeg'].first, '/some/where/useful', :verbose => true puts "does the mail have quicktime video? #{!mail.media['video/quicktime'].nil?}" puts "plus run anything that Mail provides, e.g. #{mail.to.inspect}" # check if the mail is from a mobile phone puts "mail is from a mobile phone #{mail.is_mobile?}" # determine the device type of the phone puts "mail is from a mobile phone of type #{mail.device_type?}" # inspect default media's exif data if exifr gem is installed and default # media is a jpeg or tiff puts "mail's default media's exif data is:" puts mail.exif.inspect # Block support, process and receive all media types of video. mail.process do |media_type, files| # assumes a Clip model that is an AttachmentFu Clip.create(:uploaded_data => files.first, :title => "From phone") if media_type =~ /video/ end # Another AttachmentFu example, Picture model is an AttachmentFu picture = Picture.new picture.title = mail.subject picture.uploaded_data = mail.default_media picture.save! #remove all the media that was put to temporary disk mail.purge == REQUIREMENTS * Mail (mail) * Nokogiri (nokogiri) * UUIDTools (uuidtools) * EXIF Reader (exif) == INSTALL * sudo gem install mms2r == SOURCE git clone git://github.com/monde/mms2r.git == AUTHORS Copyright (c) 2007-2010 by Mike Mondragon (blog[http://plasti.cx/]) MMS2R's Flickr page[http://www.flickr.com/photos/8627919@N05/] == CONTRIBUTORS * Luke Francl (blog[http://railspikes.com/]) * Will Jessup (blog[http://www.willjessup.com/]) * Shane Vitarana (blog[http://www.shanesbrain.net/]) * Layton Wedgeworth (http://www.beenup2.com/) * Jason Haruska (blog[http://software.haruska.com/]) * Dave Myron (company[http://contentfree.com/]) * Vijay Yellapragada * Jesse Dp (github profile[http://github.com/jessedp]) * David Alm * Jeremy Wilkins * Matt Conway (github profile[http://github.com/wr0ngway]) * Kai Kai * Michael DelGaudio * Sai Emrys (blog[http://saizai.com]) * Brendan Lim (github profile[http://github.com/brendanlim]) * Scott Taylor (github profile[http://github.com/smtlaissezfaire]) * Jaap van der Meer (github profile[http://github.com/japetheape]) * Karl Baum (github profile[http://github.com/kbaum]) == LICENSE (The MIT License) Copyright (c) 2007, 2008 Mike Mondragon ([email protected]). All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/Rakefile b/Rakefile index 0902222..041c148 100644 --- a/Rakefile +++ b/Rakefile @@ -1,45 +1,11 @@ -# -*- ruby -*- +require 'bundler' +Bundler::GemHelper.install_tasks -begin - require 'hoe' -rescue LoadError - require 'rubygems' - require 'hoe' -end - - -$LOAD_PATH.unshift File.join(File.dirname(__FILE__), "lib") -require 'mms2r' -require 'rake' - -Hoe.plugin :bundler -Hoe.spec('mms2r') do |p| - p.version = MMS2R::Media::VERSION - p.rubyforge_name = 'mms2r' - p.author = ['Mike Mondragon'] - p.email = ['[email protected]'] - p.summary = 'Extract user media from MMS (and not carrier cruft)' - p.description = p.paragraphs_of('README.txt', 2..5).join("\n\n") - p.url = p.paragraphs_of('README.txt', 1).first.strip - p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n") - p.readme_file = 'README.txt' - p.history_file = 'History.txt' - p.extra_deps << ['nokogiri', '>= 1.4.4'] - p.extra_deps << ['mail', '>= 2.2.10'] - p.extra_deps << ['uuidtools', '>= 2.1.1'] - p.extra_deps << ['exifr', '>= 1.0.3'] - p.clean_globs << 'coverage' -end +require 'rake/testtask' -begin - require 'rcov/rcovtask' - Rcov::RcovTask.new do |rcov| - rcov.pattern = 'test/**/test_*.rb' - rcov.verbose = true - rcov.rcov_opts << "--exclude rcov.rb" - end -rescue - task :rcov => :check_dependencies +Rake::TestTask.new do |t| + t.libs << 'test' end -# vim: syntax=Ruby +desc "Run tests" +task :default => :test diff --git a/lib/mms2r.rb b/lib/mms2r.rb index 80df937..9712599 100644 --- a/lib/mms2r.rb +++ b/lib/mms2r.rb @@ -1,83 +1,78 @@ #-- # Copyright (c) 2007-2010 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ module MMS2R ## # A hash of MMS2R processors keyed by MMS carrier domain. CARRIERS = {} ## # Registers a class as a processor for a MMS domain. Should only be # used in special cases such as MMS2R::Media::Sprint for 'pm.sprint.com' def self.register(domain, processor_class) MMS2R::CARRIERS[domain] = processor_class end ## # A hash of file extensions for common mime-types EXT = { 'text/plain' => 'text', 'text/plain' => 'txt', 'text/html' => 'html', 'image/png' => 'png', 'image/gif' => 'gif', 'image/jpeg' => 'jpeg', 'image/jpeg' => 'jpg', 'video/quicktime' => 'mov', 'video/3gpp2' => '3g2' } class MMS2R::Media - ## - # MMS2R library version - - VERSION = '3.6.3' - ## # Spoof User-Agent, primarily for the Sprint CDN USER_AGENT = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.120 Safari/535.2" end # Simple convenience function to make it a one-liner: # MMS2R.parse raw_mail or MMS2R.parse File.load(raw_mail) # Combined w/ the method_missing delegation, this should behave as an enhanced Mail object, more or less. def self.parse raw_mail, options = {} mail = Mail.new raw_mail MMS2R::Media.new(mail, options) end end %W{ yaml mail fileutils pathname tmpdir yaml digest/sha1 iconv exifr }.each do |g| begin require g rescue LoadError require 'rubygems' require g end end if RUBY_VERSION >= "1.9" begin require 'psych' YAML::ENGINE.yamler= 'syck' if defined?(YAML::ENGINE) rescue LoadError end end require File.join(File.dirname(__FILE__), 'ext/mail') require File.join(File.dirname(__FILE__), 'ext/object') require File.join(File.dirname(__FILE__), 'mms2r/media') require File.join(File.dirname(__FILE__), 'mms2r/media/sprint') MMS2R.register('pm.sprint.com', MMS2R::Media::Sprint) diff --git a/lib/mms2r/media.rb b/lib/mms2r/media.rb index fdd4fac..0a21387 100644 --- a/lib/mms2r/media.rb +++ b/lib/mms2r/media.rb @@ -294,551 +294,552 @@ module MMS2R def default_media @default_media ||= attachment(['video', 'image', 'application', 'text']) end # Returns a File with the most likely candidate that is text, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_text @default_text ||= attachment(['text/plain']) end # Returns a File with the most likely candidate that is html, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_html @default_html ||= attachment(['text/html']) end ## # process is a template method and collects all the media in a MMS. # Override helper methods to this template to clean out advertising and/or # ignore media that are advertising. This method should not be overridden # unless there is an extreme special case in processing the media of a MMS # (like Sprint) # # Helper methods for the process template: # * ignore_media? -- true if the media contained in a part should be ignored. # * process_media -- retrieves media to temporary file, returns path to file. # * transform_text -- called by process_media, strips out advertising. # * temp_file -- creates a temporary filepath based on information from the part. # # Block support: # Call process() with a block to automatically iterate through media. # For example, to process and receive only media of video type: # mms.process do |media_type, file| # results << file if media_type =~ /video/ # end # # note: purge must be explicitly called to remove the media files # mms2r extracts from an mms message. def process() # :yields: media_type, file unless @was_processed log("#{self.class} processing", :info) parts = mail.multipart? ? mail.parts : [mail] # Double check for multipart/related, if it exists replace it with its # children parts. Do this twice as multipart/alternative can have # children and we want to fold everything down for i in 1..2 flat = [] parts.each do |p| if p.multipart? p.parts.each {|mp| flat << mp } else flat << p end end parts = flat.dup end # get to work parts.each do |p| t = p.part_type? unless ignore_media?(t,p) t,f = process_media(p) add_file(t,f) unless t.nil? || f.nil? end end @was_processed = true end # when process acts upon a block if block_given? media.each do |k, v| yield(k, v) end end end ## # Helper for process template method to determine if media contained in a # part should be ignored. Producers should override this method to return # true for media such as images that are advertising, carrier logos, etc. # See the ignore section in the discussion of the built-in configuration. def ignore_media?(type, part) ignores = config['ignore'][type] || [] ignore = ignores.detect{ |test| filename?(part) == test} ignore ||= ignores.detect{ |test| filename?(part) =~ test if test.is_a?(Regexp) } ignore ||= ignores.detect{ |test| part.body.decoded.strip =~ test if test.is_a?(Regexp) } ignore ||= (part.body.decoded.strip.size == 0 ? true : nil) ignore.nil? ? false : true end ## # Helper for process template method to decode the part based on its type # and write its content to a temporary file. Returns path to temporary # file that holds the content. Parts with a main type of text will have # their contents transformed with a call to transform_text # # Producers should only override this method if the parts of the MMS need # special treatment besides what is expected for a normal mime part (like # Sprint). # # Returns a tuple of content type, file path def process_media(part) # Mail body auto-magically decodes quoted # printable for text/html type. file = temp_file(part) if part.part_type? =~ /^text\// || part.part_type? == 'application/smil' type, content = transform_text_part(part) mode = 'wb' else if part.part_type? == 'application/octet-stream' type = type_from_filename(filename?(part)) else type = part.part_type? end content = part.body.decoded mode = 'wb' # open with binary bit for Windows for non text end return type, nil if content.nil? || content.empty? log("#{self.class} writing file #{file}", :info) File.open(file, mode){ |f| f.write(content) } return type, file end ## # Helper for process_media template method to transform text. # See the transform section in the discussion of the built-in # configuration. def transform_text(type, text, original_encoding = 'ISO-8859-1') return type, text if !config['transform'] || !(transforms = config['transform'][type]) begin ic = Iconv.new('UTF-8', original_encoding ) utf_t = ic.iconv(text) utf_t << ic.iconv(nil) ic.close rescue Exception => e utf_t = text end transforms.each do |transform| next unless transform.size == 2 p = transform.first r = transform.last utf_t = utf_t.gsub(p, r) rescue utf_t end return type, utf_t end ## # Helper for process_media template method to transform text. def transform_text_part(part) type = part.part_type? text = part.body.decoded.strip transform_text(type, text) end ## # Helper for process template method to name a temporary filepath based on # information in the part. This version attempts to honor the name of the # media as labeled in the part header and creates a unique temporary # directory for writing the file so filename collision does not occur. # Consumers of this method expect the directory structure to the file # exists, if the method is overridden it is mandatory that this behavior is # retained. def temp_file(part) file_name = filename?(part) File.expand_path(File.join(msg_tmp_dir(),File.basename(file_name))) end ## # Purges the unique MMS2R::Media.media_dir directory created # for this producer and all of the media that it contains. def purge() log("#{self.class} purging #{@media_dir} and all its contents", :info) FileUtils.rm_rf(@media_dir) end ## # Helper to add a file to the media hash. def add_file(type, file) media[type] = [] unless media[type] media[type] << file end ## # Helper to temp_file to create a unique temporary directory that is a # child of tmp_dir This version is based on the message_id of the mail. def msg_tmp_dir() @dir_count += 1 dir = File.expand_path(File.join(@media_dir, "#{@dir_count}")) FileUtils.mkdir_p(dir) dir end ## # returns a filename declared for a part, or a default if its not defined def filename?(part) name = part.filename if (name.nil? || name.empty?) if part.content_id && (matched = /^<(.+)>$/.match(part.content_id)) name = matched[1] else name = "#{Time.now.to_f}.#{self.default_ext(part.part_type?)}" end end # FIXME FWIW, janky look for dot extension 1 to 4 chars long name = (name =~ /\..{1,4}$/ ? name : "#{name}.#{self.default_ext(part.part_type?)}").strip # handle excessively large filenames if name.size > 255 ext = File.extname(name) base = File.basename(name, ext) name = "#{base[0, 255 - ext.size]}#{ext}" end name end def aliases @aliases end ## # Best guess of the mobile device type. Simple heuristics thus far by # inspecting mail headers and jpeg/tiff exif metadata, and file name. # Known smart phone types thus far are # # * :blackberry # * :dash # * :droid # * :htc # * :iphone # * :lge # * :motorola # * :nokia # * :palm # * :pantech # * :samsung # # If the message is from a carrier known to MMS2R, and not a smart phone # its type is returned as :handset # Otherwise device type is :unknown def device_type? file = attachment(['image']) if file original = file.original_filename @exif = case original when /\.je?pg$/i EXIFR::JPEG.new(file) when /\.tiff?$/i EXIFR::TIFF.new(file) end if @exif models = config['device_types']['models'] rescue {} models.each do |type, regex| return type if @exif.model =~ regex end makes = config['device_types']['makes'] rescue {} makes.each do |type, regex| return type if @exif.make =~ regex end software = config['device_types']['software'] rescue {} software.each do |type, regex| return type if @exif.software =~ regex end end end headers = config['device_types']['headers'] rescue {} headers.keys.each do |header| if mail.header[header] # headers[header] refers to a hash of smart phone types with regex values # that if they match, the header signals the type should be returned headers[header].each do |type, regex| return type if mail.header[header].decoded =~ regex field = mail.header.fields.detect { |field| field.name == header } return type if field && field.to_s =~ regex end end end file = attachment(['image']) if file original_filename = file.original_filename filenames = config['device_types']['filenames'] rescue {} filenames.each do |type, regex| return type if original_filename =~ regex end end file = attachment(['video']) if file original_filename = file.original_filename filenames = config['device_types']['filenames'] rescue {} filenames.each do |type, regex| return type if original_filename =~ regex end end boundary = mail.boundary boundaries = config['device_types']['boundary'] rescue {} boundaries.each do |type, regex| return type if boundary =~ regex end return :handset if File.exist?( File.expand_path( File.join(self.conf_dir, "#{self.aliases[self.carrier] || self.carrier}.yml") ) ) :unknown end ## # exif object on default image from exifr gem def exif device_type? unless @exif @exif end ## # The source of the MMS was some sort of mobile or smart phone def is_mobile? self.device_type? != :unknown end ## # Get the temporary directory where media files are written to. def self.tmp_dir @@tmp_dir ||= File.expand_path(File.join(Dir.tmpdir, (ENV['USER'].nil? ? '':ENV['USER']), 'mms2r')) end ## # Set the temporary directory where media files are written to. def self.tmp_dir=(d) @@tmp_dir=d end ## # Get the directory where conf files are stored. def self.conf_dir @@conf_dir ||= File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'conf')) end ## # Set the directory where conf files are stored. def self.conf_dir=(d) @@conf_dir=d end ## # Helper to create a safe directory path element based on the mail message # id. def self.safe_message_id(mid) mid.nil? ? "#{Time.now.to_i}" : mid.gsub(/\$|<|>|@|\./, "") end ## # Returns a default file extension based on a content type def self.default_ext(content_type) if MMS2R::EXT[content_type] MMS2R::EXT[content_type] elsif content_type content_type.split('/').last end end ## # Joins the generic mms2r configuration with the carrier specific # configuration. def self.initialize_config(c) f = File.expand_path(File.join(self.conf_dir(), "mms2r_media.yml")) conf = YAML::load_file(f) conf['ignore'] ||= {} unless conf['ignore'] conf['transform'] = {} unless conf['transform'] conf['number'] = [] unless conf['number'] return conf unless c kinds = ['ignore', 'transform'] kinds.each do |kind| if c[kind] c[kind].each do |type,array| conf[kind][type] = [] unless conf[kind][type] conf[kind][type] += array end end end conf['number'] = c['number'] if c['number'] conf end def log(message, level = :info) @logger.send(level, message) unless @logger.nil? end ## # convenience accessor for self.class.conf_dir def conf_dir self.class.conf_dir end ## # convenience accessor for self.class.conf_dir def tmp_dir self.class.tmp_dir end ## # convenience accessor for self.class.default_ext def default_ext(type) self.class.default_ext(type) end ## # convenience accessor for self.class.safe_message_id def safe_message_id(message_id) self.class.safe_message_id(message_id) end ## # convenience accessor for self.class.initialize_confg def initialize_config(config) self.class.initialize_config(config) end private ## # accessor for the config def config @config end ## # guess content type from filename def type_from_filename(filename) ext = filename.split('.').last ent = MMS2R::EXT.detect{|k,v| v == ext} ent.nil? ? nil : ent.first end ## # used by #default_media and #text to return the biggest attachment type # listed in the types array def attachment(types) # get all the files that are of the major types passed in files = [] types.each do |type| media.keys.find_all{|k| type.include?("/") ? k == type : k.index(type) == 0 }.each do |key| files += media[key] end end return nil if files.empty? # set temp holders file = nil # explicitly declare the file and size size = 0 mime_type = nil #get the largest file files.each do |path| + next unless File.exist?(path) if File.size(path) > size size = File.size(path) file = File.new(path) media.each do |type,_files| mime_type = type if _files.detect{ |_path| _path == path } end end end return nil if file.nil? # These singleton methods implement the interface necessary to be used # as a drop-in replacement for files uploaded with CGI.rb. # This helps if you want to use the files with, for example, # attachment_fu. def file.local_path self.path end def file.original_filename File.basename(self.path) end def file.size File.size(self.path) end # this one is kind of confusing because it needs a closure. class << file self end.send(:define_method, :content_type) { mime_type } file end end end diff --git a/lib/mms2r/version.rb b/lib/mms2r/version.rb new file mode 100644 index 0000000..2762189 --- /dev/null +++ b/lib/mms2r/version.rb @@ -0,0 +1,25 @@ +module MMS2R + class Version + + def self.major + 3 + end + + def self.minor + 6 + end + + def self.patch + 5 + end + + def self.pre + nil + end + + def self.to_s + [major, minor, patch, pre].compact.join('.') + end + + end +end diff --git a/mms2r.gemspec b/mms2r.gemspec index fe175b7..30385bc 100644 --- a/mms2r.gemspec +++ b/mms2r.gemspec @@ -1,45 +1,33 @@ -# -*- encoding: utf-8 -*- +$:.unshift File.expand_path("../lib", __FILE__) +require "mms2r/version" -Gem::Specification.new do |s| - s.name = "mms2r" - s.version = "3.6.2" +Gem::Specification.new do |gem| - s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= - s.authors = ["Mike Mondragon"] - s.date = "2011-10-31" - s.description = "== DESCRIPTION\n\nMMS2R by Mike Mondragon\nhttp://mms2r.rubyforge.org/\nhttps://github.com/monde/mms2r\nhttps://github.com/monde/mms2r/issues\nhttp://peepcode.com/products/mms2r-pdf\n\nMMS2R is a library that decodes the parts of an MMS message to disk while\nstripping out advertising injected by the mobile carriers. MMS messages are\nmultipart email and the carriers often inject branding into these messages. Use\nMMS2R if you want to get at the real user generated content from a MMS without\nhaving to deal with the cruft from the carriers.\n\nIf MMS2R is not aware of a particular carrier no extra processing is done to the\nMMS other than decoding and consolidating its media." - s.email = ["[email protected]"] - s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.TMail.txt", "README.txt"] - s.files = ["Gemfile", "Gemfile.lock", "History.txt", "Manifest.txt", "README.TMail.txt", "README.txt", "Rakefile", "conf/1nbox.net.yml", "conf/aliases.yml", "conf/bellsouth.net.yml", "conf/from.yml", "conf/mediamessaging.o2.co.uk.yml", "conf/messaging.nextel.com.yml", "conf/mms.3ireland.ie.yml", "conf/mms.ae.yml", "conf/mms.alltel.com.yml", "conf/mms.att.net.yml", "conf/mms.dobson.net.yml", "conf/mms.luxgsm.lu.yml", "conf/mms.mobileiam.ma.yml", "conf/mms.mtn.co.za.yml", "conf/mms.mycricket.com.yml", "conf/mms.myhelio.com.yml", "conf/mms.netcom.no.yml", "conf/mms.o2online.de.yml", "conf/mms.three.co.uk.yml", "conf/mms.uscc.net.mail", "conf/mms.vodacom4me.co.za.yml", "conf/mms2r_media.yml", "conf/mobile.indosat.net.id.yml", "conf/msg.telus.com.yml", "conf/orangemms.net.yml", "conf/pm.sprint.com.yml", "conf/pxt.vodafone.net.nz.yml", "conf/rci.rogers.com.yml", "conf/sms.sasktel.com.yml", "conf/tmomail.net.yml", "conf/txt.bell.ca.yml", "conf/unicel.com.yml", "conf/vmpix.com.yml", "conf/vzwpix.com.yml", "conf/waw.plspictures.com.yml", "dev_tools/anonymizer.rb", "dev_tools/debug_sprint_nokogiri_parsing.rb", "init.rb", "lib/ext/mail.rb", "lib/ext/object.rb", "lib/mms2r.rb", "lib/mms2r/media.rb", "lib/mms2r/media/sprint.rb", "mms2r.gemspec", "test/fixtures/1nbox-2images-01.mail", "test/fixtures/1nbox-2images-02.mail", "test/fixtures/1nbox-2images-03.mail", "test/fixtures/1nbox-2images-04.mail", "test/fixtures/3ireland-mms-01.mail", "test/fixtures/ad_new.txt", "test/fixtures/alltel-image-01.mail", "test/fixtures/alltel-mms-01.mail", "test/fixtures/alltel-mms-03.mail", "test/fixtures/apple-double-image-01.mail", "test/fixtures/att-blackberry-02.mail", "test/fixtures/att-blackberry.mail", "test/fixtures/att-image-01.mail", "test/fixtures/att-image-02.mail", "test/fixtures/att-iphone-01.mail", "test/fixtures/att-iphone-02.mail", "test/fixtures/att-iphone-03.mail", "test/fixtures/att-text-01.mail", "test/fixtures/bell-canada-image-01.mail", "test/fixtures/cingularme-text-01.mail", "test/fixtures/cingularme-text-02.mail", "test/fixtures/dici_un_mois_georgie.txt", "test/fixtures/dobson-image-01.mail", "test/fixtures/dot.jpg", "test/fixtures/generic.mail", "test/fixtures/handsets.yml", "test/fixtures/helio-image-01.mail", "test/fixtures/helio-message-01.mail", "test/fixtures/iconv-fr-text-01.mail", "test/fixtures/indosat-image-01.mail", "test/fixtures/indosat-image-02.mail", "test/fixtures/info2go-image-01.mail", "test/fixtures/iphone-image-01.mail", "test/fixtures/luxgsm-image-01.mail", "test/fixtures/maroctelecom-france-mms-01.mail", "test/fixtures/mediamessaging_o2_co_uk-image-01.mail", "test/fixtures/mmode-image-01.mail", "test/fixtures/mms.ae-image-01.mail", "test/fixtures/mms.mycricket.com-pic-and-text.mail", "test/fixtures/mms.mycricket.com-pic.mail", "test/fixtures/mmsreply.t-mobile.co.uk-text-image-01.mail", "test/fixtures/mobile.mycingular.com-text-01.mail", "test/fixtures/mtn-southafrica-mms.mail", "test/fixtures/mycingular-image-01.mail", "test/fixtures/netcom-image-01.mail", "test/fixtures/nextel-image-01.mail", "test/fixtures/nextel-image-02.mail", "test/fixtures/nextel-image-03.mail", "test/fixtures/nextel-image-04.mail", "test/fixtures/o2-de-image-01.mail", "test/fixtures/orange-uk-image-01.mail", "test/fixtures/orangefrance-text-and-image.mail", "test/fixtures/orangepoland-text-01.mail", "test/fixtures/orangepoland-text-02.mail", "test/fixtures/pics.cingularme.com-image-01.mail", "test/fixtures/pxt-image-01.mail", "test/fixtures/rogers-canada-mms-01.mail", "test/fixtures/sasktel-image-01.mail", "test/fixtures/sprint-broken-image-01.mail", "test/fixtures/sprint-image-01.mail", "test/fixtures/sprint-new-image-01.mail", "test/fixtures/sprint-pcs-text-01.mail", "test/fixtures/sprint-purged-image-01.mail", "test/fixtures/sprint-text-01.mail", "test/fixtures/sprint-two-images-01.mail", "test/fixtures/sprint-video-01.mail", "test/fixtures/sprint.mov", "test/fixtures/suncom-blackberry.mail", "test/fixtures/telus-image-01.mail", "test/fixtures/three-uk-image-01.mail", "test/fixtures/tmo.blackberry.net-image-01.mail", "test/fixtures/tmobile-blackberry-02.mail", "test/fixtures/tmobile-blackberry.mail", "test/fixtures/tmobile-image-01.mail", "test/fixtures/tmobile-image-02.mail", "test/fixtures/unicel-image-01.mail", "test/fixtures/us-cellular-image-01.mail", "test/fixtures/verizon-blackberry.mail", "test/fixtures/verizon-image-01.mail", "test/fixtures/verizon-image-02.mail", "test/fixtures/verizon-image-03.mail", "test/fixtures/verizon-text-01.mail", "test/fixtures/verizon-video-01.mail", "test/fixtures/virgin-mobile-image-01.mail", "test/fixtures/virgin.ca-text-01.mail", "test/fixtures/vodacom4me-co-za-01.mail", "test/fixtures/vodacom4me-co-za-02.mail", "test/fixtures/vodacom4me-southafrica-mms-01.mail", "test/fixtures/vodacom4me-southafrica-mms-04.mail", "test/fixtures/vtext-text-01.mail", "test/fixtures/vzwpix.com-image-01.mail", "test/fixtures/waw.plspictures.com-image-01.mail", "test/hax.rb", "test/test_1nbox_net.rb", "test/test_bell_canada.rb", "test/test_bellsouth_net.rb", "test/test_helper.rb", "test/test_mediamessaging_o2_co_uk.rb", "test/test_messaging_nextel_com.rb", "test/test_messaging_sprintpcs_com.rb", "test/test_mms2r_media.rb", "test/test_mms_3ireland_ie.rb", "test/test_mms_ae.rb", "test/test_mms_alltel_com.rb", "test/test_mms_att_net.rb", "test/test_mms_dobson_net.rb", "test/test_mms_luxgsm_lu.rb", "test/test_mms_mobileiam_ma.rb", "test/test_mms_mtn_co_za.rb", "test/test_mms_mycricket_com.rb", "test/test_mms_myhelio_com.rb", "test/test_mms_netcom_no.rb", "test/test_mms_o2online_de.rb", "test/test_mms_three_co_uk.rb", "test/test_mms_uscc_net.rb", "test/test_mms_vodacom4me_co_za.rb", "test/test_mobile_indosat_net_id.rb", "test/test_msg_telus_com.rb", "test/test_orangemms_net.rb", "test/test_pm_sprint_com.rb", "test/test_pxt_vodafone_net_nz.rb", "test/test_rci_rogers_com.rb", "test/test_sms_sasktel_com.rb", "test/test_tmomail_net.rb", "test/test_unicel_com.rb", "test/test_vmpix_com.rb", "test/test_vzwpix_com.rb", "test/test_waw_plspictures_com.rb", "vendor/plugins/mms2r/lib/autotest/discover.rb", "vendor/plugins/mms2r/lib/autotest/mms2r.rb", ".gemtest"] - s.homepage = "https://github.com/monde/mms2r" - s.rdoc_options = ["--main", "README.txt"] - s.require_paths = ["lib"] - s.rubyforge_project = "mms2r" - s.rubygems_version = "1.8.10" - s.summary = "Extract user media from MMS (and not carrier cruft)" - s.test_files = ["test/test_orangemms_net.rb", "test/test_waw_plspictures_com.rb", "test/test_mediamessaging_o2_co_uk.rb", "test/test_vzwpix_com.rb", "test/test_unicel_com.rb", "test/test_messaging_sprintpcs_com.rb", "test/test_mms_luxgsm_lu.rb", "test/test_rci_rogers_com.rb", "test/test_mms_uscc_net.rb", "test/test_mms_netcom_no.rb", "test/test_1nbox_net.rb", "test/test_sms_sasktel_com.rb", "test/test_mms_att_net.rb", "test/test_mobile_indosat_net_id.rb", "test/test_messaging_nextel_com.rb", "test/test_mms_mtn_co_za.rb", "test/test_mms_vodacom4me_co_za.rb", "test/test_pxt_vodafone_net_nz.rb", "test/test_mms_dobson_net.rb", "test/test_helper.rb", "test/test_msg_telus_com.rb", "test/test_mms_o2online_de.rb", "test/test_mms2r_media.rb", "test/test_bell_canada.rb", "test/test_tmomail_net.rb", "test/test_mms_3ireland_ie.rb", "test/test_pm_sprint_com.rb", "test/test_mms_alltel_com.rb", "test/test_mms_mobileiam_ma.rb", "test/test_mms_mycricket_com.rb", "test/test_bellsouth_net.rb", "test/test_mms_three_co_uk.rb", "test/test_vmpix_com.rb", "test/test_mms_myhelio_com.rb", "test/test_mms_ae.rb"] + gem.add_dependency 'rake', ['= 0.9.2.2'] + gem.add_dependency 'nokogiri', ['>= 1.5.0'] + gem.add_dependency 'mail', ['>= 2.4.0'] + gem.add_dependency 'exifr', ['>= 1.0.3'] + gem.add_dependency 'json', ['>= 1.6.0'] - if s.respond_to? :specification_version then - s.specification_version = 3 + gem.add_development_dependency "rdoc" + gem.add_development_dependency "simplecov" + gem.add_development_dependency 'test-unit' + gem.add_development_dependency 'mocha' - if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then - s.add_runtime_dependency(%q<nokogiri>, [">= 1.4.4"]) - s.add_runtime_dependency(%q<mail>, [">= 2.2.10"]) - s.add_runtime_dependency(%q<uuidtools>, [">= 2.1.1"]) - s.add_runtime_dependency(%q<exifr>, [">= 1.0.3"]) - s.add_development_dependency(%q<hoe>, ["~> 2.12"]) - else - s.add_dependency(%q<nokogiri>, [">= 1.4.4"]) - s.add_dependency(%q<mail>, [">= 2.2.10"]) - s.add_dependency(%q<uuidtools>, [">= 2.1.1"]) - s.add_dependency(%q<exifr>, [">= 1.0.3"]) - s.add_dependency(%q<hoe>, ["~> 2.12"]) - end - else - s.add_dependency(%q<nokogiri>, [">= 1.4.4"]) - s.add_dependency(%q<mail>, [">= 2.2.10"]) - s.add_dependency(%q<uuidtools>, [">= 2.1.1"]) - s.add_dependency(%q<exifr>, [">= 1.0.3"]) - s.add_dependency(%q<hoe>, ["~> 2.12"]) - end + gem.name = "mms2r" + gem.version = MMS2R::Version.to_s + gem.platform = Gem::Platform::RUBY + gem.authors = ["Mike Mondragon"] + gem.email = ["[email protected]"] + gem.homepage = "https://github.com/monde/mms2r" + gem.summary = "Extract user media from MMS (and not carrier cruft)" + gem.description = open(File.join(File.dirname(__FILE__), 'README.txt')).readlines[6...22].join + gem.rubyforge_project = "mms2r" + gem.rubygems_version = ">= 1.3.6" + gem.files = `git ls-files`.split("\n") + gem.require_path = ['lib'] + gem.rdoc_options = ["--main", "README.txt"] + gem.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.TMail.txt", "README.txt"] + + gem.test_files = `git ls-files -- {test,spec,features}/*`.split("\n") end diff --git a/test/test_helper.rb b/test/test_helper.rb index a2c57ca..df698cf 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,97 +1,103 @@ -# do it like rake http://ozmm.org/posts/do_it_like_rake.html +if ENV['COVERAGE'] + require 'simplecov' + SimpleCov.start do + add_filter 'test' + end +end -%W{ test/unit set net/http net/https pp tempfile mocha rcov/rcovtask }.each do |g| +# do it like rake http://ozmm.org/posts/do_it_like_rake.html +%W{ test/unit set net/http net/https pp tempfile mocha }.each do |g| begin require g rescue LoadError require 'rubygems' require g end end require File.join(File.expand_path(File.dirname(__FILE__)), '..', 'lib', 'mms2r') module MMS2R module TestHelper def assert_file_size(file, size) assert_not_nil(file, "file was nil") assert(File::exist?(file), "file #{file} does not exist") assert(File::size(file) == size, "file #{file} is #{File::size(file)} bytes, not #{size} bytes") end def fixture(file) File.join(File.expand_path(File.dirname(__FILE__)), "fixtures", file) end def fixture_data(name) open(fixture(name)).read end def mail_fixture(file) fixture(file) end def mail(name) Mail.read(mail_fixture(name)) end def smart_phone_mock(make_text = 'Apple', model_text = 'iPhone', software_text = nil, jpeg = true) mail = stub('mail', :from => ['[email protected]'], :return_path => '<[email protected]>', :message_id => 'abcd0123', :multipart? => true, :header => {}) part = stub('part', :part_type? => "image/#{jpeg ? 'jpeg' : 'tiff'}", :body => Mail::Body.new('abc'), :multipart? => false, :filename => "foo.#{jpeg ? 'jpg' : 'tif'}" ) mail.stubs(:parts).returns([part]) exif = stub('exif', :make => make_text, :model => model_text, :software => software_text) if jpeg EXIFR::JPEG.expects(:new).at_least_once.returns(exif) else EXIFR::TIFF.expects(:new).at_least_once.returns(exif) end mail end end end class Hash def except(*keys) rejected = Set.new(respond_to?(:convert_key) ? keys.map { |key| convert_key(key) } : keys) reject { |key,| rejected.include?(key) } end def except!(*keys) replace(except(*keys)) end end # monkey patch Net::HTTP so un caged requests don't go over the wire module Net #:nodoc: class HTTP #:nodoc: alias :old_net_http_request :request alias :old_net_http_connect :connect def request(req, body = nil, &block) uri_cls = use_ssl ? URI::HTTPS : URI::HTTP query = req.path.split('?',2) opts = {:host => self.address, :port => self.port, :path => query[0]} opts[:query] = query[1] if query[1] uri = uri_cls.build(opts) raise ArgumentError.new("#{req.method} method to #{uri} not being handled in testing") end def connect raise ArgumentError.new("connect not being handled in testing") end end end
monde/mms2r
8d2de6fb15094edb09527af696e1657094498af1
Whitespace fascist!
diff --git a/dev_tools/debug_sprint_nokogiri_parsing.rb b/dev_tools/debug_sprint_nokogiri_parsing.rb index 1ddf5c4..a6a0ee3 100644 --- a/dev_tools/debug_sprint_nokogiri_parsing.rb +++ b/dev_tools/debug_sprint_nokogiri_parsing.rb @@ -1,87 +1,87 @@ require 'rubygems' require 'nokogiri' require 'net/http' require 'cgi' require 'rubygems' require 'pp' if ARGV[0].nil? puts "please execute with a file path to a Sprint HTML file that was extracted from a MMS" puts "ruby #{$0} MYFILE" exit end doc = open(ARGV[0]) { |f| Nokogiri(f) } puts "TITLE: #{doc.at('title').inner_html}" #phone number is tucked away in the comment in the head c = doc.search("/html/head/comment()").last t = c.content.gsub(/\s+/m," ").strip number = / name=&quot;MDN&quot;&gt;(\d+)&lt;/.match(t)[1] puts "NUMBER: #{number}" #if there is a text message with the MMS its in the #inner html of the only pre on the page text = doc.search("/html/body//pre").first.inner_html puts "TEXT: #{text}" -# just see what they say this MMS is it really doesn't mean anything, the +# just see what they say this MMS is it really doesn't mean anything, the # content is in faux image with a RECIPIENT in its URI path text = doc.search("/html/body//tr[2]/td//b") case text.text when /You have a Video Mail from/ puts "it claims to be a video: #{text}" when /You have a Picture Mail from / puts "it claims to be an image: #{text}" else puts "what is it? #{text.text}" end # group all the images together srcs = Array.new imgs = doc.search("/html/body//img") imgs.each do |i| src = i.attributes['src'] #next unless /pictures.sprintpcs.com\/+mmps\/RECIPIENT\//.match(src) #we don't want to double fetch content and we only #want to fetch media from the content server, you get #a clue about that as there is a RECIPIENT in the URI path next unless /mmps\/RECIPIENT\//.match(src) next if srcs.detect{|s| s.eql?(src)} srcs << src end # now fetch the media puts "there are #{srcs.size} sources to fetch" cnt = 0 srcs.each do |src| puts "--" puts "FETCHING:\n #{src.text}" url = URI.parse(CGI.unescapeHTML(src.text)) query={} url.query.split('&').each{|a| p=a.split('='); query[p[0]] = p[1]} query.delete_if{|k, v| k == 'limitsize' or k == 'squareoutput' } url.query = query.map{|k,v| "#{k}=#{v}"}.join("&") # sprint is a ghetto, they expect to see &amp; for video request url.query = url.query.gsub(/&/, "&amp;") if @is_video #res = Net::HTTP.get_response(url) agent = "Mozilla/5.0 (X11; U; Minix3 i686 (x86_64); en-US; rv:1.8.1.1) Gecko/20061208 Firefox/2.0.0.1" res = Net::HTTP.start(url.host, url.port) { |http| req = Net::HTTP::Get.new(url.request_uri, {'User-Agent' => agent}) http.request(req) } # prep and write a file base = /\/RECIPIENT\/([^\/]+)\//.match(src)[1] ext = /^[^\/]+\/(.+)/.match(res.content_type)[1] file_name ="#{base}.#{cnt}.#{ext}" puts "writing file: #{file_name}" File.open(file_name,'w'){ |f| f.write(res.body) } puts "file is sized #{File.size(file_name)}" cnt = cnt + 1 end puts "no images or video" if srcs.size == 0 diff --git a/test/fixtures/handsets.yml b/test/fixtures/handsets.yml index 90b6c13..706d07d 100644 --- a/test/fixtures/handsets.yml +++ b/test/fixtures/handsets.yml @@ -1,119 +1,119 @@ ---- +--- - - Apple - iPhone - - Apple - iPhone 3G - - Apple - iPhone 3GS - - CASIO - G'z One TYPE-S - - CASIO - G'zOne ROCK - - CX87BL05 - LG8700 - - ES.M800 - SPH-M800 - - HTC - Eris - - HTC - HERO200 - - HTC - HTC_TyTN_II - - HTC - RAPH800 - - HTC - T-Mobile G1 - - HTC - T-Mobile myTouch 3G - - HTC-ST7377 - HTC-ST7377 - - ISUS02232009 - Seoul Electronics & Telecom SIM120B 1.3M - - ISUS09012008 - Seoul Electronics & Telecom SIM120B 1.3M - - LG Electronics - VX-8800 - - LG Electronics - VX-9700 - - LG Electronics - VX11000 - - LG Electronics, Inc. - LG RUMOR2 - - LGE - CU920 - - M6550B-SAM-4480 - SYSTEMLSI S5K4BAFB 2.0 MP - - MSM6100 - Omni_vision-9650 - - MSM6500 - LSI_S5K4AAFA - - Motorola - 1.3 Megapixel - - Motorola - Droid - - Motorola - Motorola Phone - - Motorola C.451.01.04.17.08 - 2.0 Megapixel - - PANTECH - C790 - - RIM - BlackBerry 8100 Series - - Research In Motion - BlackBerry 8310 - - Research In Motion - BlackBerry 8320 - - Research In Motion - BlackBerry 8330 - - Research In Motion - BlackBerry 8330m - - Research In Motion - BlackBerry 8530 - - Research In Motion - BlackBerry 8900 - - Research In Motion - BlackBerry 9700 - - SAMSUNG - SAMSUNG - - SAMSUNG - SCH-U350 - - SAMSUNG - SCH-U450 - - SAMSUNG - SCH-U490 - - SAMSUNG - SGH-A167 - - SAMSUNG - SGH-A437 - - SAMSUNG - SGH-E250 - - SAMSUNG - SGH-T459 - - SAMSUNG - SGH-T729 - - SAMSUNG - SPH-M900 - - SAMSUNG - Samsung SCH-U750 - - SAMSUNG Electronics - SGH-i637 - - Samsung Electronics - A727 - - Samsung Electronics - A767 - - Samsung Electronics - SGH-A737 - - Samsung Electronics - SGH-T749 - - Samsung Electronics - SGH-T819 - - Samsung Electronics - T639 - - Sprint - KATANA Eclipse X - - T-Mobile Dash - T-Mobile Dash - - T1A_UC1.88 - Micron MT9M113 1.3MP YUV - - google - Nexus One diff --git a/test/test_mms2r_media.rb b/test/test_mms2r_media.rb index d9f923d..d3db314 100644 --- a/test/test_mms2r_media.rb +++ b/test/test_mms2r_media.rb @@ -1,878 +1,878 @@ # encoding: UTF-8 require "test_helper" class TestMms2rMedia < Test::Unit::TestCase include MMS2R::TestHelper def use_temp_dirs MMS2R::Media.tmp_dir = @tmpdir MMS2R::Media.conf_dir = @confdir end def setup @oldtmpdir = MMS2R::Media.tmp_dir || File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") @oldconfdir = MMS2R::Media.conf_dir || File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") FileUtils.mkdir_p(@oldtmpdir) FileUtils.mkdir_p(@oldconfdir) @tmpdir = File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") FileUtils.mkdir_p(@tmpdir) @confdir = File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") FileUtils.mkdir_p(@confdir) end def teardown FileUtils.rm_rf(@tmpdir) FileUtils.rm_rf(@confdir) MMS2R::Media.tmp_dir = @oldtmpdir MMS2R::Media.conf_dir = @oldconfdir end def stub_mail(vals = {}) attrs = { :from => '[email protected]', :to => '[email protected]', :subject => 'This is a test email', :body => 'a', }.merge(vals) Mail.new do from attrs[:from] to attrs[:to] subject attrs[:subject] body attrs[:body] end end def test_faux_user_agent assert_equal "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.120 Safari/535.2", MMS2R::Media::USER_AGENT end def test_class_parse mms = mail('generic.mail') assert_equal ['[email protected]'], mms.from end def temp_text_file(text) tf = Tempfile.new("test" + rand.to_s) tf.puts(text) tf.close tf.path end def test_tmp_dir use_temp_dirs() MMS2R::Media.tmp_dir = @tmpdir assert_equal @tmpdir, MMS2R::Media.tmp_dir end def test_conf_dir use_temp_dirs() MMS2R::Media.conf_dir = @confdir assert_equal @confdir, MMS2R::Media.conf_dir end def test_safe_message_id mid1_b="1234abcd" mid1_a="1234abcd" mid2_b="<01234567.0123456789012.JavaMail.fooba@foo-bars999>" mid2_a="012345670123456789012JavaMailfoobafoo-bars999" assert_equal mid1_a, MMS2R::Media.safe_message_id(mid1_b) assert_equal mid2_a, MMS2R::Media.safe_message_id(mid2_b) end def test_default_ext assert_equal nil, MMS2R::Media.default_ext(nil) assert_equal 'text', MMS2R::Media.default_ext('text') assert_equal 'txt', MMS2R::Media.default_ext('text/plain') assert_equal 'test', MMS2R::Media.default_ext('example/test') end def test_base_initialize_config_tries_to_open_default_config_yaml f = File.join(MMS2R::Media.conf_dir, 'mms2r_media.yml') YAML.expects(:load_file).once.with(f).returns({}) config = MMS2R::Media.initialize_config(nil) end def test_base_initialize_config config = MMS2R::Media.initialize_config(nil) # test defaults shipped in mms2r_media.yml assert_not_nil config assert_equal true, config['ignore'].is_a?(Hash) assert_equal true, config['transform'].is_a?(Hash) assert_equal true, config['number'].is_a?(Array) end def test_instance_initialize_config mms = MMS2R::Media.new stub_mail config = mms.initialize_config(nil) # test defaults shipped in mms2r_media.yml assert_not_nil config assert_equal true, config['ignore'].is_a?(Hash) assert_equal true, config['transform'].is_a?(Hash) assert_equal true, config['number'].is_a?(Array) end def test_initialize_config_contatenation c = {'ignore' => {'text/plain' => [/A TEST/]}, 'transform' => {'text/plain' => [/FOO/, '']}, 'number' => ['from', /^([^\s]+)\s.*/, '\1'] } config = MMS2R::Media.initialize_config(c) assert_not_nil config['ignore']['text/plain'].detect{|v| v == /A TEST/} assert_not_nil config['transform']['text/plain'].detect{|v| v == /FOO/} assert_not_nil config['number'].first == 'from' end def test_aliased_new_returns_default_processor_instance mms = MMS2R::Media.new stub_mail assert_not_nil mms assert_equal true, mms.respond_to?(:process) assert_equal MMS2R::Media, mms.class end def test_lazy_process_option mms = MMS2R::Media.new stub_mail, :process => :lazy mms.expects(:process).never end def test_logger_option logger = mock() logger.expects(:info).at_least_once mms = MMS2R::Media.new stub_mail, :logger => logger end def test_default_processor_initialize_tries_to_open_config_for_carrier mms_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'mms2r_media.yml')) aliases_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'aliases.yml')) from_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'from.yml')) example_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'example.com.yml')) YAML.expects(:load_file).at_least_once.with(mms_yaml).returns({}) YAML.expects(:load_file).at_least_once.with(aliases_yaml).returns({}) YAML.expects(:load_file).at_least_once.with(from_yaml).returns([]) YAML.expects(:load_file).never.with(example_yaml) mms = MMS2R::Media.new stub_mail end def test_mms_phone_number mail = stub_mail mail.stubs(:from).returns(['[email protected]']) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number end def test_mms_phone_number_from_config mail = stub_mail(:from => '"+2068675309" <[email protected]>') mms = MMS2R::Media.new(mail) mms.expects(:config).once.returns({'number' => ['from', /^([^\s]+)\s.*/, '\1']}) assert_equal '+2068675309', mms.number end def test_mms_phone_number_with_errors mail = stub_mail mail.stubs(:from).returns(nil) mms = MMS2R::Media.new(mail) assert_nothing_raised do assert_equal '', mms.number end end def test_transform_text_plain mail = stub_mail mail.stubs(:from).returns(nil) mms = MMS2R::Media.new(mail) type = 'test/type' text = 'hello' # no match in the config result = [type, text] assert_equal result, mms.transform_text(type, text) # testing the default config assert_equal ['text/plain', ''], mms.transform_text('text/plain', "Sent from my Windows Phone") assert_equal ['text/plain', ''], mms.transform_text('text/plain', "Sent via BlackBerry from T-Mobile") assert_equal ['text/plain', ''], mms.transform_text('text/plain', "Sent from my Verizon Wireless BlackBerry") assert_equal ['text/plain', ''], mms.transform_text('text/plain', 'Sent via iPhone') assert_equal ['text/plain', ''], mms.transform_text('text/plain', 'Sent from my iPhone') assert_equal ['text/plain', ''], mms.transform_text('text/plain', 'Sent from your iPhone.') assert_equal ['text/plain', ''], mms.transform_text('text/plain', " \n\nimage/jpeg") # has a bad regexp mms.expects(:config).at_least_once.returns({'transform' => {type => [['(hello)', 'world']]}}) assert_equal result, mms.transform_text(type, text) # matches in config mms.expects(:config).at_least_once.returns({'transform' => {type => [[/(hello)/, 'world']]}}) assert_equal [type, 'world'], mms.transform_text(type, text) mms.expects(:config).at_least_once.returns({'transform' => {type => [[/^Ignore this part, (.+)/, '\1']]}}) assert_equal [type, text], mms.transform_text(type, "Ignore this part, " + text) # chaining transforms - mms.expects(:config).at_least_once.returns({'transform' => {type => [[/(hello)/, 'world'], + mms.expects(:config).at_least_once.returns({'transform' => {type => [[/(hello)/, 'world'], [/(world)/, 'mars']]}}) assert_equal [type, 'mars'], mms.transform_text(type, text) # has a Iconv problem mms.expects(:config).at_least_once.returns({'transform' => {type => [['(hello)', 'world']]}}) assert_equal result, mms.transform_text(type, text) end def test_transform_text_to_utf8 mail = mail('iconv-fr-text-01.mail') mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_equal 1, mms.media['text/plain'].size assert_equal 1, mms.media['text/html'].size file = mms.media['text/plain'][0] assert_not_nil file assert_equal true, File::exist?(file) text_lines = IO.readlines("#{file}") text = text_lines.join # ASCII-8BIT -> D'ici un mois G\xE9orgie # UTF-8 -> D'ici un mois Géorgie if RUBY_VERSION < "1.9" assert_equal("sample email message Fwd: sub D'ici un mois Géorgie", mms.subject) assert_equal("D'ici un mois Géorgie body", text_lines.first.strip) else assert_equal(Iconv.new('UTF-8', 'ISO-8859-1').iconv("sample email message Fwd: sub D'ici un mois Géorgie"), mms.subject) assert_equal(Iconv.new('UTF-8', 'ISO-8859-1').iconv("D'ici un mois G\xE9orgie body"), text_lines.first.strip) end end def test_subject s = 'hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) assert_equal s, mms.subject # second time through shouldn't process the subject again mail.expects(:subject).never assert_equal s, mms.subject end def test_subject_with_bad_mail_subject mail = stub_mail mail.stubs(:subject).returns(nil) mms = MMS2R::Media.new(mail) assert_equal '', mms.subject end def test_subject_with_subject_ignored s = 'hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) mms.stubs(:config).returns({'ignore' => {'text/plain' => [s]}}) assert_equal '', mms.subject end def test_subject_with_subject_transformed s = 'Default Subject: hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) mms.stubs(:config).returns( { 'ignore' => {}, 'transform' => {'text/plain' => [[/Default Subject: (.+)/, '\1']]}}) assert_equal 'hello world', mms.subject end def test_attachment_should_return_nil_if_files_for_type_are_not_found mms = MMS2R::Media.new stub_mail mms.stubs(:media).returns({}) assert_nil mms.send(:attachment, ['text']) end def test_attachment_should_return_nil_if_empty_files_are_found mms = MMS2R::Media.new stub_mail mms.stubs(:media).returns({'text/plain' => [Tempfile.new('test')]}) assert_nil mms.send(:attachment, ['text']) end def test_type_from_filename mms = MMS2R::Media.new stub_mail assert_equal 'image/jpeg', mms.send(:type_from_filename, "example.jpg") end def test_type_from_filename_should_be_nil mms = MMS2R::Media.new stub_mail assert_nil mms.send(:type_from_filename, "example.example") end def test_attachment_should_return_duck_typed_file mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") size = File.size(temp_text_file("hello world")) temp_small = temp_text_file("hello") mms.stubs(:media).returns({'text/plain' => [temp_small, temp_big]}) duck_file = mms.send(:attachment, ['text']) assert_not_nil duck_file assert_equal true, File::exist?(duck_file) assert_equal true, File::exist?(temp_big) assert_equal temp_big, duck_file.local_path assert_equal File.basename(temp_big), duck_file.original_filename assert_equal size, duck_file.size assert_equal 'text/plain', duck_file.content_type end def test_empty_body mms = MMS2R::Media.new stub_mail mms.stubs(:default_text).returns(nil) assert_equal "", mms.body end def test_body mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") mms.stubs(:default_text).returns(File.new(temp_big)) body = mms.body assert_equal "hello world", body end def test_body_when_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") mms.stubs(:default_html).returns(File.new(temp_big)) assert_equal "hello world teapot", mms.body end def test_default_text mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'text/plain' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_text.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_text.local_path end def test_default_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") temp_small = temp_text_file("<html><head><title>hello</title></head><body>world<body></html>") mms.stubs(:media).returns({'text/html' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_html.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_html.local_path end def test_default_media mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'image/jpeg' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_media.local_path end def test_default_media_treats_image_and_video_equally mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big_image = temp_text_file("hello world") temp_small_image = temp_text_file("hello") temp_big_video = temp_text_file("hello world again") temp_small_video = temp_text_file("hello again") mms.stubs(:media).returns({'image/jpeg' => [temp_small_image, temp_big_image], 'video/mpeg' => [temp_small_video, temp_big_video], }) assert_equal temp_big_video, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big_video, mms.default_media.local_path end #def test_default_media_treats_gif_and_jpg_equally # #it doesn't matter that these are text files, we just need say they are images # temp_big = temp_text_file("hello world") # temp_small = temp_text_file("hello") # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/jpeg' => [temp_big], 'image/gif' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/gif' => [temp_big], 'image/jpg' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path #end def test_purge mms = MMS2R::Media.new stub_mail mms.purge assert_equal false, File.exist?(mms.media_dir) end def test_ignore_media_by_filename_equality name = 'foo.txt' type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [name]}}) # type is not in the ingore part = stub(:body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and filename are in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal true, mms.ignore_media?(type, part) # type but not file name are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_filename name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'foo.txt', mms.filename?(part) end def test_long_filename name = 'x' * 300 + '.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'x' * 251 + '.txt', mms.filename?(part) end def test_filename_when_file_extension_missing_part name = 'foo' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.txt', mms.filename?(part) name = 'foo.janky' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.janky.txt', mms.filename?(part) end def test_ignore_media_by_filename_regexp name = 'foo.txt' regexp = /foo\.txt/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [regexp, 'nil.txt']}}) # type is not in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the filename are in the ingore part = stub(:filename => name) assert_equal true, mms.ignore_media?(type, part) # type but not regexp for filename are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_by_regexp_on_file_content name = 'foo.txt' content = "aaaaaaahello worldbbbbbbbbb" regexp = /.*Hello World.*/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => ['nil.txt', regexp]}}) part = stub(:filename => name, :body => Mail::Body.new(content)) # type is not in the ingore assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the content are in the ingore assert_equal true, mms.ignore_media?(type, part) # type but not regexp for content are in the ignore part = stub(:filename => name, :body => Mail::Body.new('no teapots')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_when_file_content_is_empty mms = MMS2R::Media.new stub_mail # there is no conf but the part's body is empty part = stub(:filename => 'foo.txt', :body => Mail::Body.new) assert_equal true, mms.ignore_media?('text/test', part) # there is no conf but the part's body is white space part = stub(:filename => 'foo.txt', :body => Mail::Body.new("\t\n\t\n ")) assert_equal true, mms.ignore_media?('text/test', part) end def test_add_file mail = stub_mail mail.stubs(:from).returns(['[email protected]']) mms = MMS2R::Media.new(mail) mms.stubs(:media).returns({}) assert_nil mms.media['text/html'] mms.add_file('text/html', '/tmp/foo.html') assert_equal ['/tmp/foo.html'], mms.media['text/html'] mms.add_file('text/html', '/tmp/bar.html') assert_equal ['/tmp/foo.html', '/tmp/bar.html'], mms.media['text/html'] end def test_temp_file name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal name, File.basename(mms.temp_file(part)) end def test_process_media_for_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', 'hello world']) result = mms.process_media(part) assert_equal 'text/plain', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_with_empty_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', '']) assert_equal ['text/plain', nil], mms.process_media(part) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_application_smil name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['application/smil', nil]) part = stub(:filename => name, :content_type => 'application/smil', :part_type? => 'application/smil', :main_type => 'application') assert_equal ['application/smil', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['application/smil', 'hello world']) result = mms.process_media(part) assert_equal 'application/smil', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_application_octet_stream_when_image name = 'fake.jpg' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'application/octet-stream', :part_type? => 'application/octet-stream', :body => Mail::Body.new("data"), :main_type => 'application') result = mms.process_media(part) assert_equal 'image/jpeg', result.first assert_match(/fake\.jpg$/, result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_all_other_media name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :main_type => 'faux', :part_type? => 'faux/text', :body => Mail::Body.new(nil)) assert_equal ['faux/text', nil], mms.process_media(part) part = stub(:filename => name, :main_type => 'faux', :part_type? => 'faux/text', :body => Mail::Body.new('hello world')) result = mms.process_media(part) assert_equal 'faux/text', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process mms = MMS2R::Media.new stub_mail assert_equal 1, mms.media.size assert_not_nil mms.media['text/plain'] assert_equal 1, mms.media['text/plain'].size assert_equal true, File.exist?(mms.media['text/plain'].first) assert_equal 1, File.size(mms.media['text/plain'].first) mms.purge end def test_process_with_multipart_double_parts mail = mail('apple-double-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_not_nil mms.media['application/applefile'] assert_equal 1, mms.media['application/applefile'].size assert_not_nil mms.media['image/jpeg'] assert_equal 1, mms.media['image/jpeg'].size assert_match(/DSCN1715\.jpg$/, mms.media['image/jpeg'].first) assert_file_size mms.media['image/jpeg'].first, 337 mms.purge end def test_process_with_multipart_alternative_parts mail = stub_mail plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new('a'), :main_type => 'text') plain.stubs(:multipart?).at_least_once.returns(false) html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new('a'), :main_type => 'text') html.stubs(:multipart?).at_least_once.returns(false) multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) multi.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:parts).at_least_once.returns([multi]) # the multipart/alternative should get flattend to text and html mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_equal 2, mms.media.size assert_not_nil mms.media['text/plain'] assert_not_nil mms.media['text/html'] assert_equal 1, mms.media['text/plain'].size assert_equal 1, mms.media['text/html'].size assert_equal 'message.txt', File.basename(mms.media['text/plain'].first) assert_equal 'message.html', File.basename(mms.media['text/html'].first) assert_equal true, File.exist?(mms.media['text/plain'].first) assert_equal true, File.exist?(mms.media['text/html'].first) assert_equal 1, File.size(mms.media['text/plain'].first) assert_equal 1, File.size(mms.media['text/html'].first) mms.purge end def test_process_when_media_is_ignored mail = stub_mail plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new(''), :main_type => 'text') plain.stubs(:multipart?).at_least_once.returns(false) html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new(''), :main_type => 'text') html.stubs(:multipart?).at_least_once.returns(false) multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) multi.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:parts).at_least_once.returns([multi]) mms = MMS2R::Media.new(mail, :process => :lazy) mms.stubs(:config).returns({'ignore' => {'text/plain' => ['message.txt'], 'text/html' => ['message.html']}}) assert_nothing_raised { mms.process } # the multipart/alternative should get flattend to text and html and then # what's flattened is ignored assert_equal 0, mms.media.size mms.purge end def test_process_when_yielding_to_a_block mail = stub_mail plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new('a'), :main_type => 'text') plain.stubs(:multipart?).at_least_once.returns(false) html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new('b'), :main_type => 'text') html.stubs(:multipart?).at_least_once.returns(false) multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) multi.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:parts).at_least_once.returns([multi]) # the multipart/alternative should get flattend to text and html mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size mms.process do |type, files| assert_equal 1, files.size assert_equal true, type == 'text/plain' || type == 'text/html' - assert_equal true, File.basename(files.first) == 'message.txt' || + assert_equal true, File.basename(files.first) == 'message.txt' || File.basename(files.first) == 'message.html' assert_equal true, File::exist?(files.first) end mms.purge end def test_domain_from_return_path mail = mock() mail.expects(:from).at_least_once.returns([]) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'null.example.com', domain end def test_domain_from_from mail = mock() mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'null.example.com', domain end def test_domain_from_from_yaml f = File.join(MMS2R::Media.conf_dir, 'from.yml') YAML.expects(:load_file).once.with(f).returns(['example.com']) mail = mock() mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'example.com', domain end def test_unknown_device_type mail = mail('generic.mail') mms = MMS2R::Media.new(mail) assert_equal :unknown, mms.device_type? assert_equal false, mms.is_mobile? end def test_iphone_device_type_by_header iphones = ['att-iphone-01.mail', 'iphone-image-01.mail'] iphones.each do |iphone| mail = mail(iphone) mms = MMS2R::Media.new(mail) assert_equal :iphone, mms.device_type?, "fixture #{iphone} was not a iphone" assert_equal true, mms.is_mobile? end end def test_exif mail = smart_phone_mock mms = MMS2R::Media.new(mail) assert_equal 'iPhone', mms.exif.model end def test_iphone_device_type_by_exif mail = smart_phone_mock mms = MMS2R::Media.new(mail) assert_equal :iphone, mms.device_type? assert_equal true, mms.is_mobile? end def test_faux_tiff_iphone_device_type_by_exif mail = smart_phone_mock('Apple', 'iPhone', nil, jpeg = false) mms = MMS2R::Media.new(mail) assert_equal :iphone, mms.device_type? assert_equal true, mms.is_mobile? end def test_iphone_device_type_by_filename_jpg mail = smart_phone_mock('Hipstamatic', '201') mms = MMS2R::Media.new(mail) assert_equal :apple, mms.device_type? assert_equal true, mms.is_mobile? end def test_iphone_device_type_by_filename_png mail = mail('iphone-image-02.mail') mms = MMS2R::Media.new(mail) assert_equal true, mms.is_mobile? assert_equal :iphone, mms.device_type? end def test_blackberry_device_type_by_exif_make_model mail = smart_phone_mock('Research In Motion', 'BlackBerry') mms = MMS2R::Media.new(mail) assert_equal :blackberry, mms.device_type? assert_equal true, mms.is_mobile? end def test_blackberry_device_type_by_exif_software mail = smart_phone_mock(nil, nil, "Rim Exif Version1.00a") mms = MMS2R::Media.new(mail) assert_equal :blackberry, mms.device_type? assert_equal true, mms.is_mobile? end def test_dash_device_type_by_exif mail = smart_phone_mock('T-Mobile Dash', 'T-Mobile Dash') mms = MMS2R::Media.new(mail) assert_equal :dash, mms.device_type? assert_equal true, mms.is_mobile? end def test_droid_device_type_by_exif mail = smart_phone_mock('Motorola', 'Droid') mms = MMS2R::Media.new(mail) assert_equal :droid, mms.device_type? assert_equal true, mms.is_mobile? end def test_htc_eris_device_type_by_exif mail = smart_phone_mock('HTC', 'Eris') mms = MMS2R::Media.new(mail) assert_equal :htc, mms.device_type? assert_equal true, mms.is_mobile? end def test_htc_hero_device_type_by_exif mail = smart_phone_mock('HTC', 'HERO200') mms = MMS2R::Media.new(mail) assert_equal :htc, mms.device_type? assert_equal true, mms.is_mobile? end def test_android_app_by_exif mail = smart_phone_mock('Retro Camera Android', "Xoloroid 2000") mms = MMS2R::Media.new(mail) assert_equal :android, mms.device_type? assert_equal true, mms.is_mobile? end def test_handsets_by_exif handsets = YAML.load_file(fixture('handsets.yml')) handsets.each do |handset| mail = smart_phone_mock(handset.first, handset.last) mms = MMS2R::Media.new(mail) assert_equal true, mms.is_mobile?, "mms with make #{mms.exif.make}, and model #{mms.exif.model}, should be considered a mobile device" end end def test_blackberry_device_type berries = ['att-blackberry.mail', 'suncom-blackberry.mail', 'tmobile-blackberry-02.mail', 'tmobile-blackberry.mail', 'tmo.blackberry.net-image-01.mail', 'verizon-blackberry.mail', 'verizon-blackberry.mail'] berries.each do |berry| mms = MMS2R::Media.new(mail(berry)) assert_equal :blackberry, mms.device_type?, "fixture #{berry} was not a blackberrry" assert_equal true, mms.is_mobile? end end def test_handset_device_type mail = mail('att-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal :handset, mms.device_type? assert_equal true, mms.is_mobile? end end diff --git a/test/test_pm_sprint_com.rb b/test/test_pm_sprint_com.rb index 9edd048..372ccf6 100644 --- a/test/test_pm_sprint_com.rb +++ b/test/test_pm_sprint_com.rb @@ -1,317 +1,317 @@ require "test_helper" class TestPmSprintCom < Test::Unit::TestCase include MMS2R::TestHelper def mock_sprint_image(message_id) response = mock('response') body = mock('body') connection = mock('connection') response.expects(:content_type).twice.returns('image/jpeg') response.expects(:body).returns(body) response.expects(:code).never Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection connection.expects(:get2).with( # 1.9.2 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90&ext=.jpg&iconifyVideo=true&wm=1' # 1.8.7 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&outquality=90&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU' kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).once.returns(response) end def mock_sprint_purged_image(message_id) response = mock('response') body = mock('body') connection = mock('connection') response.expects(:content_type).once.returns('text/html') response.expects(:body).returns(body) response.expects(:code).once.returns('500') Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection connection.expects(:get2).with( # 1.9.2 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90&ext=.jpg&iconifyVideo=true&wm=1' # 1.8.7 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&outquality=90&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU' kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).once.returns(response) end - + def mock_sprint_ajax response = mock('response') body = mock('body') # this is a response from a real sprint message file = File.open("./test/fixtures/sprint-ajax-response-success.json", "rb") json = file.read body.expects(:to_str).returns json connection = mock('connection') connection.stubs(:use_ssl=).returns(true) response.expects(:body).twice.returns(body) response.expects(:code).once.returns('200') response.expects(:content_type).twice.returns('text/html') Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).twice.returns connection connection.expects(:get2).with( # 1.9.2 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90&ext=.jpg&iconifyVideo=true&wm=1' # 1.8.7 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&outquality=90&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU' kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).twice.returns(response) end def mock_sprint_ajax_purged response = mock('response') body = mock('body') # this is a response from a real sprint message file = File.open("./test/fixtures/sprint-ajax-response-failure.html", "rb") error_html = file.read body.expects(:to_str).returns error_html connection = mock('connection') connection.stubs(:use_ssl=).returns(true) response.expects(:body).twice.returns(body) response.expects(:code).once.returns('500') response.expects(:content_type).once.returns('text/html') Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).twice.returns connection connection.expects(:get2).with( # 1.9.2 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90&ext=.jpg&iconifyVideo=true&wm=1' # 1.8.7 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&outquality=90&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU' kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).twice.returns(response) - end - + end + def test_mms_should_have_text mail = mail('sprint-text-01.mail') mms = MMS2R::Media.new(mail) assert_equal "2068765309", mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_equal 1, mms.media['text/plain'].size file = mms.media['text/plain'].first assert_equal true, File.exist?(file) assert_match(/\.txt$/, File.basename(file)) assert_equal "Tea Pot", IO.read(file) mms.purge end def test_mms_should_have_a_phone_number mail = mail('sprint-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier mms.purge end def test_should_have_simple_video mail = mail('sprint-video-01.mail') response = mock('response') body = mock('body') connection = mock('connection') response.expects(:content_type).twice.returns('video/quicktime') response.expects(:body).returns(body) response.expects(:code).never Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection connection.expects(:get2).with( kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).once.returns(response) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_not_nil mms.media['video/quicktime'] assert_equal 1, mms.media['video/quicktime'].size assert_equal "000_259e41e851be9b1d_1-0.mov", File.basename(mms.media['video/quicktime'][0]) mms.purge end def test_should_have_simple_image mail = mail('sprint-image-01.mail') mock_sprint_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_not_nil mms.media['image/jpeg'][0] assert_match(/001_2066c7013e7ca833_1-0.jpg$/, mms.media['image/jpeg'][0]) mms.purge end def test_collect_image_using_block mail = mail('sprint-image-01.mail') mock_sprint_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size file_array = nil mms.process do |k, v| file_array = v if (k == 'image/jpeg') assert_equal 1, file_array.size file = file_array.first assert_not_nil file = file_array.first assert_equal "001_2066c7013e7ca833_1-0.jpg", File.basename(file) end mms.purge end def test_process_internals_should_only_be_executed_once mail = mail('sprint-image-01.mail') mock_sprint_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size # second time through shouldn't go into the was_processed block mms.mail.expects(:parts).never mms.process{|k, v| } mms.purge end def test_should_have_two_images mail = mail('sprint-two-images-01.mail') response = mock('response') body = mock('body') connection = mock('connection') response.expects(:content_type).times(4).returns('image/jpeg') response.expects(:body).twice.returns(body) response.expects(:code).never Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).twice.returns connection connection.expects(:get2).with( kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).twice.returns(response) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_equal 2, mms.media['image/jpeg'].size assert_not_nil mms.media['image/jpeg'][0] assert_not_nil mms.media['image/jpeg'][1] assert_match(/001_104058d23d79fb6a_1-0.jpg$/, mms.media['image/jpeg'][0]) assert_match(/001_104058d23d79fb6a_1-1.jpg$/, mms.media['image/jpeg'][1]) mms.purge end def test_image_should_be_missing # this test is questionable mail = mail('sprint-broken-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 0, mms.media.size mms.purge end def test_message_is_missing_in_mail # this test is questionable mail = mail('sprint-image-missing-message.mail') mock_sprint_ajax mms = MMS2R::Media.new(mail) assert_equal 1, mms.media['text/plain'].size # test that the message was extracted from the ajax response message = IO.readlines(mms.media['text/plain'].first).join("") assert_equal "Just testing the caption on Sprint", message mms.purge end - + def test_message_is_missing_in_mail_purged_from_content_server # this test is questionable mail = mail('sprint-image-missing-message.mail') mock_sprint_ajax_purged mms = MMS2R::Media.new(mail) assert_equal '5135455555', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 0, mms.media.size mms.purge end - + def test_image_should_be_purged_from_content_server mail = mail('sprint-image-01.mail') mock_sprint_purged_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 0, mms.media.size mms.purge end def test_body_should_return_empty_when_there_is_no_user_text mail = mail('sprint-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal "", mms.body end def test_sprint_write_file mail = mock(:message_id => 'a') mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') mms = MMS2R::Media.new(mail, :process => :lazy) type = 'text/plain' content = 'foo' file = Tempfile.new('sprint') file.close type, file = mms.send(:sprint_write_file, type, content, file.path) assert_equal 'text/plain', type assert_equal content, IO.read(file) end def test_subject mail = mail('sprint-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal "", mms.subject end def test_new_subject mail = mail('sprint-new-image-01.mail') mock_sprint_ajax mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal "", mms.subject end end
monde/mms2r
886c61c0c9d4c126f5206d5148364e05971b8bcc
Don't open up Object if someone else already has put a #blank? or #present? on the class.
diff --git a/lib/ext/object.rb b/lib/ext/object.rb index 70dbc56..85a0d8f 100644 --- a/lib/ext/object.rb +++ b/lib/ext/object.rb @@ -1,11 +1,19 @@ class Object - def blank? - respond_to?(:empty?) ? empty? : !self + unless respond_to?(:blank?) + + def blank? + respond_to?(:empty?) ? empty? : !self + end + end - def present? - !blank? + unless respond_to?(:present?) + + def present? + !blank? + end + end end
monde/mms2r
3b3865ca627b21bdd273201bc5ea07a4f3ef1a7a
clean out some white space
diff --git a/lib/mms2r/media/sprint.rb b/lib/mms2r/media/sprint.rb index c9e9ceb..8df6c6f 100644 --- a/lib/mms2r/media/sprint.rb +++ b/lib/mms2r/media/sprint.rb @@ -1,247 +1,248 @@ #-- # Copyright (c) 2007-2010 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ require 'net/http' require 'nokogiri' require 'cgi' require 'json' module MMS2R class Media ## # Sprint version of MMS2R::Media # # Sprint is an annoying carrier because they don't actually transmit user # generated content (like images or videos) directly in the MMS message. # Instead, they hijack the media that is sent from the cellular subscriber # and place that content on a content server. In place of the media # the recipient receives a HTML message with unsolicited Sprint # advertising and links back to their content server. The recipient has # to click through Sprint more pages to view the content. # # The default subject on these messages from the # carrier is "You have new Picture Mail!" module Sprint ## # Override process() because Sprint doesn't attach media (images, video, # etc.) to its MMS. Media such as images and videos are hosted on a # Sprint content server. MMS2R::Media::Sprint has to pick apart an # HTML attachment to find the URL to the media on Sprint's content # server and download each piece of content. Any text message part of # the MMS if it exists is embedded in the html. def process unless @was_processed log("#{self.class} processing", :info) #sprint MMS are multipart parts = @mail.parts #find the payload html doc = nil parts.each do |p| next unless p.part_type? == 'text/html' d = Nokogiri(p.body.decoded) title = d.at('title').inner_html if title =~ /You have new Picture Mail!/ doc = d @is_video = (p.body.decoded =~ /type=&quot;VIDEO&quot;&gt;/m ? true : false) end end return if doc.nil? # it was a dud @is_video ||= false # break it down sprint_phone_number(doc) sprint_process_text(doc) sprint_process_media(doc) @was_processed = true end # when process acts upon a block if block_given? media.each do |k, v| yield(k, v) end end end private ## # Digs out where Sprint hides the phone number def sprint_phone_number(doc) c = doc.search("/html/head/comment()").last t = c.content.gsub(/\s+/m," ").strip #@number returned in parent's #number @number = / name=&quot;MDN&quot;&gt;(\d+)&lt;/.match(t)[1] end ## # Pulls out the user text form the MMS and adds the text to media hash def sprint_process_text(doc) # there is at least one <pre> with MMS text if text has been included by # the user. (note) we'll have to verify that if they attach multiple texts # to the MMS then Sprint stacks it up in multiple <pre>'s. The only <pre> # tag in the document is for text from the user. - # if there is no text media found in the mail body - then we go to more + # if there is no text media found in the mail body - then we go to more # extreme measures. text_found = false - + doc.search("/html/body//pre").each do |pre| type = 'text/plain' text = pre.inner_html.strip next if text.empty? + text_found = true type, text = transform_text(type, text) type, file = sprint_write_file(type, text.strip) add_file(type, file) unless type.nil? || file.nil? end # if no text was found, there still might be a message with images - # that can be seen at the end of the "View Entire Message" link + # that can be seen at the end of the "View Entire Message" link if !text_found view_entire_message_link = doc.search("a").find { |link| link.inner_html == "View Entire Message"} # if we can't find the view entire message link, give up if view_entire_message_link # Sprint uses AJAX/json to serve up the content at the end of the link so this is conveluted url = view_entire_message_link.attr("href") # extract the "invite" param out of the url - this will be the id we pass to the ajax path below inviteMessageId = CGI::parse(URI::parse(url).query)["invite"].first - + if inviteMessageId json_url = "http://pictures.sprintpcs.com/ui-refresh/guest/getMessageContainerJSON.do%3FcomponentType%3DmediaDetail&invite=#{inviteMessageId}&externalMessageId=#{inviteMessageId}" # pull down the json from the url and parse it uri = URI.parse(json_url) connection = Net::HTTP.new(uri.host, uri.port) response = connection.get2( uri.request_uri, { "User-Agent" => MMS2R::Media::USER_AGENT } ) content = response.body - + # if the content has expired, sprint sends back html "content expired page # json will fail to parse begin json = JSON.parse(content) - + # there may be multiple "results" in the json - due to multiple images - # cycle through them and extract the "description" which is the text + # cycle through them and extract the "description" which is the text # message the sender sent with the images - json["Results"].each do |result| + json["Results"].each do |result| type = 'text/plain' text = result["description"] ? result["description"].strip : nil next if text.empty? type, text = transform_text(type, text) type, file = sprint_write_file(type, text.strip) add_file(type, file) unless type.nil? || file.nil? end rescue JSON::ParserError => e log("#{self.class} processing error, #{$!}", :error) end end end - end + end end ## # Fetch all the media that is referred to in the doc def sprint_process_media(doc) srcs = Array.new # collect all the images in the document, even though # they are <img> tag some might actually refer to video. # To know the link refers to vide one must look at the # content type on the http GET response. imgs = doc.search("/html/body//img") imgs.each do |i| src = i.attributes['src'] next unless src src = src.text # we don't want to double fetch content and we only # want to fetch media from the content server, you get # a clue about that as there is a RECIPIENT in the URI path # of real content next unless /mmps\/RECIPIENT\//.match(src) next if srcs.detect{|s| s.eql?(src)} srcs << src end #we've got the payload now, go fetch them cnt = 0 srcs.each do |src| begin uri = URI.parse(CGI.unescapeHTML(src)) unless @is_video query={} uri.query.split('&').each{|a| p=a.split('='); query[p[0]] = p[1]} query.delete_if{|k, v| k == 'limitsize' || k == 'squareoutput' } uri.query = query.map{|k,v| "#{k}=#{v}"}.join("&") end # sprint is a ghetto, they expect to see &amp; for video request uri.query = uri.query.gsub(/&/, "&amp;") if @is_video connection = Net::HTTP.new(uri.host, uri.port) #connection.set_debug_output $stdout response = connection.get2( uri.request_uri, { "User-Agent" => MMS2R::Media::USER_AGENT } ) content = response.body rescue StandardError => err log("#{self.class} processing error, #{$!}", :error) next end # if the Sprint content server uses response code 500 when the content is purged # the content type will text/html and the body will be the message if response.content_type == 'text/html' && response.code == "500" log("Sprint content server returned response code 500", :error) next end # setup the file path and file base = /\/RECIPIENT\/([^\/]+)\//.match(src)[1] type = response.content_type file_name = "#{base}-#{cnt}.#{self.class.default_ext(type)}" file = File.join(msg_tmp_dir(),File.basename(file_name)) # write it and add it to the media hash type, file = sprint_write_file(type, content, file) add_file(type, file) unless type.nil? || file.nil? cnt = cnt + 1 end end ## # Creates a temporary file based on the type def sprint_temp_file(type) file_name = "#{Time.now.to_f}.#{self.class.default_ext(type)}" File.join(msg_tmp_dir(),File.basename(file_name)) end ## # Writes the content to a file and returns the type, file as a tuple. def sprint_write_file(type, content, file = nil) file = sprint_temp_file(type) if file.nil? log("#{self.class} writing file #{file}", :info) # force the encoding to be utf-8 content = content.force_encoding("UTF-8") if content.respond_to?(:force_encoding) File.open(file,'w'){ |f| f.write(content) } return type, file end end end end
monde/mms2r
2bb66ed420c8013668a618e96fda29c3d03ed48b
strip a variation of the iphone default footer
diff --git a/conf/mms2r_media.yml b/conf/mms2r_media.yml index 3ecd090..4d78f4e 100644 --- a/conf/mms2r_media.yml +++ b/conf/mms2r_media.yml @@ -1,79 +1,79 @@ --- ignore: text/plain: - !ruby/regexp /^\(no subject\)$/i - !ruby/regexp /\ASent via BlackBerry (from|by) .*$/im - !ruby/regexp /\ASent from my Windows Phone.*$/im - !ruby/regexp /\ASent from my Verizon Wireless BlackBerry$/im - - !ruby/regexp /\ASent from (my|your) iPhone.?$/im + - !ruby/regexp /\ASent (via|(from (my|your))) iPhone.?$/im - !ruby/regexp /\ASent on the Sprint.* Now Network.*$/im multipart/mixed: - !ruby/regexp "/^Attachment: /i" transform: text/plain: - - !ruby/regexp /\A(.*?)Sent via BlackBerry (from|by) .*$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from my Windows Phone.*$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from my Verizon Wireless BlackBerry$/im - "\\1" - - - !ruby/regexp /\A(.*?)Sent from (my|your) iPhone.?$/im + - - !ruby/regexp /\A(.*?)Sent (via|(from (my|your))) iPhone.?$/im - "\\1" - - !ruby/regexp /\A(.*?)\s+image\/jpeg$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent on the Sprint.* Now Network.*$/im - "\\1" device_types: boundary: :motorola: !ruby/regexp /Motorola-A-Mail/i headers: x-mailer: :iphone: !ruby/regexp /iPhone Mail/i :blackberry: !ruby/regexp /Palm webOS/i mime-version: :iphone: !ruby/regexp /iPhone Mail/i x-rim-org-msg-ref-id: :blackberry: !ruby/regexp /.+/ user-agent: :iphone: !ruby/regexp /iPhone/i # TODO do something about the assortment of camera models that have # been seen: # 1.3 Megapixel, 2.0 Megapixel, BlackBerry, CU920, G'z One TYPE-S, # Hermes, iPhone, LG8700, LSI_S5K4AAFA, Micron MT9M113 1.3MP YUV, # Motorola Phone, Omni_vision-9650, Pre, # Seoul Electronics & Telecom SIM120B 1.3M, SGH-T729, SGH-T819, # SPH-M540, SPH-M800, SYSTEMLSI S5K4BAFB 2.0 MP, VX-9700 # # NOTE: These model strings are stored in the exif model header of an image file # created and sent by the device, the regex is used by mms2r to detect the # model string makes: :android: !ruby/regexp /Android/i :apple: !ruby/regexp /^(Apple|Hipstamatic)$/i :casio: !ruby/regexp /^CASIO$/i :dash: !ruby/regexp /T-Mobile Dash/i :google: !ruby/regexp /^google$/i :htc: !ruby/regexp /^HTC/i :lge: !ruby/regexp /^(LG|CX87BL05)/i :motorola: !ruby/regexp /^Motorola/i :nokia: !ruby/regexp /^Nokia/i :pantech: !ruby/regexp /^PANTECH$/i :palm: !ruby/regexp /Palm/i :qualcomm: !ruby/regexp /^MSM6/i :research_in_motion: !ruby/regexp /^(RIM|Research In Motion)$/i :samsung: !ruby/regexp /^(SAMSUNG|ES.M800|M6550B-SAM-4480)/i :seoul_electronics: !ruby/regexp /^ISUS0/i :sprint: !ruby/regexp /^Sprint$/i :utstarcom: !ruby/regexp /^T1A_UC1.88$/i models: :blackberry: !ruby/regexp /BlackBerry/i :centro: !ruby/regexp /^Palm Centro$/i :dash: !ruby/regexp /T-Mobile Dash/i :droid: !ruby/regexp /Droid/i :htc: !ruby/regexp /HTC|Eris|HERO200/i :iphone: !ruby/regexp /iPhone/i software: :blackberry: !ruby/regexp /^Rim Exif/i filenames: :iphone: !ruby/regexp /^photo\.(JPG|PNG)$/ :video: !ruby/regexp /\.3gp$/ diff --git a/test/test_mms2r_media.rb b/test/test_mms2r_media.rb index 5dd4389..d9f923d 100644 --- a/test/test_mms2r_media.rb +++ b/test/test_mms2r_media.rb @@ -1,710 +1,711 @@ # encoding: UTF-8 require "test_helper" class TestMms2rMedia < Test::Unit::TestCase include MMS2R::TestHelper def use_temp_dirs MMS2R::Media.tmp_dir = @tmpdir MMS2R::Media.conf_dir = @confdir end def setup @oldtmpdir = MMS2R::Media.tmp_dir || File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") @oldconfdir = MMS2R::Media.conf_dir || File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") FileUtils.mkdir_p(@oldtmpdir) FileUtils.mkdir_p(@oldconfdir) @tmpdir = File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") FileUtils.mkdir_p(@tmpdir) @confdir = File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") FileUtils.mkdir_p(@confdir) end def teardown FileUtils.rm_rf(@tmpdir) FileUtils.rm_rf(@confdir) MMS2R::Media.tmp_dir = @oldtmpdir MMS2R::Media.conf_dir = @oldconfdir end def stub_mail(vals = {}) attrs = { :from => '[email protected]', :to => '[email protected]', :subject => 'This is a test email', :body => 'a', }.merge(vals) Mail.new do from attrs[:from] to attrs[:to] subject attrs[:subject] body attrs[:body] end end def test_faux_user_agent assert_equal "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.120 Safari/535.2", MMS2R::Media::USER_AGENT end def test_class_parse mms = mail('generic.mail') assert_equal ['[email protected]'], mms.from end def temp_text_file(text) tf = Tempfile.new("test" + rand.to_s) tf.puts(text) tf.close tf.path end def test_tmp_dir use_temp_dirs() MMS2R::Media.tmp_dir = @tmpdir assert_equal @tmpdir, MMS2R::Media.tmp_dir end def test_conf_dir use_temp_dirs() MMS2R::Media.conf_dir = @confdir assert_equal @confdir, MMS2R::Media.conf_dir end def test_safe_message_id mid1_b="1234abcd" mid1_a="1234abcd" mid2_b="<01234567.0123456789012.JavaMail.fooba@foo-bars999>" mid2_a="012345670123456789012JavaMailfoobafoo-bars999" assert_equal mid1_a, MMS2R::Media.safe_message_id(mid1_b) assert_equal mid2_a, MMS2R::Media.safe_message_id(mid2_b) end def test_default_ext assert_equal nil, MMS2R::Media.default_ext(nil) assert_equal 'text', MMS2R::Media.default_ext('text') assert_equal 'txt', MMS2R::Media.default_ext('text/plain') assert_equal 'test', MMS2R::Media.default_ext('example/test') end def test_base_initialize_config_tries_to_open_default_config_yaml f = File.join(MMS2R::Media.conf_dir, 'mms2r_media.yml') YAML.expects(:load_file).once.with(f).returns({}) config = MMS2R::Media.initialize_config(nil) end def test_base_initialize_config config = MMS2R::Media.initialize_config(nil) # test defaults shipped in mms2r_media.yml assert_not_nil config assert_equal true, config['ignore'].is_a?(Hash) assert_equal true, config['transform'].is_a?(Hash) assert_equal true, config['number'].is_a?(Array) end def test_instance_initialize_config mms = MMS2R::Media.new stub_mail config = mms.initialize_config(nil) # test defaults shipped in mms2r_media.yml assert_not_nil config assert_equal true, config['ignore'].is_a?(Hash) assert_equal true, config['transform'].is_a?(Hash) assert_equal true, config['number'].is_a?(Array) end def test_initialize_config_contatenation c = {'ignore' => {'text/plain' => [/A TEST/]}, 'transform' => {'text/plain' => [/FOO/, '']}, 'number' => ['from', /^([^\s]+)\s.*/, '\1'] } config = MMS2R::Media.initialize_config(c) assert_not_nil config['ignore']['text/plain'].detect{|v| v == /A TEST/} assert_not_nil config['transform']['text/plain'].detect{|v| v == /FOO/} assert_not_nil config['number'].first == 'from' end def test_aliased_new_returns_default_processor_instance mms = MMS2R::Media.new stub_mail assert_not_nil mms assert_equal true, mms.respond_to?(:process) assert_equal MMS2R::Media, mms.class end def test_lazy_process_option mms = MMS2R::Media.new stub_mail, :process => :lazy mms.expects(:process).never end def test_logger_option logger = mock() logger.expects(:info).at_least_once mms = MMS2R::Media.new stub_mail, :logger => logger end def test_default_processor_initialize_tries_to_open_config_for_carrier mms_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'mms2r_media.yml')) aliases_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'aliases.yml')) from_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'from.yml')) example_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'example.com.yml')) YAML.expects(:load_file).at_least_once.with(mms_yaml).returns({}) YAML.expects(:load_file).at_least_once.with(aliases_yaml).returns({}) YAML.expects(:load_file).at_least_once.with(from_yaml).returns([]) YAML.expects(:load_file).never.with(example_yaml) mms = MMS2R::Media.new stub_mail end def test_mms_phone_number mail = stub_mail mail.stubs(:from).returns(['[email protected]']) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number end def test_mms_phone_number_from_config mail = stub_mail(:from => '"+2068675309" <[email protected]>') mms = MMS2R::Media.new(mail) mms.expects(:config).once.returns({'number' => ['from', /^([^\s]+)\s.*/, '\1']}) assert_equal '+2068675309', mms.number end def test_mms_phone_number_with_errors mail = stub_mail mail.stubs(:from).returns(nil) mms = MMS2R::Media.new(mail) assert_nothing_raised do assert_equal '', mms.number end end def test_transform_text_plain mail = stub_mail mail.stubs(:from).returns(nil) mms = MMS2R::Media.new(mail) type = 'test/type' text = 'hello' # no match in the config result = [type, text] assert_equal result, mms.transform_text(type, text) # testing the default config assert_equal ['text/plain', ''], mms.transform_text('text/plain', "Sent from my Windows Phone") assert_equal ['text/plain', ''], mms.transform_text('text/plain', "Sent via BlackBerry from T-Mobile") assert_equal ['text/plain', ''], mms.transform_text('text/plain', "Sent from my Verizon Wireless BlackBerry") + assert_equal ['text/plain', ''], mms.transform_text('text/plain', 'Sent via iPhone') assert_equal ['text/plain', ''], mms.transform_text('text/plain', 'Sent from my iPhone') assert_equal ['text/plain', ''], mms.transform_text('text/plain', 'Sent from your iPhone.') assert_equal ['text/plain', ''], mms.transform_text('text/plain', " \n\nimage/jpeg") # has a bad regexp mms.expects(:config).at_least_once.returns({'transform' => {type => [['(hello)', 'world']]}}) assert_equal result, mms.transform_text(type, text) # matches in config mms.expects(:config).at_least_once.returns({'transform' => {type => [[/(hello)/, 'world']]}}) assert_equal [type, 'world'], mms.transform_text(type, text) mms.expects(:config).at_least_once.returns({'transform' => {type => [[/^Ignore this part, (.+)/, '\1']]}}) assert_equal [type, text], mms.transform_text(type, "Ignore this part, " + text) # chaining transforms mms.expects(:config).at_least_once.returns({'transform' => {type => [[/(hello)/, 'world'], [/(world)/, 'mars']]}}) assert_equal [type, 'mars'], mms.transform_text(type, text) # has a Iconv problem mms.expects(:config).at_least_once.returns({'transform' => {type => [['(hello)', 'world']]}}) assert_equal result, mms.transform_text(type, text) end def test_transform_text_to_utf8 mail = mail('iconv-fr-text-01.mail') mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_equal 1, mms.media['text/plain'].size assert_equal 1, mms.media['text/html'].size file = mms.media['text/plain'][0] assert_not_nil file assert_equal true, File::exist?(file) text_lines = IO.readlines("#{file}") text = text_lines.join # ASCII-8BIT -> D'ici un mois G\xE9orgie # UTF-8 -> D'ici un mois Géorgie if RUBY_VERSION < "1.9" assert_equal("sample email message Fwd: sub D'ici un mois Géorgie", mms.subject) assert_equal("D'ici un mois Géorgie body", text_lines.first.strip) else assert_equal(Iconv.new('UTF-8', 'ISO-8859-1').iconv("sample email message Fwd: sub D'ici un mois Géorgie"), mms.subject) assert_equal(Iconv.new('UTF-8', 'ISO-8859-1').iconv("D'ici un mois G\xE9orgie body"), text_lines.first.strip) end end def test_subject s = 'hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) assert_equal s, mms.subject # second time through shouldn't process the subject again mail.expects(:subject).never assert_equal s, mms.subject end def test_subject_with_bad_mail_subject mail = stub_mail mail.stubs(:subject).returns(nil) mms = MMS2R::Media.new(mail) assert_equal '', mms.subject end def test_subject_with_subject_ignored s = 'hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) mms.stubs(:config).returns({'ignore' => {'text/plain' => [s]}}) assert_equal '', mms.subject end def test_subject_with_subject_transformed s = 'Default Subject: hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) mms.stubs(:config).returns( { 'ignore' => {}, 'transform' => {'text/plain' => [[/Default Subject: (.+)/, '\1']]}}) assert_equal 'hello world', mms.subject end def test_attachment_should_return_nil_if_files_for_type_are_not_found mms = MMS2R::Media.new stub_mail mms.stubs(:media).returns({}) assert_nil mms.send(:attachment, ['text']) end def test_attachment_should_return_nil_if_empty_files_are_found mms = MMS2R::Media.new stub_mail mms.stubs(:media).returns({'text/plain' => [Tempfile.new('test')]}) assert_nil mms.send(:attachment, ['text']) end def test_type_from_filename mms = MMS2R::Media.new stub_mail assert_equal 'image/jpeg', mms.send(:type_from_filename, "example.jpg") end def test_type_from_filename_should_be_nil mms = MMS2R::Media.new stub_mail assert_nil mms.send(:type_from_filename, "example.example") end def test_attachment_should_return_duck_typed_file mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") size = File.size(temp_text_file("hello world")) temp_small = temp_text_file("hello") mms.stubs(:media).returns({'text/plain' => [temp_small, temp_big]}) duck_file = mms.send(:attachment, ['text']) assert_not_nil duck_file assert_equal true, File::exist?(duck_file) assert_equal true, File::exist?(temp_big) assert_equal temp_big, duck_file.local_path assert_equal File.basename(temp_big), duck_file.original_filename assert_equal size, duck_file.size assert_equal 'text/plain', duck_file.content_type end def test_empty_body mms = MMS2R::Media.new stub_mail mms.stubs(:default_text).returns(nil) assert_equal "", mms.body end def test_body mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") mms.stubs(:default_text).returns(File.new(temp_big)) body = mms.body assert_equal "hello world", body end def test_body_when_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") mms.stubs(:default_html).returns(File.new(temp_big)) assert_equal "hello world teapot", mms.body end def test_default_text mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'text/plain' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_text.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_text.local_path end def test_default_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") temp_small = temp_text_file("<html><head><title>hello</title></head><body>world<body></html>") mms.stubs(:media).returns({'text/html' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_html.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_html.local_path end def test_default_media mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'image/jpeg' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_media.local_path end def test_default_media_treats_image_and_video_equally mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big_image = temp_text_file("hello world") temp_small_image = temp_text_file("hello") temp_big_video = temp_text_file("hello world again") temp_small_video = temp_text_file("hello again") mms.stubs(:media).returns({'image/jpeg' => [temp_small_image, temp_big_image], 'video/mpeg' => [temp_small_video, temp_big_video], }) assert_equal temp_big_video, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big_video, mms.default_media.local_path end #def test_default_media_treats_gif_and_jpg_equally # #it doesn't matter that these are text files, we just need say they are images # temp_big = temp_text_file("hello world") # temp_small = temp_text_file("hello") # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/jpeg' => [temp_big], 'image/gif' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/gif' => [temp_big], 'image/jpg' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path #end def test_purge mms = MMS2R::Media.new stub_mail mms.purge assert_equal false, File.exist?(mms.media_dir) end def test_ignore_media_by_filename_equality name = 'foo.txt' type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [name]}}) # type is not in the ingore part = stub(:body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and filename are in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal true, mms.ignore_media?(type, part) # type but not file name are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_filename name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'foo.txt', mms.filename?(part) end def test_long_filename name = 'x' * 300 + '.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'x' * 251 + '.txt', mms.filename?(part) end def test_filename_when_file_extension_missing_part name = 'foo' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.txt', mms.filename?(part) name = 'foo.janky' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.janky.txt', mms.filename?(part) end def test_ignore_media_by_filename_regexp name = 'foo.txt' regexp = /foo\.txt/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [regexp, 'nil.txt']}}) # type is not in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the filename are in the ingore part = stub(:filename => name) assert_equal true, mms.ignore_media?(type, part) # type but not regexp for filename are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_by_regexp_on_file_content name = 'foo.txt' content = "aaaaaaahello worldbbbbbbbbb" regexp = /.*Hello World.*/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => ['nil.txt', regexp]}}) part = stub(:filename => name, :body => Mail::Body.new(content)) # type is not in the ingore assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the content are in the ingore assert_equal true, mms.ignore_media?(type, part) # type but not regexp for content are in the ignore part = stub(:filename => name, :body => Mail::Body.new('no teapots')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_when_file_content_is_empty mms = MMS2R::Media.new stub_mail # there is no conf but the part's body is empty part = stub(:filename => 'foo.txt', :body => Mail::Body.new) assert_equal true, mms.ignore_media?('text/test', part) # there is no conf but the part's body is white space part = stub(:filename => 'foo.txt', :body => Mail::Body.new("\t\n\t\n ")) assert_equal true, mms.ignore_media?('text/test', part) end def test_add_file mail = stub_mail mail.stubs(:from).returns(['[email protected]']) mms = MMS2R::Media.new(mail) mms.stubs(:media).returns({}) assert_nil mms.media['text/html'] mms.add_file('text/html', '/tmp/foo.html') assert_equal ['/tmp/foo.html'], mms.media['text/html'] mms.add_file('text/html', '/tmp/bar.html') assert_equal ['/tmp/foo.html', '/tmp/bar.html'], mms.media['text/html'] end def test_temp_file name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal name, File.basename(mms.temp_file(part)) end def test_process_media_for_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', 'hello world']) result = mms.process_media(part) assert_equal 'text/plain', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_with_empty_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', '']) assert_equal ['text/plain', nil], mms.process_media(part) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_application_smil name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['application/smil', nil]) part = stub(:filename => name, :content_type => 'application/smil', :part_type? => 'application/smil', :main_type => 'application') assert_equal ['application/smil', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['application/smil', 'hello world']) result = mms.process_media(part) assert_equal 'application/smil', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_application_octet_stream_when_image name = 'fake.jpg' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'application/octet-stream', :part_type? => 'application/octet-stream', :body => Mail::Body.new("data"), :main_type => 'application') result = mms.process_media(part) assert_equal 'image/jpeg', result.first assert_match(/fake\.jpg$/, result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_all_other_media name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :main_type => 'faux', :part_type? => 'faux/text', :body => Mail::Body.new(nil)) assert_equal ['faux/text', nil], mms.process_media(part) part = stub(:filename => name, :main_type => 'faux', :part_type? => 'faux/text', :body => Mail::Body.new('hello world')) result = mms.process_media(part) assert_equal 'faux/text', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process mms = MMS2R::Media.new stub_mail assert_equal 1, mms.media.size assert_not_nil mms.media['text/plain'] assert_equal 1, mms.media['text/plain'].size assert_equal true, File.exist?(mms.media['text/plain'].first) assert_equal 1, File.size(mms.media['text/plain'].first) mms.purge end def test_process_with_multipart_double_parts mail = mail('apple-double-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_not_nil mms.media['application/applefile'] assert_equal 1, mms.media['application/applefile'].size assert_not_nil mms.media['image/jpeg'] assert_equal 1, mms.media['image/jpeg'].size assert_match(/DSCN1715\.jpg$/, mms.media['image/jpeg'].first) assert_file_size mms.media['image/jpeg'].first, 337 mms.purge end def test_process_with_multipart_alternative_parts mail = stub_mail plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new('a'), :main_type => 'text') plain.stubs(:multipart?).at_least_once.returns(false) html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new('a'), :main_type => 'text') html.stubs(:multipart?).at_least_once.returns(false) multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) multi.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:parts).at_least_once.returns([multi]) # the multipart/alternative should get flattend to text and html mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_equal 2, mms.media.size assert_not_nil mms.media['text/plain'] assert_not_nil mms.media['text/html'] assert_equal 1, mms.media['text/plain'].size assert_equal 1, mms.media['text/html'].size assert_equal 'message.txt', File.basename(mms.media['text/plain'].first) assert_equal 'message.html', File.basename(mms.media['text/html'].first) assert_equal true, File.exist?(mms.media['text/plain'].first) assert_equal true, File.exist?(mms.media['text/html'].first) assert_equal 1, File.size(mms.media['text/plain'].first) assert_equal 1, File.size(mms.media['text/html'].first) mms.purge end def test_process_when_media_is_ignored mail = stub_mail plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new(''), :main_type => 'text') plain.stubs(:multipart?).at_least_once.returns(false) html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new(''), :main_type => 'text') html.stubs(:multipart?).at_least_once.returns(false) multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) multi.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:parts).at_least_once.returns([multi]) mms = MMS2R::Media.new(mail, :process => :lazy) mms.stubs(:config).returns({'ignore' => {'text/plain' => ['message.txt'], 'text/html' => ['message.html']}}) assert_nothing_raised { mms.process } # the multipart/alternative should get flattend to text and html and then # what's flattened is ignored assert_equal 0, mms.media.size mms.purge end def test_process_when_yielding_to_a_block mail = stub_mail plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new('a'), :main_type => 'text') plain.stubs(:multipart?).at_least_once.returns(false) html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new('b'), :main_type => 'text') html.stubs(:multipart?).at_least_once.returns(false) multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) multi.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:parts).at_least_once.returns([multi]) # the multipart/alternative should get flattend to text and html mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size mms.process do |type, files| assert_equal 1, files.size
monde/mms2r
e8df44f79dc6ccd55b7611264a95b89bc4ca3387
Added test cases for downloading messages from sprint with ajax. Test when message exists, and when message has been purged.
diff --git a/lib/mms2r/media/sprint.rb b/lib/mms2r/media/sprint.rb index 49d99ac..c9e9ceb 100644 --- a/lib/mms2r/media/sprint.rb +++ b/lib/mms2r/media/sprint.rb @@ -1,229 +1,247 @@ #-- # Copyright (c) 2007-2010 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ require 'net/http' require 'nokogiri' require 'cgi' +require 'json' module MMS2R class Media ## # Sprint version of MMS2R::Media # # Sprint is an annoying carrier because they don't actually transmit user # generated content (like images or videos) directly in the MMS message. # Instead, they hijack the media that is sent from the cellular subscriber # and place that content on a content server. In place of the media # the recipient receives a HTML message with unsolicited Sprint # advertising and links back to their content server. The recipient has # to click through Sprint more pages to view the content. # # The default subject on these messages from the # carrier is "You have new Picture Mail!" module Sprint ## # Override process() because Sprint doesn't attach media (images, video, # etc.) to its MMS. Media such as images and videos are hosted on a # Sprint content server. MMS2R::Media::Sprint has to pick apart an # HTML attachment to find the URL to the media on Sprint's content # server and download each piece of content. Any text message part of # the MMS if it exists is embedded in the html. def process unless @was_processed log("#{self.class} processing", :info) #sprint MMS are multipart parts = @mail.parts #find the payload html doc = nil parts.each do |p| next unless p.part_type? == 'text/html' d = Nokogiri(p.body.decoded) title = d.at('title').inner_html if title =~ /You have new Picture Mail!/ doc = d @is_video = (p.body.decoded =~ /type=&quot;VIDEO&quot;&gt;/m ? true : false) end end return if doc.nil? # it was a dud @is_video ||= false # break it down sprint_phone_number(doc) sprint_process_text(doc) sprint_process_media(doc) @was_processed = true end # when process acts upon a block if block_given? media.each do |k, v| yield(k, v) end end end private ## # Digs out where Sprint hides the phone number def sprint_phone_number(doc) c = doc.search("/html/head/comment()").last t = c.content.gsub(/\s+/m," ").strip #@number returned in parent's #number @number = / name=&quot;MDN&quot;&gt;(\d+)&lt;/.match(t)[1] end ## # Pulls out the user text form the MMS and adds the text to media hash def sprint_process_text(doc) # there is at least one <pre> with MMS text if text has been included by # the user. (note) we'll have to verify that if they attach multiple texts # to the MMS then Sprint stacks it up in multiple <pre>'s. The only <pre> # tag in the document is for text from the user. # if there is no text media found in the mail body - then we go to more # extreme measures. text_found = false doc.search("/html/body//pre").each do |pre| type = 'text/plain' text = pre.inner_html.strip next if text.empty? text_found = true type, text = transform_text(type, text) type, file = sprint_write_file(type, text.strip) add_file(type, file) unless type.nil? || file.nil? end - # if no text was found, there still might be a message with images # that can be seen at the end of the "View Entire Message" link if !text_found - # Sprint uses AJAX/josn to serve up the content at the end of the link so this is conveluted view_entire_message_link = doc.search("a").find { |link| link.inner_html == "View Entire Message"} - url = view_entire_message_link.attr("href") - # extract the "invite" param out of the url - this will be the id we pass to the ajax path below - inviteMessageId = CGI::parse(URI::parse(url).query)["invite"].first - json_url = "http://pictures.sprintpcs.com/ui-refresh/guest/getMessageContainerJSON.do%3FcomponentType%3DmediaDetail&invite=#{inviteMessageId}&externalMessageId=#{inviteMessageId}" - # pull down the json from the url and parse it - json_response = Net::HTTP.get_response(URI.parse(json_url)) - json = JSON.parse(json_response.body) - - # there may be multiple "results" in the json - due to multiple images - # cycle through them and extract the "description" which is the text - # message the sender sent with the images - json["Results"].each do |result| - type = 'text/plain' - text = result["description"] ? result["description"].strip : nil - next if text.empty? - type, text = transform_text(type, text) - type, file = sprint_write_file(type, text.strip) - add_file(type, file) unless type.nil? || file.nil? + # if we can't find the view entire message link, give up + if view_entire_message_link + # Sprint uses AJAX/json to serve up the content at the end of the link so this is conveluted + url = view_entire_message_link.attr("href") + # extract the "invite" param out of the url - this will be the id we pass to the ajax path below + inviteMessageId = CGI::parse(URI::parse(url).query)["invite"].first + + if inviteMessageId + json_url = "http://pictures.sprintpcs.com/ui-refresh/guest/getMessageContainerJSON.do%3FcomponentType%3DmediaDetail&invite=#{inviteMessageId}&externalMessageId=#{inviteMessageId}" + # pull down the json from the url and parse it + uri = URI.parse(json_url) + connection = Net::HTTP.new(uri.host, uri.port) + response = connection.get2( + uri.request_uri, + { "User-Agent" => MMS2R::Media::USER_AGENT } + ) + content = response.body + + # if the content has expired, sprint sends back html "content expired page + # json will fail to parse + begin + json = JSON.parse(content) + + # there may be multiple "results" in the json - due to multiple images + # cycle through them and extract the "description" which is the text + # message the sender sent with the images + json["Results"].each do |result| + type = 'text/plain' + text = result["description"] ? result["description"].strip : nil + next if text.empty? + type, text = transform_text(type, text) + type, file = sprint_write_file(type, text.strip) + add_file(type, file) unless type.nil? || file.nil? + end + rescue JSON::ParserError => e + log("#{self.class} processing error, #{$!}", :error) + end + end end end end ## # Fetch all the media that is referred to in the doc def sprint_process_media(doc) srcs = Array.new # collect all the images in the document, even though # they are <img> tag some might actually refer to video. # To know the link refers to vide one must look at the # content type on the http GET response. imgs = doc.search("/html/body//img") imgs.each do |i| src = i.attributes['src'] next unless src src = src.text # we don't want to double fetch content and we only # want to fetch media from the content server, you get # a clue about that as there is a RECIPIENT in the URI path # of real content next unless /mmps\/RECIPIENT\//.match(src) next if srcs.detect{|s| s.eql?(src)} srcs << src end #we've got the payload now, go fetch them cnt = 0 srcs.each do |src| begin uri = URI.parse(CGI.unescapeHTML(src)) unless @is_video query={} uri.query.split('&').each{|a| p=a.split('='); query[p[0]] = p[1]} query.delete_if{|k, v| k == 'limitsize' || k == 'squareoutput' } uri.query = query.map{|k,v| "#{k}=#{v}"}.join("&") end # sprint is a ghetto, they expect to see &amp; for video request uri.query = uri.query.gsub(/&/, "&amp;") if @is_video connection = Net::HTTP.new(uri.host, uri.port) #connection.set_debug_output $stdout response = connection.get2( uri.request_uri, { "User-Agent" => MMS2R::Media::USER_AGENT } ) content = response.body rescue StandardError => err log("#{self.class} processing error, #{$!}", :error) next end - # if the Sprint content server uses response code 500 when the content is purged # the content type will text/html and the body will be the message if response.content_type == 'text/html' && response.code == "500" log("Sprint content server returned response code 500", :error) next end # setup the file path and file base = /\/RECIPIENT\/([^\/]+)\//.match(src)[1] type = response.content_type file_name = "#{base}-#{cnt}.#{self.class.default_ext(type)}" file = File.join(msg_tmp_dir(),File.basename(file_name)) # write it and add it to the media hash type, file = sprint_write_file(type, content, file) add_file(type, file) unless type.nil? || file.nil? cnt = cnt + 1 end end ## # Creates a temporary file based on the type def sprint_temp_file(type) file_name = "#{Time.now.to_f}.#{self.class.default_ext(type)}" File.join(msg_tmp_dir(),File.basename(file_name)) end ## # Writes the content to a file and returns the type, file as a tuple. def sprint_write_file(type, content, file = nil) file = sprint_temp_file(type) if file.nil? log("#{self.class} writing file #{file}", :info) # force the encoding to be utf-8 content = content.force_encoding("UTF-8") if content.respond_to?(:force_encoding) File.open(file,'w'){ |f| f.write(content) } return type, file end end end end diff --git a/test/fixtures/sprint-ajax-response-failure.html b/test/fixtures/sprint-ajax-response-failure.html new file mode 100644 index 0000000..4ce2c65 --- /dev/null +++ b/test/fixtures/sprint-ajax-response-failure.html @@ -0,0 +1,173 @@ +<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" +"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> + + + + + + + + + + + + + + + + + + + +<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en"> + +<head> + + + + <meta name="ROBOTS" content="NOINDEX,NOFOLLOW"/> + <title>Pictures from Sprint</title> + <link rel="shortcut icon" type="image/x-icon" href="/retailers/PCSNEXTEL/ui-refresh/images/icons/favicon.ico"/> + <link rel="stylesheet" type="text/css" href="/combined.css.h-968716942.pack" charset="utf-8"/> + + + + + + + + + + + + <link rel="stylesheet" type="text/css" href="/combined.css.h-865380446.pack" charset="utf-8"/> + + +<script type="text/javascript" src="/combined.js.h2135702050.pack" charset="utf-8"></script> +<script type="text/javascript" src="/js/ui-refresh/jsprops.jsp"></script> + +</head> +<body class="yui-skin-sam" onload=";javascript:YAHOO.com.sprint.pm.util.functions.isLoginPageLoadedIntoIframe();" onunload=""> + + +<div id="com-sprint-pm-panel-container" class="com-sprint-pm-panel-container"></div> + +<div id="com-xoom-widget-result-dialog"></div> + +<div id="custom-doc" class="yui-t7"> + + + + <div id="hd"> + + + + + + + + + + + +<div id="com-sprint-pm-brand"><a href="http://www.sprintpcs.com" target="_blank"></a></div> + +<div class="yui-g"> + <img src="/retailers/PCSNEXTEL/ui-refresh/images/sprint-nav.gif" width="963" height="57" alt="Sprint Navigation" usemap="#sprint_nav_Map"/> +</div> + + + + + +<map id="sprint_nav_Map" name="sprint_nav_Map"> + <area shape="rect" title="Support" alt="Support" coords="537,15,620,44" href="http://support.sprint.com/support" onclick="javascript:YAHOO.com.sprint.pm.util.functions.removeSSOCookie();"/> + <area shape="rect" title="Community" alt="Community" coords="429,15,533,44" href="http://community.sprint.com/" onclick="javascript:YAHOO.com.sprint.pm.util.functions.removeSSOCookie();"/> + <area shape="rect" title="Digital Lounge" alt="Digital Lounge" coords="305,15,425,44" href="http://www.sprint.com/digitallounge" onclick="javascript:YAHOO.com.sprint.pm.util.functions.removeSSOCookie();"/> + <area shape="rect" title="Shop" alt="Shop" coords="230,15,300,44" href="http://www.nextel.com/en/shop/" onclick="javascript:YAHOO.com.sprint.pm.util.functions.removeSSOCookie();"/> + <area shape="rect" title="My Sprint" alt="My Sprint" coords="137,15,225,44" onclick="javascript:YAHOO.com.sprint.pm.util.functions.removeSSOCookie();" href="https://mysprint.sprint.com/mysprint/pages/secure/myaccount/landingPage.jsp"/> + <area shape="rect" title="Sprint.com" alt="Sprint.com" coords="0,0,110,44" onclick="javascript:YAHOO.com.sprint.pm.util.functions.removeSSOCookie();" href="http://www.sprint.com"/> +</map> +</div> + + <div id="bd"> + <div id="yui-main"> + + + + + + + + <div class="yui-navset"> + <ul class="yui-nav"><li class="yui-li-empty-tab-nav"></li></ul> + <div class="yui-content"> + <div id="com-sprint-pm-configurable-content-holder" class="yui-g"> + +<div class="com-sprint-pm-one-panel-box"> + <div class="com-sprint-pm-one-panel-content"> + <div class="com-sprint-pm-title-heading"><img src="/retailers/PCSNEXTEL/ui-refresh/images/title/title_error.gif"/></div><br/><br/> + <div>Sorry, but the shared album or picture has been removed by its owner.</div><br/> + </div> +</div> + + <div class="com-sprint-pm-one-panel-verisign-logo"> +</div> + </div> + </div> + </div> + + </div><!-- /yui-main --> + </div> <!-- close bd --> + + <div id="ft"> + + + + + + + + + + + + + + + + + + + +<div id="com-sprint-pm-footer" > + <div class="yui-ge"> + <div class="yui-u first"> + <ul id="com-sprint-pm-footerLinks"> + <li>Order by phone 1-800-2-SPRINT</li> + <li><a href="http://www2.sprint.com/mr/aboutsprint.do" target="_blank" title="About Us">About Us</a></li> + <li><a href="http://www.sprint.com/contactus/" target="_blank" title="Contact Us">Contact Us</a></li> + <li><a href="http://www.sprint.com/legal/picturemail_terms_and_conditions.html" target="_blank" title="Terms of Use">Terms of Use</a></li> + <li class="pm-last"><a href="http://www.sprint.com/legal/privacy.html" target="_blank" title="Privacy Policy">Privacy Policy</a></li> + </ul> + </div> + <div class="yui-u" id="com-sprint-pm-copyright"> + &copy; 2012 Sprint. All rights reserved.<br/> + </div> + </div> + + + +<script type="text/javascript" src="/combined.js.h845901428.pack" charset="utf-8"></script> +<script type="text/javascript"> _uacct = "UA-822828-4"; _udn=".sprintpcs.com"; YAHOO.com.sprint.pm.util.functions.urchinTracker(); </script> + + + </div> + +</div> <!-- close custom-doc --> +</body> + + + + +</html> diff --git a/test/fixtures/sprint-ajax-response-success.json b/test/fixtures/sprint-ajax-response-success.json new file mode 100644 index 0000000..a080747 --- /dev/null +++ b/test/fixtures/sprint-ajax-response-success.json @@ -0,0 +1 @@ +{"totalMediaItems":1,"shareType":"normal","nomediaItem":"false","isOnlyVideo":null,"creationDate":"Apr 16, 2012","from":"(513)545-5510","offset":null,"externalMessageId":"GEc4YYms2Y7KAkmhaoFL","Results":[{"elementID":"2","hasVoiceCaption":false,"URL":{"elementID":"2","indexCount":0,"audio":null,"thumb":"http:\/\/pictures.sprintpcs.com:80\/mmps\/031_36415d1a9c3c73f0_1\/2.jpg?partExt=.jpg&&&outquality=90&ext=.jpg&&size=40,40&squareoutput=255,255,255&aspectcrop=0.5,0.5,1.0,1.0,1.0","annotationVoiceID":null,"image":"http:\/\/pictures.sprintpcs.com:80\/mmps\/031_36415d1a9c3c73f0_1\/2.jpg?partExt=.jpg&&&outquality=90&ext=.jpg","video":null},"description":"Just testing the caption on Sprint","mediaItemNum":0,"isDRMProtected":false,"externalMessageId":"GEc4YYms2Y7KAkmhaoFL","mediaType":"IMAGE","restOperation":"false","folderFullName":"\/RECIPIENT"}],"invite":null,"tmemo":null,"toAddress":"[email protected]","mediaIndex":0,"subject":"New Message","isDRMProtected":false,"expirationDate":"Expires in 18 days","voiceURL":null,"guest":"true","folderFullName":"\/RECIPIENT"} \ No newline at end of file diff --git a/test/fixtures/sprint-image-missing-message.mail b/test/fixtures/sprint-image-missing-message.mail new file mode 100644 index 0000000..95feb55 --- /dev/null +++ b/test/fixtures/sprint-image-missing-message.mail @@ -0,0 +1,183 @@ +Return-Path: <[email protected]> +Received: by 10.112.114.196 with SMTP id ji4csp42935lbb; Mon, 16 Apr 2012 13:50:50 -0700 +Received: by 10.68.195.103 with SMTP id id7mr30477156pbc.98.1334609449244; Mon, 16 Apr 2012 13:50:49 -0700 +Received: from smtp04.sun3.lightsurf.net (smtp.sun3.lightsurf.net. [63.215.195.131]) by mx.google.com with ESMTPS id s4si21720545pbc.315.2012.04.16.13.50.48 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 16 Apr 2012 13:50:49 -0700 +Received: from pcs-nams007 (pcs-mmsc.sun3.lightsurf.net [10.0.0.152]) by smtp04.sun3.lightsurf.net (8.12.11.20060308/8.12.11) with ESMTP id q3GKoNxU028344 for <[email protected]>; Mon, 16 Apr 2012 13:50:48 -0700 +Date: Mon, 16 Apr 2012 13:50:48 -0700 +From: "[email protected]" <[email protected]> +To: [email protected] +Message-ID: <28315302.1330941238231.JavaMail.lsadm@pcs-nams007> +Subject: New Message +Mime-Version: 1.0 +Content-Type: multipart/alternative; + boundary="----=_Part_313708_25410566.1334609448230"; + charset=UTF-8 +Content-Transfer-Encoding: 7bit +Delivered-To: [email protected] +Received-SPF: neutral (google.com: 63.215.195.131 is neither permitted nor + denied by best guess record for domain of [email protected]) + client-ip=63.215.195.131; +Authentication-Results: mx.google.com; spf=neutral (google.com: 63.215.195.131 + is neither permitted nor denied by best guess record for domain of + [email protected]) [email protected] +X-Priority: 3 +X-MSMail-Priority: Normal +Importance: Normal + + + +------=_Part_313708_25410566.1334609448230 +Date: Mon, 16 Apr 2012 20:57:48 +0000 +Mime-Version: 1.0 +Content-Type: text/plain; + charset=us-ascii +Content-Transfer-Encoding: 7bit +Content-ID: <4f8c87cc3a7_3bcbcf3a47358c@711c1195-3077-406a-aba4-b6725acc21c4.mail> + +New Picture Mail from {SENDER_ADDRESS}! + +Click Go/View to see. +http://pictures.sprintpcs.com/?mivt=dWQEWQERDWEefwWEf&shareName=MMS + + _frsthgl + +------=_Part_313708_25410566.1334609448230 +Date: Mon, 16 Apr 2012 20:57:48 +0000 +Mime-Version: 1.0 +Content-Type: text/html; + charset=UTF-8 +Content-Transfer-Encoding: 7bit +Content-ID: <4f8c87cc1220_3bcbcf3a4736fd@711c1195-3077-406a-aba4-b6725acc21c4.mail> + +<html> +<head><title>You have new Picture Mail!</title> +<!-- lsPictureMail-Share-dWQEWQERDWEefwWEf-comment +&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF&#45;8&quot;?&gt; +&lt;shareMessage&gt; + &lt;messageContents type=&quot;PICTURE&quot;&gt; + &lt;messageText&gt;&lt;/messageText&gt; + &lt;mediaItems&gt; + &lt;mediaItem id=&quot;1&quot;&gt; + &lt;title&gt;&lt;/title&gt; + &amp;lt;url&amp;gt;http://pictures.sprintpcs.com/getMMBOXMessageMedia?id=Xw1004H8sLv6S3x76lVPYolcexVfCdoEvXqTgC1LOkLONz34IC9SMwmk5gW%2FZUWGqyw0fwJJvr5z%0ARdCKg1wQYriT07mKN82PqmTlYRVwDMWGkNKbb8WqPD%2F4a1A61I2rQ26BSr%2Fb84dpnib%2FsZpVJg%3D%3D%0A&amp;lt;/url&amp;gt; + + &lt;urlExpiration&gt;2012&#45;04&#45;23T20:50:48Z&lt;/urlExpiration&gt; + &lt;/mediaItem&gt; + &lt;/mediaItems&gt; + &lt;/messageContents&gt; +&lt;/shareMessage&gt; + +--> +<!-- lsPictureMail-UserInfo-dWQEWQERDWEefwWEf-comment +&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF&#45;8&quot;?&gt; +&lt;UserInfo timestamp=&quot;2012&#45;04&#45;16T20:50:48.228+00:00&quot; originating_from_address=&quot;[email protected]&quot;&gt;&lt;credential name=&quot;MDN&quot;&gt;5135455555&lt;/credential&gt;&lt;/UserInfo&gt; + --> +</head> +<body marginheight="0" marginwidth="0" topmargin="0" bottommargin="0" leftmargin="0" rightmargin="0"> +<table border="0" width="100%" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" > +<tr> + <td VALIGN="top" colspan="2" width="100%"> + <div style="border-bottom:1px solid rgb(156, 154, 156); padding:20px 0px 20px 10px"><a href="http://www.sprintpcs.com"><img src="http://pictures.sprintpcs.com/retailers/PCSNEXTEL/ui-refresh/images/logo/sprint-logo-white.jpg" alt="" border="0" /></a></div> + </td> +</tr> +<tr> + <td VALIGN="top" colspan="2"> + <table border="0" cellpadding="0" cellspacing="0" width="590" bgcolor="#FFFFFF"> + <tr> + <td><br/><p><img src="http://pictures.sprintpcs.com/images/x.gif" border="0" width="10"/><font face="trebuchet ms, Helvetica, Arial, Verdana" size="2"><b>You have a Picture Mail from [email protected]</b></font><br/><br/></p></td> + </tr> + </table> + </td> +</tr> +<tr> + <td colspan="2"> + <table border="0" width="590" cellpadding="0" cellspacing="0"> + <tr> + <td width="10">&nbsp;</td> + <td width="280" valign="top"> + <table border="0" cellpadding="0" style="border:1px solid #9C9A9C;"> + <tr> + <td> + <table border="0" bgcolor="#ffffff" cellpadding="0" cellspacing="7" style="table-layout:fixed"> + <tr> + <td align="center"> + <img src="http://pictures.sprintpcs.com//mmps/RECIPIENT/031_36415d1a9c3c73f0_1/2?inviteToken=dWQEWQERDWEefwWEf&amp;limitsize=258,258&amp;outquality=90&amp;squareoutput=255,255,255&amp;ext=.jpg&amp;iconifyVideo=true&amp;wm=1"/> + </td> + </tr> + </table> + </td> + </tr> + </table> + </td> + <td width="20">&nbsp;</td> + <td VALIGN="top" align="right" width="280"> + <table border="0" cellpadding="0" cellspacing="0" width="280" style="table-layout:fixed"> + <tr> + <td><p><font face="trebuchet ms, Helvetica, Arial, Verdana" size="2"><b>Message:</b></font></p></td> + </tr> + <tr> + <td><pre style="overflow:auto; font:normal 10pt trebuchet ms; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;"></pre></td> + </tr> + <tr> + <td><img src="http://pictures.sprintpcs.com/images/x.gif" border="0" height="15"/></td> + </tr> + <tr> + <td width="280"> + <div style="padding:0px; background-color:#fff; font: normal 10pt trebuchet ms" width="280"> + <a target="_blank" style="color: #148AB2;" href="http://pictures.sprintpcs.com/share.do?invite=dWQEWQERDWEefwWEf&amp;shareName=MMS&amp;messageState=RETRIEVED">View Entire Message</a> + <br/><br/> + Send and receive Pictures and Videos through Picture Mail<sup>SM</sup>. For more information go to <a target="_blank" style="color: #148AB2;" href="http://www.sprint.com/picturemail">www.sprint.com/picturemail.</a> + </div> + </td> + </tr> + </table> + </td> + </tr> + </table> + </td> + </tr> + <tr> + <td> + <table> + <tr> + <td> + <div style="font: normal 10pt trebuchet ms;margin-top:10px;">Please be aware your friends can forward your picture, video, and album share invitations to others or post the unique Web link to your share invitation on any number of sources (e.g. blogs), through which others could also gain access to your online photos. If you have private or sensitive photos you are sharing, please share them only with those you trust.</div> + </td> + </tr> + </table> + </td> + </tr> + <tr> + <td colspan="2"> + <img src="http://pictures.sprintpcs.com/images/x.gif" width="5" height="45"/> + </td> + </tr> + <tr> + <td VALIGN="top" colspan="2" width="590"> + <img src="http://pictures.sprintpcs.com/images/x.gif" height="5"/> + </td> + </tr> + <tr> + <td VALIGN="top" colspan="2" width="100%"> + <table width="100%" border="0" cellspacing="0" cellpadding="0"> + <tr> + <td bgcolor="#ffffff" width="100%"> + <div style="border-top:1px solid rgb(156, 154, 156)">&nbsp;</div> + </td> + </tr> + <tr> + <td> + <div style="float:right; padding-right:5px"><span style="font-family:trebuchet ms, Helvetica, Arial, Verdana; Font-size: 11px; Color: #000000">&#169; 2012 Sprint. All rights reserved.</span></div> + </td> + </tr> + <tr> + <td bgcolor="#ffffff" width="100%"><img src="http://pictures.sprintpcs.com/images/x.gif" border="0" height="10"/></td> + </tr> + </table> + </td> + </tr> +</table> +</body> +</html><!-- legacy_mms_arrived.txt --> + +------=_Part_313708_25410566.1334609448230-- \ No newline at end of file diff --git a/test/test_pm_sprint_com.rb b/test/test_pm_sprint_com.rb index 757fa2e..9edd048 100644 --- a/test/test_pm_sprint_com.rb +++ b/test/test_pm_sprint_com.rb @@ -1,239 +1,317 @@ require "test_helper" class TestPmSprintCom < Test::Unit::TestCase include MMS2R::TestHelper def mock_sprint_image(message_id) response = mock('response') body = mock('body') connection = mock('connection') response.expects(:content_type).twice.returns('image/jpeg') response.expects(:body).returns(body) response.expects(:code).never Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection connection.expects(:get2).with( # 1.9.2 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90&ext=.jpg&iconifyVideo=true&wm=1' # 1.8.7 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&outquality=90&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU' kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).once.returns(response) end def mock_sprint_purged_image(message_id) response = mock('response') body = mock('body') connection = mock('connection') response.expects(:content_type).once.returns('text/html') response.expects(:body).returns(body) response.expects(:code).once.returns('500') Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection connection.expects(:get2).with( # 1.9.2 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90&ext=.jpg&iconifyVideo=true&wm=1' # 1.8.7 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&outquality=90&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU' kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).once.returns(response) end + + def mock_sprint_ajax + response = mock('response') + body = mock('body') + # this is a response from a real sprint message + file = File.open("./test/fixtures/sprint-ajax-response-success.json", "rb") + json = file.read + body.expects(:to_str).returns json + connection = mock('connection') + connection.stubs(:use_ssl=).returns(true) + response.expects(:body).twice.returns(body) + response.expects(:code).once.returns('200') + response.expects(:content_type).twice.returns('text/html') + + Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).twice.returns connection + connection.expects(:get2).with( + # 1.9.2 + # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90&ext=.jpg&iconifyVideo=true&wm=1' + # 1.8.7 + # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&outquality=90&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU' + kind_of(String), + { "User-Agent" => MMS2R::Media::USER_AGENT } + ).twice.returns(response) + end + + def mock_sprint_ajax_purged + response = mock('response') + body = mock('body') + # this is a response from a real sprint message + file = File.open("./test/fixtures/sprint-ajax-response-failure.html", "rb") + error_html = file.read + body.expects(:to_str).returns error_html + connection = mock('connection') + connection.stubs(:use_ssl=).returns(true) + response.expects(:body).twice.returns(body) + response.expects(:code).once.returns('500') + response.expects(:content_type).once.returns('text/html') + Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).twice.returns connection + connection.expects(:get2).with( + # 1.9.2 + # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90&ext=.jpg&iconifyVideo=true&wm=1' + # 1.8.7 + # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&outquality=90&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU' + kind_of(String), + { "User-Agent" => MMS2R::Media::USER_AGENT } + ).twice.returns(response) + end + def test_mms_should_have_text mail = mail('sprint-text-01.mail') mms = MMS2R::Media.new(mail) assert_equal "2068765309", mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_equal 1, mms.media['text/plain'].size file = mms.media['text/plain'].first assert_equal true, File.exist?(file) assert_match(/\.txt$/, File.basename(file)) assert_equal "Tea Pot", IO.read(file) mms.purge end def test_mms_should_have_a_phone_number mail = mail('sprint-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier mms.purge end def test_should_have_simple_video mail = mail('sprint-video-01.mail') response = mock('response') body = mock('body') connection = mock('connection') response.expects(:content_type).twice.returns('video/quicktime') response.expects(:body).returns(body) response.expects(:code).never Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection connection.expects(:get2).with( kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).once.returns(response) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_not_nil mms.media['video/quicktime'] assert_equal 1, mms.media['video/quicktime'].size assert_equal "000_259e41e851be9b1d_1-0.mov", File.basename(mms.media['video/quicktime'][0]) mms.purge end def test_should_have_simple_image mail = mail('sprint-image-01.mail') mock_sprint_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_not_nil mms.media['image/jpeg'][0] assert_match(/001_2066c7013e7ca833_1-0.jpg$/, mms.media['image/jpeg'][0]) mms.purge end def test_collect_image_using_block mail = mail('sprint-image-01.mail') mock_sprint_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size file_array = nil mms.process do |k, v| file_array = v if (k == 'image/jpeg') assert_equal 1, file_array.size file = file_array.first assert_not_nil file = file_array.first assert_equal "001_2066c7013e7ca833_1-0.jpg", File.basename(file) end mms.purge end def test_process_internals_should_only_be_executed_once mail = mail('sprint-image-01.mail') mock_sprint_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size # second time through shouldn't go into the was_processed block mms.mail.expects(:parts).never mms.process{|k, v| } mms.purge end def test_should_have_two_images mail = mail('sprint-two-images-01.mail') response = mock('response') body = mock('body') connection = mock('connection') response.expects(:content_type).times(4).returns('image/jpeg') response.expects(:body).twice.returns(body) response.expects(:code).never Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).twice.returns connection connection.expects(:get2).with( kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } ).twice.returns(response) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_equal 2, mms.media['image/jpeg'].size assert_not_nil mms.media['image/jpeg'][0] assert_not_nil mms.media['image/jpeg'][1] assert_match(/001_104058d23d79fb6a_1-0.jpg$/, mms.media['image/jpeg'][0]) assert_match(/001_104058d23d79fb6a_1-1.jpg$/, mms.media['image/jpeg'][1]) mms.purge end def test_image_should_be_missing # this test is questionable mail = mail('sprint-broken-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 0, mms.media.size mms.purge end + def test_message_is_missing_in_mail + # this test is questionable + mail = mail('sprint-image-missing-message.mail') + mock_sprint_ajax + mms = MMS2R::Media.new(mail) + + assert_equal 1, mms.media['text/plain'].size + + # test that the message was extracted from the ajax response + message = IO.readlines(mms.media['text/plain'].first).join("") + assert_equal "Just testing the caption on Sprint", message + + mms.purge + end + + def test_message_is_missing_in_mail_purged_from_content_server + # this test is questionable + mail = mail('sprint-image-missing-message.mail') + mock_sprint_ajax_purged + mms = MMS2R::Media.new(mail) + + assert_equal '5135455555', mms.number + assert_equal "pm.sprint.com", mms.carrier + + assert_equal 0, mms.media.size + + mms.purge + end + def test_image_should_be_purged_from_content_server mail = mail('sprint-image-01.mail') mock_sprint_purged_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 0, mms.media.size mms.purge end def test_body_should_return_empty_when_there_is_no_user_text mail = mail('sprint-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal "", mms.body end def test_sprint_write_file mail = mock(:message_id => 'a') mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') mms = MMS2R::Media.new(mail, :process => :lazy) type = 'text/plain' content = 'foo' file = Tempfile.new('sprint') file.close type, file = mms.send(:sprint_write_file, type, content, file.path) assert_equal 'text/plain', type assert_equal content, IO.read(file) end def test_subject mail = mail('sprint-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal "", mms.subject end def test_new_subject mail = mail('sprint-new-image-01.mail') + mock_sprint_ajax mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal "", mms.subject end end
monde/mms2r
66e5da4dc3e98584f987524695471cb3488a17e7
json gem has been introduced
diff --git a/Gemfile.lock b/Gemfile.lock index 39b1bb3..074dd18 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,46 +1,47 @@ GEM remote: http://rubygems.org/ specs: exifr (1.1.1) gemcutter (0.7.1) hoe (2.12.5) rake (~> 0.8) i18n (0.6.0) json (1.6.5) json_pure (1.6.5) mail (2.4.0) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) metaclass (0.0.1) mime-types (1.17.2) mocha (0.10.2) metaclass (~> 0.0.1) nokogiri (1.5.0) polyglot (0.3.3) rake (0.9.2.2) rcov (0.9.11) rdoc (3.12) json (~> 1.4) rubyforge (2.0.4) json_pure (>= 1.1.7) test-unit (1.2.3) hoe (>= 1.5.1) treetop (1.4.10) polyglot polyglot (>= 0.3.1) PLATFORMS ruby DEPENDENCIES exifr gemcutter hoe + json mail mocha nokogiri rcov rdoc rubyforge test-unit (= 1.2.3)
monde/mms2r
7ee77a3d58ff441a524fce8542324cebc5e3e914
Sprint is does not always (if ever) include image captions in the mail body of the email they send. To view the caption you must click on the "View Entire Message" link. To make things difficult Sprint uses Ajax to serve up JSON that is then turned into html content. These changes download the JSON and extract any text content to create text/html media for the mms mail object. Changes require JSON gem.
diff --git a/Gemfile b/Gemfile index ee4f968..8941e45 100644 --- a/Gemfile +++ b/Gemfile @@ -1,20 +1,21 @@ # -*- ruby -*- source :rubygems gem "nokogiri" gem "mail" gem "exifr" +gem "json" # gem "psych" group :development, :test do gem "rdoc" gem "rubyforge" gem "gemcutter" gem "hoe" gem "rcov" gem "test-unit", "=1.2.3" gem "mocha" end # vim: syntax=ruby diff --git a/lib/mms2r/media/sprint.rb b/lib/mms2r/media/sprint.rb index a04c1b4..49d99ac 100644 --- a/lib/mms2r/media/sprint.rb +++ b/lib/mms2r/media/sprint.rb @@ -1,198 +1,229 @@ #-- # Copyright (c) 2007-2010 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ require 'net/http' require 'nokogiri' require 'cgi' module MMS2R class Media ## # Sprint version of MMS2R::Media # # Sprint is an annoying carrier because they don't actually transmit user # generated content (like images or videos) directly in the MMS message. # Instead, they hijack the media that is sent from the cellular subscriber # and place that content on a content server. In place of the media # the recipient receives a HTML message with unsolicited Sprint # advertising and links back to their content server. The recipient has # to click through Sprint more pages to view the content. # # The default subject on these messages from the # carrier is "You have new Picture Mail!" module Sprint ## # Override process() because Sprint doesn't attach media (images, video, # etc.) to its MMS. Media such as images and videos are hosted on a # Sprint content server. MMS2R::Media::Sprint has to pick apart an # HTML attachment to find the URL to the media on Sprint's content # server and download each piece of content. Any text message part of # the MMS if it exists is embedded in the html. def process unless @was_processed log("#{self.class} processing", :info) #sprint MMS are multipart parts = @mail.parts #find the payload html doc = nil parts.each do |p| next unless p.part_type? == 'text/html' d = Nokogiri(p.body.decoded) title = d.at('title').inner_html if title =~ /You have new Picture Mail!/ doc = d @is_video = (p.body.decoded =~ /type=&quot;VIDEO&quot;&gt;/m ? true : false) end end return if doc.nil? # it was a dud @is_video ||= false # break it down sprint_phone_number(doc) sprint_process_text(doc) sprint_process_media(doc) @was_processed = true end # when process acts upon a block if block_given? media.each do |k, v| yield(k, v) end end end private ## # Digs out where Sprint hides the phone number def sprint_phone_number(doc) c = doc.search("/html/head/comment()").last t = c.content.gsub(/\s+/m," ").strip #@number returned in parent's #number @number = / name=&quot;MDN&quot;&gt;(\d+)&lt;/.match(t)[1] end ## # Pulls out the user text form the MMS and adds the text to media hash def sprint_process_text(doc) # there is at least one <pre> with MMS text if text has been included by # the user. (note) we'll have to verify that if they attach multiple texts # to the MMS then Sprint stacks it up in multiple <pre>'s. The only <pre> # tag in the document is for text from the user. + # if there is no text media found in the mail body - then we go to more + # extreme measures. + text_found = false + doc.search("/html/body//pre").each do |pre| type = 'text/plain' text = pre.inner_html.strip next if text.empty? + text_found = true type, text = transform_text(type, text) type, file = sprint_write_file(type, text.strip) add_file(type, file) unless type.nil? || file.nil? end + + # if no text was found, there still might be a message with images + # that can be seen at the end of the "View Entire Message" link + if !text_found + # Sprint uses AJAX/josn to serve up the content at the end of the link so this is conveluted + view_entire_message_link = doc.search("a").find { |link| link.inner_html == "View Entire Message"} + url = view_entire_message_link.attr("href") + # extract the "invite" param out of the url - this will be the id we pass to the ajax path below + inviteMessageId = CGI::parse(URI::parse(url).query)["invite"].first + json_url = "http://pictures.sprintpcs.com/ui-refresh/guest/getMessageContainerJSON.do%3FcomponentType%3DmediaDetail&invite=#{inviteMessageId}&externalMessageId=#{inviteMessageId}" + # pull down the json from the url and parse it + json_response = Net::HTTP.get_response(URI.parse(json_url)) + json = JSON.parse(json_response.body) + + # there may be multiple "results" in the json - due to multiple images + # cycle through them and extract the "description" which is the text + # message the sender sent with the images + json["Results"].each do |result| + type = 'text/plain' + text = result["description"] ? result["description"].strip : nil + next if text.empty? + type, text = transform_text(type, text) + type, file = sprint_write_file(type, text.strip) + add_file(type, file) unless type.nil? || file.nil? + end + end end ## # Fetch all the media that is referred to in the doc def sprint_process_media(doc) srcs = Array.new # collect all the images in the document, even though # they are <img> tag some might actually refer to video. # To know the link refers to vide one must look at the # content type on the http GET response. imgs = doc.search("/html/body//img") imgs.each do |i| src = i.attributes['src'] next unless src src = src.text # we don't want to double fetch content and we only # want to fetch media from the content server, you get # a clue about that as there is a RECIPIENT in the URI path # of real content next unless /mmps\/RECIPIENT\//.match(src) next if srcs.detect{|s| s.eql?(src)} srcs << src end #we've got the payload now, go fetch them cnt = 0 srcs.each do |src| begin uri = URI.parse(CGI.unescapeHTML(src)) unless @is_video query={} uri.query.split('&').each{|a| p=a.split('='); query[p[0]] = p[1]} query.delete_if{|k, v| k == 'limitsize' || k == 'squareoutput' } uri.query = query.map{|k,v| "#{k}=#{v}"}.join("&") end # sprint is a ghetto, they expect to see &amp; for video request uri.query = uri.query.gsub(/&/, "&amp;") if @is_video connection = Net::HTTP.new(uri.host, uri.port) #connection.set_debug_output $stdout response = connection.get2( uri.request_uri, { "User-Agent" => MMS2R::Media::USER_AGENT } ) content = response.body rescue StandardError => err log("#{self.class} processing error, #{$!}", :error) next end # if the Sprint content server uses response code 500 when the content is purged # the content type will text/html and the body will be the message if response.content_type == 'text/html' && response.code == "500" log("Sprint content server returned response code 500", :error) next end # setup the file path and file base = /\/RECIPIENT\/([^\/]+)\//.match(src)[1] type = response.content_type file_name = "#{base}-#{cnt}.#{self.class.default_ext(type)}" file = File.join(msg_tmp_dir(),File.basename(file_name)) # write it and add it to the media hash type, file = sprint_write_file(type, content, file) add_file(type, file) unless type.nil? || file.nil? cnt = cnt + 1 end end ## # Creates a temporary file based on the type def sprint_temp_file(type) file_name = "#{Time.now.to_f}.#{self.class.default_ext(type)}" File.join(msg_tmp_dir(),File.basename(file_name)) end ## # Writes the content to a file and returns the type, file as a tuple. def sprint_write_file(type, content, file = nil) file = sprint_temp_file(type) if file.nil? log("#{self.class} writing file #{file}", :info) # force the encoding to be utf-8 content = content.force_encoding("UTF-8") if content.respond_to?(:force_encoding) File.open(file,'w'){ |f| f.write(content) } return type, file end end end end
monde/mms2r
9227e1c22ac9ab586a60f3d6ce1a061944217cfc
Strip Windows phone's default footer.
diff --git a/History.txt b/History.txt index 76f7fba..3f8ba80 100644 --- a/History.txt +++ b/History.txt @@ -1,418 +1,423 @@ +### 3.6.3 / 2012-03.25 (Dethklok Minute Host - host of The Dethklok Minute) + +* 1 minor enhancement + * strip Windows phone default footer + ### 3.6.2 / 2012-02-12 (Mr. Gojira - Owner Mr. Gojira's Driving School - retake driver's exam) * 1 minor enhancement * Change user agent given to Sprint so it returns a properly sized image. ### 3.6.1 / 2012-02-11 (Mr. Gojira - Owner Mr. Gojira's Driving School) * 1 minor enhancement * use Net::HTTP#get2 to fetch Sprint content ### 3.6.0 / 2012-01-19 (Agent 216 - assassin, master of infiltration and sabotage) * 1 major enhancement * Ruby 1.8.7, 1.9.2, and 1.9.3 compatible * 1 bug fix * A fix for the utf-8 encoding issue with ruby 1.9.2 - minimul / Christian ### 3.5.1 / 2011-12-11 (Mashed Potato Johnson - oldest living blues guitarist in the world) * 1 bug fix * A fix for the utf-8 encoding issue with ruby 1.9.2 - James McGrath ### 3.5.0 / 2011-12-01 (Dr. Milminiman Lamilim Swimwambli - Marriage expert) * 1 major bug fix * In Ruby 1.9.X MMS2R::Media::Sprint was not fetching content from Sprint's CDN correctly because the implementation of Net::HTTP in 1.9.X passes a User-Agent header of "Ruby" to which Sprint responds with a fake 500 - with help from James McGrath ### 3.4.1 / 2011-11-06 (Fatty Ding-Dongs, Dethklok foster child) * 2 major enhancements * Additional means to detect android, iphone, motorola, nokia, palm handsets * Additional known SMS/MMS domains mm.att.net, labwig.net, cdma.sasktel.com ### 3.4.0 / 2011-10-31 (Serveta Skwigelf, Skwisgaar's hot mom) * 2 major enhancements * regexp's in yaml configs are store as a ruby regexp and not a string that is evaled. * character encoding capability with 1.8 rubies and 1.9 rubies. ### 3.3.1 / 2011-01-01 (Reverend Aslaug Wartooth (deceased), Toki's dad) * 2 minor enhancements * new method #default_html returns the default html attachment * #body will return the default plain text, or default stripped html text ### 3.3.0 / 2010-12-31 (Charles Foster Offdensen - CFO, dethklok) * 1 major enhancement * MMS2R::Media::Sprint is now a module that is extended in for processing Sprint content rather than being child class of MMS2R::Media Extension is the strategy to use for overwriting template methods now * 1 minor enhancement * process new Sprint subject - Jason Hooper * new SaskTel mms/sms domain alias sasktel.com * new Virgin Mobile mms/sms domain alias yrmobl.com ### 3.2.0 / 2010-08-17 (Antonio "Tony" DiMarco Thunderbottom - bassist) * 3 minor enhancements * updated readme with latest sites known to use mms2r * bundler assimilated * loading rubygems only if it's required, like rake ### 3.1.0 / 2010-07-09 (Dick "Magic Ears" Knubbler - music producer) * 8 minor enhancements * Detects additional Bell/AT&T domain sbcglobal.net as a handset * Detects additional Virgin mobile domains pixmbl.com vmobl.com as a handset * Expanded mobile phone detection for handset makers by : Casio, Google Nexus One, LG Electronics, Motorola, Pantech, Qualcom, Samsung, Sprint, UTStarCom * EXIF Reader (exifr) is integral to MMS2R and is now a required gem * upgrade Mail to 2.2.5 * depend on latest gems * corrected example - Jason Hooper * added As Seen On The Internet to README that lists sites known to be using MMS2R in some fashion ### 3.0.1 / 2010-03-28 (Lavona Succuboso - leader of "Succuboso Explosion") * 1 minor enhancement * support for U.S. Cellular ### 3.0.0 / 2010-02-24 (General Crozier - Chairman of the Joint Chiefs of Staff) * 1 new feature * dependence upon Mail gem rather than TMail gem ### 2.4.1 / 2010-02-07 (Vater Orlaag - political and spiritual specialist) * 3 minor enhancements * make sure filename is free of new lines - laurynas * recognize HTC HERO200 as a smart phone * recognize HTC Eris as a smart phone ### 2.4.0 / 2009-12-20 (Dr. Nanemiltred Philtendrieden - specialist on celebrity death) * 1 new feature * replace Hpricot with Nokogiri for html parsing of Sprint data * 3 minor enhancements * smartphone identities stored in conf/mms2r_media.yml * identify Motorola Droid as a smartphone * identify T-Mobile Dash as a smartphone * use uuidtools for naming temp directories - kbaum ### 2.3.0 / 2009-08-30 (Snakes 'n' Barrels Greatest Hits) * 5 new features * detect smartphone status/type based on model metadata from jpeg and tiff exif data using exifr gem, access exif data with MMS2R::Media#exif * make MMS2R Rails gem packaging friendly with an init.rb - Scott Taylor, smtlaissezfaire * delegate missing methods to mms2r's tmail object so that mms2r behaves as if it were a tmail object - Sai Emrys, saizai * default_media can return an attachment of application content type - Brendan Lim, brendanlim * MMS2R.parse(raw_mail) convenience class method that parses and returns an mms2r from a mail file - saizai * 4 minor enhancements * make examples more 'mail' specific to enforce the fact that an mms is a multipart email - saizai * update for text in vzwpix.com default carrier message * detecting smartphone (blackberries and iphones for now) is more versatile from reading mail headers * expanded filtering of carrier advertising text in mms from smartphones ### 2.2.0 / 2009-01-04 (Rikki Kixx - owner of a franchise of rehab centers) * 3 new features * MMS2R::Media#is_mobile? best guess if the sender was a mobile device * MMS2R::Media#device_type? best guess of the mobile device type. Simple heuristics thus far for :blackberry :iphone :handset :unknown could be expanded for exif probing or additinal shifting of mail header * from array in conf/from.yml to provide granularity to determine carrier domain (caused by tmo.blackberry.net) * 4 minor enhancements * support for Virgin Canada messaging service vmobile.ca * support for text service messaging.sprintpcs.com * additional BlackBerry coverage from T-Mobile tmo.blackberry.net provider * legacy support for mobile.mycingular.com, pics.cingularme.com * 3 bug fixes * iPhone default subject - jesse dp http://rubyforge.org/tracker/?func=detail&atid=11789&aid=22951&group_id=3065 * add sprintpcs.com to pm.sprint.com aliases * fix OS X long filename issues - Matt Conway ### 2.1.3 / 2008-11-06 (Dr. Ramonolith Chesterfield - Military pharmaceutical psychotropic drug manufacturing expert * 1 minor enhancement * added mms.ae support ### 2.1.2 / 2008-10-21 (Toki's mom, Anja Wartooth) * 2 minor enhancments * Sprint subject update - jesse dp * Virgin Mobile support vmpix.com ### 2.1.1 / 2008-09-24 (Lavona Succuboso, Nathan Explosion uber-groupie) * 4 minor enhancments * Bell Canada support txt.bell.ca - Matt Conway / Snap My Life - http://github.com/wr0ngway, http://github.com/sml * Unicel support unicel.com - Michael DelGaudio * info2go.com support / Unicel * TELUS Corporation support mms.telusmobility.com, msg.telus.com * add test to check that gem builds correctly as a github gem * 1 bug fix * Iconv utf8 fix - Kai Kai ### 2.1.0 / 2008-07-30 (Dr. Gibbons – Birthday expert and Murderface expert) * 1 major enhancement: * opens up TMail for improved query method patterned code in MMS2R * 2 minor enhancements: * UK O2 support mediamessaging.o2.co.uk - Jeremy Wilkins * Write non text files with binary bit set on Windows - David Alm * source hosted on github: git clone git://github.com/monde/mms2r.git ### 2.0.5 / 2008-07-17 (Dr. Ralphus Galkensmelter - Psychological death expert) * Deal with Apple Mail multipart/appledouble - jesse dp ### 2.0.4 / 2008-04-28 (Mr. Selatcia - elder member of The Tribunal) * updated mms.vodacom4me.co.za Vodacom South Africa - Vijay Yellapragada * 1nbox.net / Idea cellular 1nbox.net - Vijay Yellapragada * mms.3ireland.ie / 3 Ireland - Vijay Yellapragada * mms.alltel.com / Alltel (reverted message.alltel.com) - Vijay Yellapragada * mms.mobileiam.ma / Maroc Telecom - Vijay Yellapragada * mms.mtn.co.za / MTM South Africa - Vijay Yellapragada * rci.rogers.com / Rogers of Canada - Vijay Yellapragada * mmsreply.t-mobile.co.uk / T-Mobile UK - Vijay Yellapragada * waw.plspictures.com / PLSPICTURES.COM mms hosting service ### 2.0.3 / 2008-04-15 (Enter Taxman - The 1040 MMS Form) * fix case when part is image/jpeg declared 'application/octet-stream' * trim dangling image/jpeg text from blackberry messages * file extensions added to filenames that are missing extensions in part headers * anonymize images in fixtures to reduce gem size * T-Mobile update - jesse dp * AT&T/T-Mobile Blackberrry update - Dave Myron ### 2.0.2 / 2008-02-22 (The Jomfru Brothers - proprietors of diefordethklok.com) * added support for mms.vodacom4me.co.za Vodacom South Africa - Jason Haruska * added support for bellsouth.net - Jason Haruska * added support for mms.mycricket.com * Improved Blackberry and iPhone suport - Jason Haruska * added :number key to configuration to provide rules for specifying alternative phone number location * return sender's phone number for mobile.indosat.net.id * return sender's phone number for mms.luxgsm.lu * return sender's phone number for mms.vodacom4me.co.za ### 2.0.1 / 2008-02-08 (Professor Jerry Gustav Munndig - Child control expert) * strip out common blackberry and iPhone signatures * handle carriers that use external mail services such as Yahoo! as the From address * Add support for mobile.indosat.net.id (and yahoo.co.id) - Jason Haruska * Add support for sms.sasktel.com - Jason Haruska ### 2.0.0 / 2008-01-23 (Skwisgaar Skwigelf - fastest guitarist alive) * added support for pxt.vodafone.net.nz PXT New Zealand * added support for mms.o2online.de O2 Germany * added support for orangemms.net Orange UK * added support for txt.att.net AT&T * added support for mms.luxgsm.lu LUXGSM S.A. * added support for mms.netcom.no NetCom (Norway) * added support for mms.three.co.uk Hutchison 3G UK Ltd * removed deprecated #get_number use #number * removed deprecated #get_subject use #subject * removed deprecated #get_body use #body * removed deprecated #get_media use #default_media * removed deprecated #get_text use #default_text * removed deprecated #get_attachment use #attachment * fixed error when Sprint content server responds 500 * better yaml configs * moved TMail dependency from Rails ActionMailer SVN to 'official' Gem * ::new greedily processes MMS unless otherwise specified as an initialize option :process => :lazy * logger moved to initialize option :logger => some_logger * testing using mocks and stubs instead of duck raped Net::HTTP * fixed typo in name of method #attachement to #attachment * fixed broken downloading of Sprint videos ### 1.1.12 / 2007-10-21 (Dr. Ronald von Moldenberg - Endorsement specialist) * fetch original images from Sprint content server (Layton Wedgeworth) * ignore Sprint messages when requested content has been purged from their content server ### 1.1.11 / 2007-10-20 (Dr. Armand Skagerakk Frederickshaven - Mythology expert) * minor fix for attachment_fu where it might call #path on the cgi temp file that is returned by get_attachment * renamed a_t_t_media.rb to att_media.rb to make it autotest happy * masthead.jpg misplaced in mms2r_t_mobile_media_ignore.yml (Layton Wedgeworth) * overridden SprintMedia#process failed to accept block (Layton Wedgeworth) * added method_deprecated to help mark methods that are going to be deprecated in preparation of 1.2.x release * #get_number marked deprecated, use #number instead * #get_subject marked deprecated, use #subject instead * #get_body marked deprecated, use #body instead * #get_text marked deprecated, use #default_text instead * #get_attachment marked deprecated, use #attachment instead * #get_media marked deprecated, use #default_media instead ### 1.1.10 / 2007-09-30 (Face Bones) * fixed a case for a nil match on From in the create method (Luke Francl) * added support for Alltel message.alltel.com (Ben Wood) ### 1.1.9 / 2007-09-08 (Rebecca Nightrod - controlling girlfriend of Nathan Explosion) * fixed broken support for act_as_attachment and attachment_fu ### 1.1.8 / 2007-09-08 (James Grishnack - Head of Behemoth Productions, producer of Blood Ocean) * Added support for Orange of France, Orange orange.fr (Julian Biard) * purge in the process block removed, purge must be called explicitly after processing to clean up extracted temporary media files. ### 1.1.7 / 2007-08-25 (Adam Nergal, friend of Skwisgaar, but not Pickles) * Added support for Orange of Poland, Orange mmsemail.orange.pl (Zbigniew Sobiecki) * Cleaned up documentation modifiers * Cleaned out non-Ruby code idioms ### 1.1.6 / 2007-08-11 (Mustakrakish, the Lake Troll part 2) * Redo of release mistake of 1.1.5 ### 1.1.5 / 2007-08-11 (Mustakrakish, the Lake Troll) * AT&T => mms.att.net not clearing out default "multimedia message" subject to nil (Will Jessup) * Ignore case on default subject for all carriers in corresponding conf/mms2r_XXX_media_subject.yml ### 1.1.4 / 2007-08-07 (Dr. Rockso) * AT&T => mms.att.net support (thanks Mike Chen and Dave Myron) * get_body returns nil when there is not user text (sorry Will!) ### 1.1.3 / 2007-07-10 (Charles Foster Ofdensen) * Helio support by Will Jessup * get_subject returns nil on default carrier subjects ### 1.1.2 / 2007-06-13 (Dethklok roadie #2) * placed versioned hpricot dependency in Hoe's extra_deps (an attempt to appease firebrigade gods or not cause Gem::RemoteInstallationCancelled whichever you prefer) ### 1.1.1 / 2007-06-11 (Dethklok roadie) * rescue rcov non-dependency in Rakefile to make firebrigade happy ### 1.1.0 / 2007-06-08 (Toki Wartooth) * get_body to return body text (Luke Francl) * get_subject returns "" for default subjects now * default subjects listed in yaml by carrier in conf directory * added granularity to Cingular, Sprint, and Verizon carrier services (Will Jessup) * refactored Sprint instance to process all media (Will Jessup + Mike) * optimized text transformations (Will Jessup) * properly handle ISO-8859-1 and UTF-8 text (Will Jessup) * autotest powers activate! (ZenTest autotest discovery enabled) * configuration file ignores, transforms, and subjects all store Regexp's * Put vendor Text::Format & TMail::Mail as an external subversion dependency to the 1.2 stable branch of Rails ActionMailer * added get_number method to return the phone number associated with this MMS * get_media and get_text attachment_fu helper return the largest piece of media of that type if the more than one exits in the media (Luke Francl) * added block support to process() method (Shane Vitarana) ### 1.0.7 / 2007-04-27 (Senator Stampingston) * patch submitted by Luke Francl * added a get_subject method that returns nil when any MMS has a default carrier subject * get_subject returns nil for '', 'Multimedia message', '(no subject)', 'You have new Picture Mail!' ### 1.0.6 / 2007-04-24 (Pickles the Drummer) * patch submitted by Luke Francl * added support for mms.dobson.net (Dobson aka Cellular One) (Luke) * DRY'd up unit tests (Luke) * added get_media instance method that returns first video or image as File (Luke) * File from get_media can be used by/with attachment_fu (Luke) * added get_text instance method that returns first non advertising text * File from get_text can be used by/with attachment_fu ### 1.0.5 / 2007-04-10 (William Murderface) * patch submitted by Luke Francl * made ignore_media? start its text check from the start of the file (Luke) * added new text transform for Verizon messages (Luke) * updated Nextel ignore conf (Luke) * added additional samples and tests for T-Mobile & Verizon (Luke) * cleaned up MMS2R::Media documentation * added Sprint broken image test for when media goes stale on their content server * fixed teardown typo in lots of plases * added tests for 4 three samples of unique variants of Sprint/Nextel text * 100% test coverage! ### 1.0.4 / 2007-04-09 (Metalocalypse) * fix teardown in test_mms2r_sprint.rb (shanesbrain.net) * clean up Net::HTTP in MMS2R::SprintMedia (shanesbrain.net) * added accessor MMS2R::Media.media_dir * fixed a nil issue with underlying tmp working dir * added exception handling around Net::HTTP in MMS2R::SprintMedia ### 1.0.3 / 2007-04-05 (Paper Cut) * Cleaned up packaging and errors in example found by Shane V. http://shanesbrain.net/ ### 1.0.2 / 2007-03-07 * Reorganized tests and fixtures * Added carriers: * Cingular => cingularme.com * Nextel => messaging.nextel.com * Verizon => vtext.com ### 1.0.1 / 2007-03-07 * Flubbed RubyForge release ... do not use this. ### 1.0.0 / 2007-03-06 * Birthday! * AT&T/Cingular => mmode.com * Cingular => mms.mycingular.com * Sprint => pm.sprint.com * Sprint => messaging.sprintpcs.com * T-Mobile => tmomail.net * Verizon => vzwpix.com diff --git a/conf/mms2r_media.yml b/conf/mms2r_media.yml index 6d0ec63..3ecd090 100644 --- a/conf/mms2r_media.yml +++ b/conf/mms2r_media.yml @@ -1,76 +1,79 @@ --- ignore: text/plain: - !ruby/regexp /^\(no subject\)$/i - !ruby/regexp /\ASent via BlackBerry (from|by) .*$/im + - !ruby/regexp /\ASent from my Windows Phone.*$/im - !ruby/regexp /\ASent from my Verizon Wireless BlackBerry$/im - !ruby/regexp /\ASent from (my|your) iPhone.?$/im - !ruby/regexp /\ASent on the Sprint.* Now Network.*$/im multipart/mixed: - !ruby/regexp "/^Attachment: /i" transform: text/plain: - - !ruby/regexp /\A(.*?)Sent via BlackBerry (from|by) .*$/im - "\\1" + - - !ruby/regexp /\A(.*?)Sent from my Windows Phone.*$/im + - "\\1" - - !ruby/regexp /\A(.*?)Sent from my Verizon Wireless BlackBerry$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from (my|your) iPhone.?$/im - "\\1" - - !ruby/regexp /\A(.*?)\s+image\/jpeg$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent on the Sprint.* Now Network.*$/im - "\\1" device_types: boundary: :motorola: !ruby/regexp /Motorola-A-Mail/i headers: x-mailer: :iphone: !ruby/regexp /iPhone Mail/i :blackberry: !ruby/regexp /Palm webOS/i mime-version: :iphone: !ruby/regexp /iPhone Mail/i x-rim-org-msg-ref-id: :blackberry: !ruby/regexp /.+/ user-agent: :iphone: !ruby/regexp /iPhone/i # TODO do something about the assortment of camera models that have # been seen: # 1.3 Megapixel, 2.0 Megapixel, BlackBerry, CU920, G'z One TYPE-S, # Hermes, iPhone, LG8700, LSI_S5K4AAFA, Micron MT9M113 1.3MP YUV, # Motorola Phone, Omni_vision-9650, Pre, # Seoul Electronics & Telecom SIM120B 1.3M, SGH-T729, SGH-T819, # SPH-M540, SPH-M800, SYSTEMLSI S5K4BAFB 2.0 MP, VX-9700 # # NOTE: These model strings are stored in the exif model header of an image file # created and sent by the device, the regex is used by mms2r to detect the # model string makes: :android: !ruby/regexp /Android/i :apple: !ruby/regexp /^(Apple|Hipstamatic)$/i :casio: !ruby/regexp /^CASIO$/i :dash: !ruby/regexp /T-Mobile Dash/i :google: !ruby/regexp /^google$/i :htc: !ruby/regexp /^HTC/i :lge: !ruby/regexp /^(LG|CX87BL05)/i :motorola: !ruby/regexp /^Motorola/i :nokia: !ruby/regexp /^Nokia/i :pantech: !ruby/regexp /^PANTECH$/i :palm: !ruby/regexp /Palm/i :qualcomm: !ruby/regexp /^MSM6/i :research_in_motion: !ruby/regexp /^(RIM|Research In Motion)$/i :samsung: !ruby/regexp /^(SAMSUNG|ES.M800|M6550B-SAM-4480)/i :seoul_electronics: !ruby/regexp /^ISUS0/i :sprint: !ruby/regexp /^Sprint$/i :utstarcom: !ruby/regexp /^T1A_UC1.88$/i models: :blackberry: !ruby/regexp /BlackBerry/i :centro: !ruby/regexp /^Palm Centro$/i :dash: !ruby/regexp /T-Mobile Dash/i :droid: !ruby/regexp /Droid/i :htc: !ruby/regexp /HTC|Eris|HERO200/i :iphone: !ruby/regexp /iPhone/i software: :blackberry: !ruby/regexp /^Rim Exif/i filenames: :iphone: !ruby/regexp /^photo\.(JPG|PNG)$/ :video: !ruby/regexp /\.3gp$/ diff --git a/lib/mms2r.rb b/lib/mms2r.rb index 8075184..80df937 100644 --- a/lib/mms2r.rb +++ b/lib/mms2r.rb @@ -1,83 +1,83 @@ #-- # Copyright (c) 2007-2010 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ module MMS2R ## # A hash of MMS2R processors keyed by MMS carrier domain. CARRIERS = {} ## # Registers a class as a processor for a MMS domain. Should only be # used in special cases such as MMS2R::Media::Sprint for 'pm.sprint.com' def self.register(domain, processor_class) MMS2R::CARRIERS[domain] = processor_class end ## # A hash of file extensions for common mime-types EXT = { 'text/plain' => 'text', 'text/plain' => 'txt', 'text/html' => 'html', 'image/png' => 'png', 'image/gif' => 'gif', 'image/jpeg' => 'jpeg', 'image/jpeg' => 'jpg', 'video/quicktime' => 'mov', 'video/3gpp2' => '3g2' } class MMS2R::Media ## # MMS2R library version - VERSION = '3.6.2' + VERSION = '3.6.3' ## # Spoof User-Agent, primarily for the Sprint CDN USER_AGENT = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.120 Safari/535.2" end # Simple convenience function to make it a one-liner: # MMS2R.parse raw_mail or MMS2R.parse File.load(raw_mail) # Combined w/ the method_missing delegation, this should behave as an enhanced Mail object, more or less. def self.parse raw_mail, options = {} mail = Mail.new raw_mail MMS2R::Media.new(mail, options) end end %W{ yaml mail fileutils pathname tmpdir yaml digest/sha1 iconv exifr }.each do |g| begin require g rescue LoadError require 'rubygems' require g end end if RUBY_VERSION >= "1.9" begin require 'psych' YAML::ENGINE.yamler= 'syck' if defined?(YAML::ENGINE) rescue LoadError end end require File.join(File.dirname(__FILE__), 'ext/mail') require File.join(File.dirname(__FILE__), 'ext/object') require File.join(File.dirname(__FILE__), 'mms2r/media') require File.join(File.dirname(__FILE__), 'mms2r/media/sprint') MMS2R.register('pm.sprint.com', MMS2R::Media::Sprint) diff --git a/test/test_helper.rb b/test/test_helper.rb index a3ecc50..a2c57ca 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,102 +1,97 @@ # do it like rake http://ozmm.org/posts/do_it_like_rake.html %W{ test/unit set net/http net/https pp tempfile mocha rcov/rcovtask }.each do |g| begin require g rescue LoadError require 'rubygems' require g end end -# NOTE when we upgrade to test-unit 2.x.x or greater we'll not need redgreen, -# it's baked into test-unit -begin require 'redgreen'; rescue LoadError; end - require File.join(File.expand_path(File.dirname(__FILE__)), '..', 'lib', 'mms2r') module MMS2R module TestHelper def assert_file_size(file, size) assert_not_nil(file, "file was nil") assert(File::exist?(file), "file #{file} does not exist") assert(File::size(file) == size, "file #{file} is #{File::size(file)} bytes, not #{size} bytes") end def fixture(file) File.join(File.expand_path(File.dirname(__FILE__)), "fixtures", file) end def fixture_data(name) open(fixture(name)).read end def mail_fixture(file) fixture(file) end def mail(name) Mail.read(mail_fixture(name)) end def smart_phone_mock(make_text = 'Apple', model_text = 'iPhone', software_text = nil, jpeg = true) mail = stub('mail', :from => ['[email protected]'], :return_path => '<[email protected]>', :message_id => 'abcd0123', :multipart? => true, :header => {}) part = stub('part', :part_type? => "image/#{jpeg ? 'jpeg' : 'tiff'}", :body => Mail::Body.new('abc'), :multipart? => false, :filename => "foo.#{jpeg ? 'jpg' : 'tif'}" ) mail.stubs(:parts).returns([part]) exif = stub('exif', :make => make_text, :model => model_text, :software => software_text) if jpeg EXIFR::JPEG.expects(:new).at_least_once.returns(exif) else EXIFR::TIFF.expects(:new).at_least_once.returns(exif) end mail end end end class Hash def except(*keys) rejected = Set.new(respond_to?(:convert_key) ? keys.map { |key| convert_key(key) } : keys) reject { |key,| rejected.include?(key) } end def except!(*keys) replace(except(*keys)) end end # monkey patch Net::HTTP so un caged requests don't go over the wire module Net #:nodoc: class HTTP #:nodoc: alias :old_net_http_request :request alias :old_net_http_connect :connect def request(req, body = nil, &block) - prot = use_ssl ? "https" : "http" uri_cls = use_ssl ? URI::HTTPS : URI::HTTP query = req.path.split('?',2) opts = {:host => self.address, :port => self.port, :path => query[0]} opts[:query] = query[1] if query[1] uri = uri_cls.build(opts) raise ArgumentError.new("#{req.method} method to #{uri} not being handled in testing") end def connect raise ArgumentError.new("connect not being handled in testing") end end end diff --git a/test/test_mms2r_media.rb b/test/test_mms2r_media.rb index 3bca5a0..5dd4389 100644 --- a/test/test_mms2r_media.rb +++ b/test/test_mms2r_media.rb @@ -1,707 +1,708 @@ # encoding: UTF-8 require "test_helper" class TestMms2rMedia < Test::Unit::TestCase include MMS2R::TestHelper def use_temp_dirs MMS2R::Media.tmp_dir = @tmpdir MMS2R::Media.conf_dir = @confdir end def setup @oldtmpdir = MMS2R::Media.tmp_dir || File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") @oldconfdir = MMS2R::Media.conf_dir || File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") FileUtils.mkdir_p(@oldtmpdir) FileUtils.mkdir_p(@oldconfdir) @tmpdir = File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") FileUtils.mkdir_p(@tmpdir) @confdir = File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") FileUtils.mkdir_p(@confdir) end def teardown FileUtils.rm_rf(@tmpdir) FileUtils.rm_rf(@confdir) MMS2R::Media.tmp_dir = @oldtmpdir MMS2R::Media.conf_dir = @oldconfdir end def stub_mail(vals = {}) attrs = { :from => '[email protected]', :to => '[email protected]', :subject => 'This is a test email', :body => 'a', }.merge(vals) Mail.new do from attrs[:from] to attrs[:to] subject attrs[:subject] body attrs[:body] end end def test_faux_user_agent assert_equal "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.120 Safari/535.2", MMS2R::Media::USER_AGENT end def test_class_parse mms = mail('generic.mail') assert_equal ['[email protected]'], mms.from end def temp_text_file(text) tf = Tempfile.new("test" + rand.to_s) tf.puts(text) tf.close tf.path end def test_tmp_dir use_temp_dirs() MMS2R::Media.tmp_dir = @tmpdir assert_equal @tmpdir, MMS2R::Media.tmp_dir end def test_conf_dir use_temp_dirs() MMS2R::Media.conf_dir = @confdir assert_equal @confdir, MMS2R::Media.conf_dir end def test_safe_message_id mid1_b="1234abcd" mid1_a="1234abcd" mid2_b="<01234567.0123456789012.JavaMail.fooba@foo-bars999>" mid2_a="012345670123456789012JavaMailfoobafoo-bars999" assert_equal mid1_a, MMS2R::Media.safe_message_id(mid1_b) assert_equal mid2_a, MMS2R::Media.safe_message_id(mid2_b) end def test_default_ext assert_equal nil, MMS2R::Media.default_ext(nil) assert_equal 'text', MMS2R::Media.default_ext('text') assert_equal 'txt', MMS2R::Media.default_ext('text/plain') assert_equal 'test', MMS2R::Media.default_ext('example/test') end def test_base_initialize_config_tries_to_open_default_config_yaml f = File.join(MMS2R::Media.conf_dir, 'mms2r_media.yml') YAML.expects(:load_file).once.with(f).returns({}) config = MMS2R::Media.initialize_config(nil) end def test_base_initialize_config config = MMS2R::Media.initialize_config(nil) # test defaults shipped in mms2r_media.yml assert_not_nil config assert_equal true, config['ignore'].is_a?(Hash) assert_equal true, config['transform'].is_a?(Hash) assert_equal true, config['number'].is_a?(Array) end def test_instance_initialize_config mms = MMS2R::Media.new stub_mail config = mms.initialize_config(nil) # test defaults shipped in mms2r_media.yml assert_not_nil config assert_equal true, config['ignore'].is_a?(Hash) assert_equal true, config['transform'].is_a?(Hash) assert_equal true, config['number'].is_a?(Array) end def test_initialize_config_contatenation c = {'ignore' => {'text/plain' => [/A TEST/]}, 'transform' => {'text/plain' => [/FOO/, '']}, 'number' => ['from', /^([^\s]+)\s.*/, '\1'] } config = MMS2R::Media.initialize_config(c) assert_not_nil config['ignore']['text/plain'].detect{|v| v == /A TEST/} assert_not_nil config['transform']['text/plain'].detect{|v| v == /FOO/} assert_not_nil config['number'].first == 'from' end def test_aliased_new_returns_default_processor_instance mms = MMS2R::Media.new stub_mail assert_not_nil mms assert_equal true, mms.respond_to?(:process) assert_equal MMS2R::Media, mms.class end def test_lazy_process_option mms = MMS2R::Media.new stub_mail, :process => :lazy mms.expects(:process).never end def test_logger_option logger = mock() logger.expects(:info).at_least_once mms = MMS2R::Media.new stub_mail, :logger => logger end def test_default_processor_initialize_tries_to_open_config_for_carrier mms_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'mms2r_media.yml')) aliases_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'aliases.yml')) from_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'from.yml')) example_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'example.com.yml')) YAML.expects(:load_file).at_least_once.with(mms_yaml).returns({}) YAML.expects(:load_file).at_least_once.with(aliases_yaml).returns({}) YAML.expects(:load_file).at_least_once.with(from_yaml).returns([]) YAML.expects(:load_file).never.with(example_yaml) mms = MMS2R::Media.new stub_mail end def test_mms_phone_number mail = stub_mail mail.stubs(:from).returns(['[email protected]']) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number end def test_mms_phone_number_from_config mail = stub_mail(:from => '"+2068675309" <[email protected]>') mms = MMS2R::Media.new(mail) mms.expects(:config).once.returns({'number' => ['from', /^([^\s]+)\s.*/, '\1']}) assert_equal '+2068675309', mms.number end def test_mms_phone_number_with_errors mail = stub_mail mail.stubs(:from).returns(nil) mms = MMS2R::Media.new(mail) assert_nothing_raised do assert_equal '', mms.number end end def test_transform_text_plain mail = stub_mail mail.stubs(:from).returns(nil) mms = MMS2R::Media.new(mail) type = 'test/type' text = 'hello' # no match in the config result = [type, text] assert_equal result, mms.transform_text(type, text) # testing the default config + assert_equal ['text/plain', ''], mms.transform_text('text/plain', "Sent from my Windows Phone") assert_equal ['text/plain', ''], mms.transform_text('text/plain', "Sent via BlackBerry from T-Mobile") assert_equal ['text/plain', ''], mms.transform_text('text/plain', "Sent from my Verizon Wireless BlackBerry") assert_equal ['text/plain', ''], mms.transform_text('text/plain', 'Sent from my iPhone') assert_equal ['text/plain', ''], mms.transform_text('text/plain', 'Sent from your iPhone.') assert_equal ['text/plain', ''], mms.transform_text('text/plain', " \n\nimage/jpeg") # has a bad regexp mms.expects(:config).at_least_once.returns({'transform' => {type => [['(hello)', 'world']]}}) assert_equal result, mms.transform_text(type, text) # matches in config mms.expects(:config).at_least_once.returns({'transform' => {type => [[/(hello)/, 'world']]}}) assert_equal [type, 'world'], mms.transform_text(type, text) mms.expects(:config).at_least_once.returns({'transform' => {type => [[/^Ignore this part, (.+)/, '\1']]}}) assert_equal [type, text], mms.transform_text(type, "Ignore this part, " + text) # chaining transforms mms.expects(:config).at_least_once.returns({'transform' => {type => [[/(hello)/, 'world'], [/(world)/, 'mars']]}}) assert_equal [type, 'mars'], mms.transform_text(type, text) # has a Iconv problem mms.expects(:config).at_least_once.returns({'transform' => {type => [['(hello)', 'world']]}}) assert_equal result, mms.transform_text(type, text) end def test_transform_text_to_utf8 mail = mail('iconv-fr-text-01.mail') mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_equal 1, mms.media['text/plain'].size assert_equal 1, mms.media['text/html'].size file = mms.media['text/plain'][0] assert_not_nil file assert_equal true, File::exist?(file) text_lines = IO.readlines("#{file}") text = text_lines.join # ASCII-8BIT -> D'ici un mois G\xE9orgie # UTF-8 -> D'ici un mois Géorgie if RUBY_VERSION < "1.9" assert_equal("sample email message Fwd: sub D'ici un mois Géorgie", mms.subject) assert_equal("D'ici un mois Géorgie body", text_lines.first.strip) else assert_equal(Iconv.new('UTF-8', 'ISO-8859-1').iconv("sample email message Fwd: sub D'ici un mois Géorgie"), mms.subject) assert_equal(Iconv.new('UTF-8', 'ISO-8859-1').iconv("D'ici un mois G\xE9orgie body"), text_lines.first.strip) end end def test_subject s = 'hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) assert_equal s, mms.subject # second time through shouldn't process the subject again mail.expects(:subject).never assert_equal s, mms.subject end def test_subject_with_bad_mail_subject mail = stub_mail mail.stubs(:subject).returns(nil) mms = MMS2R::Media.new(mail) assert_equal '', mms.subject end def test_subject_with_subject_ignored s = 'hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) mms.stubs(:config).returns({'ignore' => {'text/plain' => [s]}}) assert_equal '', mms.subject end def test_subject_with_subject_transformed s = 'Default Subject: hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) mms.stubs(:config).returns( { 'ignore' => {}, 'transform' => {'text/plain' => [[/Default Subject: (.+)/, '\1']]}}) assert_equal 'hello world', mms.subject end def test_attachment_should_return_nil_if_files_for_type_are_not_found mms = MMS2R::Media.new stub_mail mms.stubs(:media).returns({}) assert_nil mms.send(:attachment, ['text']) end def test_attachment_should_return_nil_if_empty_files_are_found mms = MMS2R::Media.new stub_mail mms.stubs(:media).returns({'text/plain' => [Tempfile.new('test')]}) assert_nil mms.send(:attachment, ['text']) end def test_type_from_filename mms = MMS2R::Media.new stub_mail assert_equal 'image/jpeg', mms.send(:type_from_filename, "example.jpg") end def test_type_from_filename_should_be_nil mms = MMS2R::Media.new stub_mail assert_nil mms.send(:type_from_filename, "example.example") end def test_attachment_should_return_duck_typed_file mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") size = File.size(temp_text_file("hello world")) temp_small = temp_text_file("hello") mms.stubs(:media).returns({'text/plain' => [temp_small, temp_big]}) duck_file = mms.send(:attachment, ['text']) assert_not_nil duck_file assert_equal true, File::exist?(duck_file) assert_equal true, File::exist?(temp_big) assert_equal temp_big, duck_file.local_path assert_equal File.basename(temp_big), duck_file.original_filename assert_equal size, duck_file.size assert_equal 'text/plain', duck_file.content_type end def test_empty_body mms = MMS2R::Media.new stub_mail mms.stubs(:default_text).returns(nil) assert_equal "", mms.body end def test_body mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") mms.stubs(:default_text).returns(File.new(temp_big)) body = mms.body assert_equal "hello world", body end def test_body_when_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") mms.stubs(:default_html).returns(File.new(temp_big)) assert_equal "hello world teapot", mms.body end def test_default_text mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'text/plain' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_text.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_text.local_path end def test_default_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") temp_small = temp_text_file("<html><head><title>hello</title></head><body>world<body></html>") mms.stubs(:media).returns({'text/html' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_html.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_html.local_path end def test_default_media mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'image/jpeg' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_media.local_path end def test_default_media_treats_image_and_video_equally mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big_image = temp_text_file("hello world") temp_small_image = temp_text_file("hello") temp_big_video = temp_text_file("hello world again") temp_small_video = temp_text_file("hello again") mms.stubs(:media).returns({'image/jpeg' => [temp_small_image, temp_big_image], 'video/mpeg' => [temp_small_video, temp_big_video], }) assert_equal temp_big_video, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big_video, mms.default_media.local_path end #def test_default_media_treats_gif_and_jpg_equally # #it doesn't matter that these are text files, we just need say they are images # temp_big = temp_text_file("hello world") # temp_small = temp_text_file("hello") # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/jpeg' => [temp_big], 'image/gif' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/gif' => [temp_big], 'image/jpg' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path #end def test_purge mms = MMS2R::Media.new stub_mail mms.purge assert_equal false, File.exist?(mms.media_dir) end def test_ignore_media_by_filename_equality name = 'foo.txt' type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [name]}}) # type is not in the ingore part = stub(:body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and filename are in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal true, mms.ignore_media?(type, part) # type but not file name are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_filename name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'foo.txt', mms.filename?(part) end def test_long_filename name = 'x' * 300 + '.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'x' * 251 + '.txt', mms.filename?(part) end def test_filename_when_file_extension_missing_part name = 'foo' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.txt', mms.filename?(part) name = 'foo.janky' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.janky.txt', mms.filename?(part) end def test_ignore_media_by_filename_regexp name = 'foo.txt' regexp = /foo\.txt/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [regexp, 'nil.txt']}}) # type is not in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the filename are in the ingore part = stub(:filename => name) assert_equal true, mms.ignore_media?(type, part) # type but not regexp for filename are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_by_regexp_on_file_content name = 'foo.txt' content = "aaaaaaahello worldbbbbbbbbb" regexp = /.*Hello World.*/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => ['nil.txt', regexp]}}) part = stub(:filename => name, :body => Mail::Body.new(content)) # type is not in the ingore assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the content are in the ingore assert_equal true, mms.ignore_media?(type, part) # type but not regexp for content are in the ignore part = stub(:filename => name, :body => Mail::Body.new('no teapots')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_when_file_content_is_empty mms = MMS2R::Media.new stub_mail # there is no conf but the part's body is empty part = stub(:filename => 'foo.txt', :body => Mail::Body.new) assert_equal true, mms.ignore_media?('text/test', part) # there is no conf but the part's body is white space part = stub(:filename => 'foo.txt', :body => Mail::Body.new("\t\n\t\n ")) assert_equal true, mms.ignore_media?('text/test', part) end def test_add_file mail = stub_mail mail.stubs(:from).returns(['[email protected]']) mms = MMS2R::Media.new(mail) mms.stubs(:media).returns({}) assert_nil mms.media['text/html'] mms.add_file('text/html', '/tmp/foo.html') assert_equal ['/tmp/foo.html'], mms.media['text/html'] mms.add_file('text/html', '/tmp/bar.html') assert_equal ['/tmp/foo.html', '/tmp/bar.html'], mms.media['text/html'] end def test_temp_file name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal name, File.basename(mms.temp_file(part)) end def test_process_media_for_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', 'hello world']) result = mms.process_media(part) assert_equal 'text/plain', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_with_empty_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', '']) assert_equal ['text/plain', nil], mms.process_media(part) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_application_smil name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['application/smil', nil]) part = stub(:filename => name, :content_type => 'application/smil', :part_type? => 'application/smil', :main_type => 'application') assert_equal ['application/smil', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['application/smil', 'hello world']) result = mms.process_media(part) assert_equal 'application/smil', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_application_octet_stream_when_image name = 'fake.jpg' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'application/octet-stream', :part_type? => 'application/octet-stream', :body => Mail::Body.new("data"), :main_type => 'application') result = mms.process_media(part) assert_equal 'image/jpeg', result.first assert_match(/fake\.jpg$/, result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_all_other_media name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :main_type => 'faux', :part_type? => 'faux/text', :body => Mail::Body.new(nil)) assert_equal ['faux/text', nil], mms.process_media(part) part = stub(:filename => name, :main_type => 'faux', :part_type? => 'faux/text', :body => Mail::Body.new('hello world')) result = mms.process_media(part) assert_equal 'faux/text', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process mms = MMS2R::Media.new stub_mail assert_equal 1, mms.media.size assert_not_nil mms.media['text/plain'] assert_equal 1, mms.media['text/plain'].size assert_equal true, File.exist?(mms.media['text/plain'].first) assert_equal 1, File.size(mms.media['text/plain'].first) mms.purge end def test_process_with_multipart_double_parts mail = mail('apple-double-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_not_nil mms.media['application/applefile'] assert_equal 1, mms.media['application/applefile'].size assert_not_nil mms.media['image/jpeg'] assert_equal 1, mms.media['image/jpeg'].size assert_match(/DSCN1715\.jpg$/, mms.media['image/jpeg'].first) assert_file_size mms.media['image/jpeg'].first, 337 mms.purge end def test_process_with_multipart_alternative_parts mail = stub_mail plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new('a'), :main_type => 'text') plain.stubs(:multipart?).at_least_once.returns(false) html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new('a'), :main_type => 'text') html.stubs(:multipart?).at_least_once.returns(false) multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) multi.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:parts).at_least_once.returns([multi]) # the multipart/alternative should get flattend to text and html mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_equal 2, mms.media.size assert_not_nil mms.media['text/plain'] assert_not_nil mms.media['text/html'] assert_equal 1, mms.media['text/plain'].size assert_equal 1, mms.media['text/html'].size assert_equal 'message.txt', File.basename(mms.media['text/plain'].first) assert_equal 'message.html', File.basename(mms.media['text/html'].first) assert_equal true, File.exist?(mms.media['text/plain'].first) assert_equal true, File.exist?(mms.media['text/html'].first) assert_equal 1, File.size(mms.media['text/plain'].first) assert_equal 1, File.size(mms.media['text/html'].first) mms.purge end def test_process_when_media_is_ignored mail = stub_mail plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new(''), :main_type => 'text') plain.stubs(:multipart?).at_least_once.returns(false) html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new(''), :main_type => 'text') html.stubs(:multipart?).at_least_once.returns(false) multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) multi.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:parts).at_least_once.returns([multi]) mms = MMS2R::Media.new(mail, :process => :lazy) mms.stubs(:config).returns({'ignore' => {'text/plain' => ['message.txt'], 'text/html' => ['message.html']}}) assert_nothing_raised { mms.process } # the multipart/alternative should get flattend to text and html and then # what's flattened is ignored assert_equal 0, mms.media.size mms.purge end def test_process_when_yielding_to_a_block mail = stub_mail plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new('a'), :main_type => 'text') plain.stubs(:multipart?).at_least_once.returns(false) html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new('b'), :main_type => 'text') html.stubs(:multipart?).at_least_once.returns(false) multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) multi.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:parts).at_least_once.returns([multi]) # the multipart/alternative should get flattend to text and html mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size
monde/mms2r
7a4d0fd419d739125ce4ab57f166aecb7746c712
Change user agent given to Sprint
diff --git a/History.txt b/History.txt index 5a946d1..76f7fba 100644 --- a/History.txt +++ b/History.txt @@ -1,413 +1,418 @@ +### 3.6.2 / 2012-02-12 (Mr. Gojira - Owner Mr. Gojira's Driving School - retake driver's exam) + +* 1 minor enhancement + * Change user agent given to Sprint so it returns a properly sized image. + ### 3.6.1 / 2012-02-11 (Mr. Gojira - Owner Mr. Gojira's Driving School) * 1 minor enhancement * use Net::HTTP#get2 to fetch Sprint content ### 3.6.0 / 2012-01-19 (Agent 216 - assassin, master of infiltration and sabotage) * 1 major enhancement * Ruby 1.8.7, 1.9.2, and 1.9.3 compatible * 1 bug fix * A fix for the utf-8 encoding issue with ruby 1.9.2 - minimul / Christian ### 3.5.1 / 2011-12-11 (Mashed Potato Johnson - oldest living blues guitarist in the world) * 1 bug fix * A fix for the utf-8 encoding issue with ruby 1.9.2 - James McGrath ### 3.5.0 / 2011-12-01 (Dr. Milminiman Lamilim Swimwambli - Marriage expert) * 1 major bug fix * In Ruby 1.9.X MMS2R::Media::Sprint was not fetching content from Sprint's CDN correctly because the implementation of Net::HTTP in 1.9.X passes a User-Agent header of "Ruby" to which Sprint responds with a fake 500 - with help from James McGrath ### 3.4.1 / 2011-11-06 (Fatty Ding-Dongs, Dethklok foster child) * 2 major enhancements * Additional means to detect android, iphone, motorola, nokia, palm handsets * Additional known SMS/MMS domains mm.att.net, labwig.net, cdma.sasktel.com ### 3.4.0 / 2011-10-31 (Serveta Skwigelf, Skwisgaar's hot mom) * 2 major enhancements * regexp's in yaml configs are store as a ruby regexp and not a string that is evaled. * character encoding capability with 1.8 rubies and 1.9 rubies. ### 3.3.1 / 2011-01-01 (Reverend Aslaug Wartooth (deceased), Toki's dad) * 2 minor enhancements * new method #default_html returns the default html attachment * #body will return the default plain text, or default stripped html text ### 3.3.0 / 2010-12-31 (Charles Foster Offdensen - CFO, dethklok) * 1 major enhancement * MMS2R::Media::Sprint is now a module that is extended in for processing Sprint content rather than being child class of MMS2R::Media Extension is the strategy to use for overwriting template methods now * 1 minor enhancement * process new Sprint subject - Jason Hooper * new SaskTel mms/sms domain alias sasktel.com * new Virgin Mobile mms/sms domain alias yrmobl.com ### 3.2.0 / 2010-08-17 (Antonio "Tony" DiMarco Thunderbottom - bassist) * 3 minor enhancements * updated readme with latest sites known to use mms2r * bundler assimilated * loading rubygems only if it's required, like rake ### 3.1.0 / 2010-07-09 (Dick "Magic Ears" Knubbler - music producer) * 8 minor enhancements * Detects additional Bell/AT&T domain sbcglobal.net as a handset * Detects additional Virgin mobile domains pixmbl.com vmobl.com as a handset * Expanded mobile phone detection for handset makers by : Casio, Google Nexus One, LG Electronics, Motorola, Pantech, Qualcom, Samsung, Sprint, UTStarCom * EXIF Reader (exifr) is integral to MMS2R and is now a required gem * upgrade Mail to 2.2.5 * depend on latest gems * corrected example - Jason Hooper * added As Seen On The Internet to README that lists sites known to be using MMS2R in some fashion ### 3.0.1 / 2010-03-28 (Lavona Succuboso - leader of "Succuboso Explosion") * 1 minor enhancement * support for U.S. Cellular ### 3.0.0 / 2010-02-24 (General Crozier - Chairman of the Joint Chiefs of Staff) * 1 new feature * dependence upon Mail gem rather than TMail gem ### 2.4.1 / 2010-02-07 (Vater Orlaag - political and spiritual specialist) * 3 minor enhancements * make sure filename is free of new lines - laurynas * recognize HTC HERO200 as a smart phone * recognize HTC Eris as a smart phone ### 2.4.0 / 2009-12-20 (Dr. Nanemiltred Philtendrieden - specialist on celebrity death) * 1 new feature * replace Hpricot with Nokogiri for html parsing of Sprint data * 3 minor enhancements * smartphone identities stored in conf/mms2r_media.yml * identify Motorola Droid as a smartphone * identify T-Mobile Dash as a smartphone * use uuidtools for naming temp directories - kbaum ### 2.3.0 / 2009-08-30 (Snakes 'n' Barrels Greatest Hits) * 5 new features * detect smartphone status/type based on model metadata from jpeg and tiff exif data using exifr gem, access exif data with MMS2R::Media#exif * make MMS2R Rails gem packaging friendly with an init.rb - Scott Taylor, smtlaissezfaire * delegate missing methods to mms2r's tmail object so that mms2r behaves as if it were a tmail object - Sai Emrys, saizai * default_media can return an attachment of application content type - Brendan Lim, brendanlim * MMS2R.parse(raw_mail) convenience class method that parses and returns an mms2r from a mail file - saizai * 4 minor enhancements * make examples more 'mail' specific to enforce the fact that an mms is a multipart email - saizai * update for text in vzwpix.com default carrier message * detecting smartphone (blackberries and iphones for now) is more versatile from reading mail headers * expanded filtering of carrier advertising text in mms from smartphones ### 2.2.0 / 2009-01-04 (Rikki Kixx - owner of a franchise of rehab centers) * 3 new features * MMS2R::Media#is_mobile? best guess if the sender was a mobile device * MMS2R::Media#device_type? best guess of the mobile device type. Simple heuristics thus far for :blackberry :iphone :handset :unknown could be expanded for exif probing or additinal shifting of mail header * from array in conf/from.yml to provide granularity to determine carrier domain (caused by tmo.blackberry.net) * 4 minor enhancements * support for Virgin Canada messaging service vmobile.ca * support for text service messaging.sprintpcs.com * additional BlackBerry coverage from T-Mobile tmo.blackberry.net provider * legacy support for mobile.mycingular.com, pics.cingularme.com * 3 bug fixes * iPhone default subject - jesse dp http://rubyforge.org/tracker/?func=detail&atid=11789&aid=22951&group_id=3065 * add sprintpcs.com to pm.sprint.com aliases * fix OS X long filename issues - Matt Conway ### 2.1.3 / 2008-11-06 (Dr. Ramonolith Chesterfield - Military pharmaceutical psychotropic drug manufacturing expert * 1 minor enhancement * added mms.ae support ### 2.1.2 / 2008-10-21 (Toki's mom, Anja Wartooth) * 2 minor enhancments * Sprint subject update - jesse dp * Virgin Mobile support vmpix.com ### 2.1.1 / 2008-09-24 (Lavona Succuboso, Nathan Explosion uber-groupie) * 4 minor enhancments * Bell Canada support txt.bell.ca - Matt Conway / Snap My Life - http://github.com/wr0ngway, http://github.com/sml * Unicel support unicel.com - Michael DelGaudio * info2go.com support / Unicel * TELUS Corporation support mms.telusmobility.com, msg.telus.com * add test to check that gem builds correctly as a github gem * 1 bug fix * Iconv utf8 fix - Kai Kai ### 2.1.0 / 2008-07-30 (Dr. Gibbons – Birthday expert and Murderface expert) * 1 major enhancement: * opens up TMail for improved query method patterned code in MMS2R * 2 minor enhancements: * UK O2 support mediamessaging.o2.co.uk - Jeremy Wilkins * Write non text files with binary bit set on Windows - David Alm * source hosted on github: git clone git://github.com/monde/mms2r.git ### 2.0.5 / 2008-07-17 (Dr. Ralphus Galkensmelter - Psychological death expert) * Deal with Apple Mail multipart/appledouble - jesse dp ### 2.0.4 / 2008-04-28 (Mr. Selatcia - elder member of The Tribunal) * updated mms.vodacom4me.co.za Vodacom South Africa - Vijay Yellapragada * 1nbox.net / Idea cellular 1nbox.net - Vijay Yellapragada * mms.3ireland.ie / 3 Ireland - Vijay Yellapragada * mms.alltel.com / Alltel (reverted message.alltel.com) - Vijay Yellapragada * mms.mobileiam.ma / Maroc Telecom - Vijay Yellapragada * mms.mtn.co.za / MTM South Africa - Vijay Yellapragada * rci.rogers.com / Rogers of Canada - Vijay Yellapragada * mmsreply.t-mobile.co.uk / T-Mobile UK - Vijay Yellapragada * waw.plspictures.com / PLSPICTURES.COM mms hosting service ### 2.0.3 / 2008-04-15 (Enter Taxman - The 1040 MMS Form) * fix case when part is image/jpeg declared 'application/octet-stream' * trim dangling image/jpeg text from blackberry messages * file extensions added to filenames that are missing extensions in part headers * anonymize images in fixtures to reduce gem size * T-Mobile update - jesse dp * AT&T/T-Mobile Blackberrry update - Dave Myron ### 2.0.2 / 2008-02-22 (The Jomfru Brothers - proprietors of diefordethklok.com) * added support for mms.vodacom4me.co.za Vodacom South Africa - Jason Haruska * added support for bellsouth.net - Jason Haruska * added support for mms.mycricket.com * Improved Blackberry and iPhone suport - Jason Haruska * added :number key to configuration to provide rules for specifying alternative phone number location * return sender's phone number for mobile.indosat.net.id * return sender's phone number for mms.luxgsm.lu * return sender's phone number for mms.vodacom4me.co.za ### 2.0.1 / 2008-02-08 (Professor Jerry Gustav Munndig - Child control expert) * strip out common blackberry and iPhone signatures * handle carriers that use external mail services such as Yahoo! as the From address * Add support for mobile.indosat.net.id (and yahoo.co.id) - Jason Haruska * Add support for sms.sasktel.com - Jason Haruska ### 2.0.0 / 2008-01-23 (Skwisgaar Skwigelf - fastest guitarist alive) * added support for pxt.vodafone.net.nz PXT New Zealand * added support for mms.o2online.de O2 Germany * added support for orangemms.net Orange UK * added support for txt.att.net AT&T * added support for mms.luxgsm.lu LUXGSM S.A. * added support for mms.netcom.no NetCom (Norway) * added support for mms.three.co.uk Hutchison 3G UK Ltd * removed deprecated #get_number use #number * removed deprecated #get_subject use #subject * removed deprecated #get_body use #body * removed deprecated #get_media use #default_media * removed deprecated #get_text use #default_text * removed deprecated #get_attachment use #attachment * fixed error when Sprint content server responds 500 * better yaml configs * moved TMail dependency from Rails ActionMailer SVN to 'official' Gem * ::new greedily processes MMS unless otherwise specified as an initialize option :process => :lazy * logger moved to initialize option :logger => some_logger * testing using mocks and stubs instead of duck raped Net::HTTP * fixed typo in name of method #attachement to #attachment * fixed broken downloading of Sprint videos ### 1.1.12 / 2007-10-21 (Dr. Ronald von Moldenberg - Endorsement specialist) * fetch original images from Sprint content server (Layton Wedgeworth) * ignore Sprint messages when requested content has been purged from their content server ### 1.1.11 / 2007-10-20 (Dr. Armand Skagerakk Frederickshaven - Mythology expert) * minor fix for attachment_fu where it might call #path on the cgi temp file that is returned by get_attachment * renamed a_t_t_media.rb to att_media.rb to make it autotest happy * masthead.jpg misplaced in mms2r_t_mobile_media_ignore.yml (Layton Wedgeworth) * overridden SprintMedia#process failed to accept block (Layton Wedgeworth) * added method_deprecated to help mark methods that are going to be deprecated in preparation of 1.2.x release * #get_number marked deprecated, use #number instead * #get_subject marked deprecated, use #subject instead * #get_body marked deprecated, use #body instead * #get_text marked deprecated, use #default_text instead * #get_attachment marked deprecated, use #attachment instead * #get_media marked deprecated, use #default_media instead ### 1.1.10 / 2007-09-30 (Face Bones) * fixed a case for a nil match on From in the create method (Luke Francl) * added support for Alltel message.alltel.com (Ben Wood) ### 1.1.9 / 2007-09-08 (Rebecca Nightrod - controlling girlfriend of Nathan Explosion) * fixed broken support for act_as_attachment and attachment_fu ### 1.1.8 / 2007-09-08 (James Grishnack - Head of Behemoth Productions, producer of Blood Ocean) * Added support for Orange of France, Orange orange.fr (Julian Biard) * purge in the process block removed, purge must be called explicitly after processing to clean up extracted temporary media files. ### 1.1.7 / 2007-08-25 (Adam Nergal, friend of Skwisgaar, but not Pickles) * Added support for Orange of Poland, Orange mmsemail.orange.pl (Zbigniew Sobiecki) * Cleaned up documentation modifiers * Cleaned out non-Ruby code idioms ### 1.1.6 / 2007-08-11 (Mustakrakish, the Lake Troll part 2) * Redo of release mistake of 1.1.5 ### 1.1.5 / 2007-08-11 (Mustakrakish, the Lake Troll) * AT&T => mms.att.net not clearing out default "multimedia message" subject to nil (Will Jessup) * Ignore case on default subject for all carriers in corresponding conf/mms2r_XXX_media_subject.yml ### 1.1.4 / 2007-08-07 (Dr. Rockso) * AT&T => mms.att.net support (thanks Mike Chen and Dave Myron) * get_body returns nil when there is not user text (sorry Will!) ### 1.1.3 / 2007-07-10 (Charles Foster Ofdensen) * Helio support by Will Jessup * get_subject returns nil on default carrier subjects ### 1.1.2 / 2007-06-13 (Dethklok roadie #2) * placed versioned hpricot dependency in Hoe's extra_deps (an attempt to appease firebrigade gods or not cause Gem::RemoteInstallationCancelled whichever you prefer) ### 1.1.1 / 2007-06-11 (Dethklok roadie) * rescue rcov non-dependency in Rakefile to make firebrigade happy ### 1.1.0 / 2007-06-08 (Toki Wartooth) * get_body to return body text (Luke Francl) * get_subject returns "" for default subjects now * default subjects listed in yaml by carrier in conf directory * added granularity to Cingular, Sprint, and Verizon carrier services (Will Jessup) * refactored Sprint instance to process all media (Will Jessup + Mike) * optimized text transformations (Will Jessup) * properly handle ISO-8859-1 and UTF-8 text (Will Jessup) * autotest powers activate! (ZenTest autotest discovery enabled) * configuration file ignores, transforms, and subjects all store Regexp's * Put vendor Text::Format & TMail::Mail as an external subversion dependency to the 1.2 stable branch of Rails ActionMailer * added get_number method to return the phone number associated with this MMS * get_media and get_text attachment_fu helper return the largest piece of media of that type if the more than one exits in the media (Luke Francl) * added block support to process() method (Shane Vitarana) ### 1.0.7 / 2007-04-27 (Senator Stampingston) * patch submitted by Luke Francl * added a get_subject method that returns nil when any MMS has a default carrier subject * get_subject returns nil for '', 'Multimedia message', '(no subject)', 'You have new Picture Mail!' ### 1.0.6 / 2007-04-24 (Pickles the Drummer) * patch submitted by Luke Francl * added support for mms.dobson.net (Dobson aka Cellular One) (Luke) * DRY'd up unit tests (Luke) * added get_media instance method that returns first video or image as File (Luke) * File from get_media can be used by/with attachment_fu (Luke) * added get_text instance method that returns first non advertising text * File from get_text can be used by/with attachment_fu ### 1.0.5 / 2007-04-10 (William Murderface) * patch submitted by Luke Francl * made ignore_media? start its text check from the start of the file (Luke) * added new text transform for Verizon messages (Luke) * updated Nextel ignore conf (Luke) * added additional samples and tests for T-Mobile & Verizon (Luke) * cleaned up MMS2R::Media documentation * added Sprint broken image test for when media goes stale on their content server * fixed teardown typo in lots of plases * added tests for 4 three samples of unique variants of Sprint/Nextel text * 100% test coverage! ### 1.0.4 / 2007-04-09 (Metalocalypse) * fix teardown in test_mms2r_sprint.rb (shanesbrain.net) * clean up Net::HTTP in MMS2R::SprintMedia (shanesbrain.net) * added accessor MMS2R::Media.media_dir * fixed a nil issue with underlying tmp working dir * added exception handling around Net::HTTP in MMS2R::SprintMedia ### 1.0.3 / 2007-04-05 (Paper Cut) * Cleaned up packaging and errors in example found by Shane V. http://shanesbrain.net/ ### 1.0.2 / 2007-03-07 * Reorganized tests and fixtures * Added carriers: * Cingular => cingularme.com * Nextel => messaging.nextel.com * Verizon => vtext.com ### 1.0.1 / 2007-03-07 * Flubbed RubyForge release ... do not use this. ### 1.0.0 / 2007-03-06 * Birthday! * AT&T/Cingular => mmode.com * Cingular => mms.mycingular.com * Sprint => pm.sprint.com * Sprint => messaging.sprintpcs.com * T-Mobile => tmomail.net * Verizon => vzwpix.com diff --git a/lib/mms2r.rb b/lib/mms2r.rb index 33682fc..8075184 100644 --- a/lib/mms2r.rb +++ b/lib/mms2r.rb @@ -1,83 +1,83 @@ #-- # Copyright (c) 2007-2010 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ module MMS2R ## # A hash of MMS2R processors keyed by MMS carrier domain. CARRIERS = {} ## # Registers a class as a processor for a MMS domain. Should only be # used in special cases such as MMS2R::Media::Sprint for 'pm.sprint.com' def self.register(domain, processor_class) MMS2R::CARRIERS[domain] = processor_class end ## # A hash of file extensions for common mime-types EXT = { 'text/plain' => 'text', 'text/plain' => 'txt', 'text/html' => 'html', 'image/png' => 'png', 'image/gif' => 'gif', 'image/jpeg' => 'jpeg', 'image/jpeg' => 'jpg', 'video/quicktime' => 'mov', 'video/3gpp2' => '3g2' } class MMS2R::Media ## # MMS2R library version - VERSION = '3.6.1' + VERSION = '3.6.2' ## # Spoof User-Agent, primarily for the Sprint CDN - USER_AGENT = "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C28 Safari/419.3" + USER_AGENT = "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.120 Safari/535.2" end # Simple convenience function to make it a one-liner: # MMS2R.parse raw_mail or MMS2R.parse File.load(raw_mail) # Combined w/ the method_missing delegation, this should behave as an enhanced Mail object, more or less. def self.parse raw_mail, options = {} mail = Mail.new raw_mail MMS2R::Media.new(mail, options) end end %W{ yaml mail fileutils pathname tmpdir yaml digest/sha1 iconv exifr }.each do |g| begin require g rescue LoadError require 'rubygems' require g end end if RUBY_VERSION >= "1.9" begin require 'psych' YAML::ENGINE.yamler= 'syck' if defined?(YAML::ENGINE) rescue LoadError end end require File.join(File.dirname(__FILE__), 'ext/mail') require File.join(File.dirname(__FILE__), 'ext/object') require File.join(File.dirname(__FILE__), 'mms2r/media') require File.join(File.dirname(__FILE__), 'mms2r/media/sprint') MMS2R.register('pm.sprint.com', MMS2R::Media::Sprint) diff --git a/mms2r.gemspec b/mms2r.gemspec index a0a9c6e..fe175b7 100644 --- a/mms2r.gemspec +++ b/mms2r.gemspec @@ -1,45 +1,45 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = "mms2r" - s.version = "3.6.1" + s.version = "3.6.2" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Mike Mondragon"] s.date = "2011-10-31" s.description = "== DESCRIPTION\n\nMMS2R by Mike Mondragon\nhttp://mms2r.rubyforge.org/\nhttps://github.com/monde/mms2r\nhttps://github.com/monde/mms2r/issues\nhttp://peepcode.com/products/mms2r-pdf\n\nMMS2R is a library that decodes the parts of an MMS message to disk while\nstripping out advertising injected by the mobile carriers. MMS messages are\nmultipart email and the carriers often inject branding into these messages. Use\nMMS2R if you want to get at the real user generated content from a MMS without\nhaving to deal with the cruft from the carriers.\n\nIf MMS2R is not aware of a particular carrier no extra processing is done to the\nMMS other than decoding and consolidating its media." s.email = ["[email protected]"] s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.TMail.txt", "README.txt"] s.files = ["Gemfile", "Gemfile.lock", "History.txt", "Manifest.txt", "README.TMail.txt", "README.txt", "Rakefile", "conf/1nbox.net.yml", "conf/aliases.yml", "conf/bellsouth.net.yml", "conf/from.yml", "conf/mediamessaging.o2.co.uk.yml", "conf/messaging.nextel.com.yml", "conf/mms.3ireland.ie.yml", "conf/mms.ae.yml", "conf/mms.alltel.com.yml", "conf/mms.att.net.yml", "conf/mms.dobson.net.yml", "conf/mms.luxgsm.lu.yml", "conf/mms.mobileiam.ma.yml", "conf/mms.mtn.co.za.yml", "conf/mms.mycricket.com.yml", "conf/mms.myhelio.com.yml", "conf/mms.netcom.no.yml", "conf/mms.o2online.de.yml", "conf/mms.three.co.uk.yml", "conf/mms.uscc.net.mail", "conf/mms.vodacom4me.co.za.yml", "conf/mms2r_media.yml", "conf/mobile.indosat.net.id.yml", "conf/msg.telus.com.yml", "conf/orangemms.net.yml", "conf/pm.sprint.com.yml", "conf/pxt.vodafone.net.nz.yml", "conf/rci.rogers.com.yml", "conf/sms.sasktel.com.yml", "conf/tmomail.net.yml", "conf/txt.bell.ca.yml", "conf/unicel.com.yml", "conf/vmpix.com.yml", "conf/vzwpix.com.yml", "conf/waw.plspictures.com.yml", "dev_tools/anonymizer.rb", "dev_tools/debug_sprint_nokogiri_parsing.rb", "init.rb", "lib/ext/mail.rb", "lib/ext/object.rb", "lib/mms2r.rb", "lib/mms2r/media.rb", "lib/mms2r/media/sprint.rb", "mms2r.gemspec", "test/fixtures/1nbox-2images-01.mail", "test/fixtures/1nbox-2images-02.mail", "test/fixtures/1nbox-2images-03.mail", "test/fixtures/1nbox-2images-04.mail", "test/fixtures/3ireland-mms-01.mail", "test/fixtures/ad_new.txt", "test/fixtures/alltel-image-01.mail", "test/fixtures/alltel-mms-01.mail", "test/fixtures/alltel-mms-03.mail", "test/fixtures/apple-double-image-01.mail", "test/fixtures/att-blackberry-02.mail", "test/fixtures/att-blackberry.mail", "test/fixtures/att-image-01.mail", "test/fixtures/att-image-02.mail", "test/fixtures/att-iphone-01.mail", "test/fixtures/att-iphone-02.mail", "test/fixtures/att-iphone-03.mail", "test/fixtures/att-text-01.mail", "test/fixtures/bell-canada-image-01.mail", "test/fixtures/cingularme-text-01.mail", "test/fixtures/cingularme-text-02.mail", "test/fixtures/dici_un_mois_georgie.txt", "test/fixtures/dobson-image-01.mail", "test/fixtures/dot.jpg", "test/fixtures/generic.mail", "test/fixtures/handsets.yml", "test/fixtures/helio-image-01.mail", "test/fixtures/helio-message-01.mail", "test/fixtures/iconv-fr-text-01.mail", "test/fixtures/indosat-image-01.mail", "test/fixtures/indosat-image-02.mail", "test/fixtures/info2go-image-01.mail", "test/fixtures/iphone-image-01.mail", "test/fixtures/luxgsm-image-01.mail", "test/fixtures/maroctelecom-france-mms-01.mail", "test/fixtures/mediamessaging_o2_co_uk-image-01.mail", "test/fixtures/mmode-image-01.mail", "test/fixtures/mms.ae-image-01.mail", "test/fixtures/mms.mycricket.com-pic-and-text.mail", "test/fixtures/mms.mycricket.com-pic.mail", "test/fixtures/mmsreply.t-mobile.co.uk-text-image-01.mail", "test/fixtures/mobile.mycingular.com-text-01.mail", "test/fixtures/mtn-southafrica-mms.mail", "test/fixtures/mycingular-image-01.mail", "test/fixtures/netcom-image-01.mail", "test/fixtures/nextel-image-01.mail", "test/fixtures/nextel-image-02.mail", "test/fixtures/nextel-image-03.mail", "test/fixtures/nextel-image-04.mail", "test/fixtures/o2-de-image-01.mail", "test/fixtures/orange-uk-image-01.mail", "test/fixtures/orangefrance-text-and-image.mail", "test/fixtures/orangepoland-text-01.mail", "test/fixtures/orangepoland-text-02.mail", "test/fixtures/pics.cingularme.com-image-01.mail", "test/fixtures/pxt-image-01.mail", "test/fixtures/rogers-canada-mms-01.mail", "test/fixtures/sasktel-image-01.mail", "test/fixtures/sprint-broken-image-01.mail", "test/fixtures/sprint-image-01.mail", "test/fixtures/sprint-new-image-01.mail", "test/fixtures/sprint-pcs-text-01.mail", "test/fixtures/sprint-purged-image-01.mail", "test/fixtures/sprint-text-01.mail", "test/fixtures/sprint-two-images-01.mail", "test/fixtures/sprint-video-01.mail", "test/fixtures/sprint.mov", "test/fixtures/suncom-blackberry.mail", "test/fixtures/telus-image-01.mail", "test/fixtures/three-uk-image-01.mail", "test/fixtures/tmo.blackberry.net-image-01.mail", "test/fixtures/tmobile-blackberry-02.mail", "test/fixtures/tmobile-blackberry.mail", "test/fixtures/tmobile-image-01.mail", "test/fixtures/tmobile-image-02.mail", "test/fixtures/unicel-image-01.mail", "test/fixtures/us-cellular-image-01.mail", "test/fixtures/verizon-blackberry.mail", "test/fixtures/verizon-image-01.mail", "test/fixtures/verizon-image-02.mail", "test/fixtures/verizon-image-03.mail", "test/fixtures/verizon-text-01.mail", "test/fixtures/verizon-video-01.mail", "test/fixtures/virgin-mobile-image-01.mail", "test/fixtures/virgin.ca-text-01.mail", "test/fixtures/vodacom4me-co-za-01.mail", "test/fixtures/vodacom4me-co-za-02.mail", "test/fixtures/vodacom4me-southafrica-mms-01.mail", "test/fixtures/vodacom4me-southafrica-mms-04.mail", "test/fixtures/vtext-text-01.mail", "test/fixtures/vzwpix.com-image-01.mail", "test/fixtures/waw.plspictures.com-image-01.mail", "test/hax.rb", "test/test_1nbox_net.rb", "test/test_bell_canada.rb", "test/test_bellsouth_net.rb", "test/test_helper.rb", "test/test_mediamessaging_o2_co_uk.rb", "test/test_messaging_nextel_com.rb", "test/test_messaging_sprintpcs_com.rb", "test/test_mms2r_media.rb", "test/test_mms_3ireland_ie.rb", "test/test_mms_ae.rb", "test/test_mms_alltel_com.rb", "test/test_mms_att_net.rb", "test/test_mms_dobson_net.rb", "test/test_mms_luxgsm_lu.rb", "test/test_mms_mobileiam_ma.rb", "test/test_mms_mtn_co_za.rb", "test/test_mms_mycricket_com.rb", "test/test_mms_myhelio_com.rb", "test/test_mms_netcom_no.rb", "test/test_mms_o2online_de.rb", "test/test_mms_three_co_uk.rb", "test/test_mms_uscc_net.rb", "test/test_mms_vodacom4me_co_za.rb", "test/test_mobile_indosat_net_id.rb", "test/test_msg_telus_com.rb", "test/test_orangemms_net.rb", "test/test_pm_sprint_com.rb", "test/test_pxt_vodafone_net_nz.rb", "test/test_rci_rogers_com.rb", "test/test_sms_sasktel_com.rb", "test/test_tmomail_net.rb", "test/test_unicel_com.rb", "test/test_vmpix_com.rb", "test/test_vzwpix_com.rb", "test/test_waw_plspictures_com.rb", "vendor/plugins/mms2r/lib/autotest/discover.rb", "vendor/plugins/mms2r/lib/autotest/mms2r.rb", ".gemtest"] s.homepage = "https://github.com/monde/mms2r" s.rdoc_options = ["--main", "README.txt"] s.require_paths = ["lib"] s.rubyforge_project = "mms2r" s.rubygems_version = "1.8.10" s.summary = "Extract user media from MMS (and not carrier cruft)" s.test_files = ["test/test_orangemms_net.rb", "test/test_waw_plspictures_com.rb", "test/test_mediamessaging_o2_co_uk.rb", "test/test_vzwpix_com.rb", "test/test_unicel_com.rb", "test/test_messaging_sprintpcs_com.rb", "test/test_mms_luxgsm_lu.rb", "test/test_rci_rogers_com.rb", "test/test_mms_uscc_net.rb", "test/test_mms_netcom_no.rb", "test/test_1nbox_net.rb", "test/test_sms_sasktel_com.rb", "test/test_mms_att_net.rb", "test/test_mobile_indosat_net_id.rb", "test/test_messaging_nextel_com.rb", "test/test_mms_mtn_co_za.rb", "test/test_mms_vodacom4me_co_za.rb", "test/test_pxt_vodafone_net_nz.rb", "test/test_mms_dobson_net.rb", "test/test_helper.rb", "test/test_msg_telus_com.rb", "test/test_mms_o2online_de.rb", "test/test_mms2r_media.rb", "test/test_bell_canada.rb", "test/test_tmomail_net.rb", "test/test_mms_3ireland_ie.rb", "test/test_pm_sprint_com.rb", "test/test_mms_alltel_com.rb", "test/test_mms_mobileiam_ma.rb", "test/test_mms_mycricket_com.rb", "test/test_bellsouth_net.rb", "test/test_mms_three_co_uk.rb", "test/test_vmpix_com.rb", "test/test_mms_myhelio_com.rb", "test/test_mms_ae.rb"] if s.respond_to? :specification_version then s.specification_version = 3 if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then s.add_runtime_dependency(%q<nokogiri>, [">= 1.4.4"]) s.add_runtime_dependency(%q<mail>, [">= 2.2.10"]) s.add_runtime_dependency(%q<uuidtools>, [">= 2.1.1"]) s.add_runtime_dependency(%q<exifr>, [">= 1.0.3"]) s.add_development_dependency(%q<hoe>, ["~> 2.12"]) else s.add_dependency(%q<nokogiri>, [">= 1.4.4"]) s.add_dependency(%q<mail>, [">= 2.2.10"]) s.add_dependency(%q<uuidtools>, [">= 2.1.1"]) s.add_dependency(%q<exifr>, [">= 1.0.3"]) s.add_dependency(%q<hoe>, ["~> 2.12"]) end else s.add_dependency(%q<nokogiri>, [">= 1.4.4"]) s.add_dependency(%q<mail>, [">= 2.2.10"]) s.add_dependency(%q<uuidtools>, [">= 2.1.1"]) s.add_dependency(%q<exifr>, [">= 1.0.3"]) s.add_dependency(%q<hoe>, ["~> 2.12"]) end end diff --git a/test/test_mms2r_media.rb b/test/test_mms2r_media.rb index 3f63b54..3bca5a0 100644 --- a/test/test_mms2r_media.rb +++ b/test/test_mms2r_media.rb @@ -1,561 +1,561 @@ # encoding: UTF-8 require "test_helper" class TestMms2rMedia < Test::Unit::TestCase include MMS2R::TestHelper def use_temp_dirs MMS2R::Media.tmp_dir = @tmpdir MMS2R::Media.conf_dir = @confdir end def setup @oldtmpdir = MMS2R::Media.tmp_dir || File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") @oldconfdir = MMS2R::Media.conf_dir || File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") FileUtils.mkdir_p(@oldtmpdir) FileUtils.mkdir_p(@oldconfdir) @tmpdir = File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") FileUtils.mkdir_p(@tmpdir) @confdir = File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") FileUtils.mkdir_p(@confdir) end def teardown FileUtils.rm_rf(@tmpdir) FileUtils.rm_rf(@confdir) MMS2R::Media.tmp_dir = @oldtmpdir MMS2R::Media.conf_dir = @oldconfdir end def stub_mail(vals = {}) attrs = { :from => '[email protected]', :to => '[email protected]', :subject => 'This is a test email', :body => 'a', }.merge(vals) Mail.new do from attrs[:from] to attrs[:to] subject attrs[:subject] body attrs[:body] end end def test_faux_user_agent - assert_equal "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C28 Safari/419.3", MMS2R::Media::USER_AGENT + assert_equal "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.120 Safari/535.2", MMS2R::Media::USER_AGENT end def test_class_parse mms = mail('generic.mail') assert_equal ['[email protected]'], mms.from end def temp_text_file(text) tf = Tempfile.new("test" + rand.to_s) tf.puts(text) tf.close tf.path end def test_tmp_dir use_temp_dirs() MMS2R::Media.tmp_dir = @tmpdir assert_equal @tmpdir, MMS2R::Media.tmp_dir end def test_conf_dir use_temp_dirs() MMS2R::Media.conf_dir = @confdir assert_equal @confdir, MMS2R::Media.conf_dir end def test_safe_message_id mid1_b="1234abcd" mid1_a="1234abcd" mid2_b="<01234567.0123456789012.JavaMail.fooba@foo-bars999>" mid2_a="012345670123456789012JavaMailfoobafoo-bars999" assert_equal mid1_a, MMS2R::Media.safe_message_id(mid1_b) assert_equal mid2_a, MMS2R::Media.safe_message_id(mid2_b) end def test_default_ext assert_equal nil, MMS2R::Media.default_ext(nil) assert_equal 'text', MMS2R::Media.default_ext('text') assert_equal 'txt', MMS2R::Media.default_ext('text/plain') assert_equal 'test', MMS2R::Media.default_ext('example/test') end def test_base_initialize_config_tries_to_open_default_config_yaml f = File.join(MMS2R::Media.conf_dir, 'mms2r_media.yml') YAML.expects(:load_file).once.with(f).returns({}) config = MMS2R::Media.initialize_config(nil) end def test_base_initialize_config config = MMS2R::Media.initialize_config(nil) # test defaults shipped in mms2r_media.yml assert_not_nil config assert_equal true, config['ignore'].is_a?(Hash) assert_equal true, config['transform'].is_a?(Hash) assert_equal true, config['number'].is_a?(Array) end def test_instance_initialize_config mms = MMS2R::Media.new stub_mail config = mms.initialize_config(nil) # test defaults shipped in mms2r_media.yml assert_not_nil config assert_equal true, config['ignore'].is_a?(Hash) assert_equal true, config['transform'].is_a?(Hash) assert_equal true, config['number'].is_a?(Array) end def test_initialize_config_contatenation c = {'ignore' => {'text/plain' => [/A TEST/]}, 'transform' => {'text/plain' => [/FOO/, '']}, 'number' => ['from', /^([^\s]+)\s.*/, '\1'] } config = MMS2R::Media.initialize_config(c) assert_not_nil config['ignore']['text/plain'].detect{|v| v == /A TEST/} assert_not_nil config['transform']['text/plain'].detect{|v| v == /FOO/} assert_not_nil config['number'].first == 'from' end def test_aliased_new_returns_default_processor_instance mms = MMS2R::Media.new stub_mail assert_not_nil mms assert_equal true, mms.respond_to?(:process) assert_equal MMS2R::Media, mms.class end def test_lazy_process_option mms = MMS2R::Media.new stub_mail, :process => :lazy mms.expects(:process).never end def test_logger_option logger = mock() logger.expects(:info).at_least_once mms = MMS2R::Media.new stub_mail, :logger => logger end def test_default_processor_initialize_tries_to_open_config_for_carrier mms_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'mms2r_media.yml')) aliases_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'aliases.yml')) from_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'from.yml')) example_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'example.com.yml')) YAML.expects(:load_file).at_least_once.with(mms_yaml).returns({}) YAML.expects(:load_file).at_least_once.with(aliases_yaml).returns({}) YAML.expects(:load_file).at_least_once.with(from_yaml).returns([]) YAML.expects(:load_file).never.with(example_yaml) mms = MMS2R::Media.new stub_mail end def test_mms_phone_number mail = stub_mail mail.stubs(:from).returns(['[email protected]']) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number end def test_mms_phone_number_from_config mail = stub_mail(:from => '"+2068675309" <[email protected]>') mms = MMS2R::Media.new(mail) mms.expects(:config).once.returns({'number' => ['from', /^([^\s]+)\s.*/, '\1']}) assert_equal '+2068675309', mms.number end def test_mms_phone_number_with_errors mail = stub_mail mail.stubs(:from).returns(nil) mms = MMS2R::Media.new(mail) assert_nothing_raised do assert_equal '', mms.number end end def test_transform_text_plain mail = stub_mail mail.stubs(:from).returns(nil) mms = MMS2R::Media.new(mail) type = 'test/type' text = 'hello' # no match in the config result = [type, text] assert_equal result, mms.transform_text(type, text) # testing the default config assert_equal ['text/plain', ''], mms.transform_text('text/plain', "Sent via BlackBerry from T-Mobile") assert_equal ['text/plain', ''], mms.transform_text('text/plain', "Sent from my Verizon Wireless BlackBerry") assert_equal ['text/plain', ''], mms.transform_text('text/plain', 'Sent from my iPhone') assert_equal ['text/plain', ''], mms.transform_text('text/plain', 'Sent from your iPhone.') assert_equal ['text/plain', ''], mms.transform_text('text/plain', " \n\nimage/jpeg") # has a bad regexp mms.expects(:config).at_least_once.returns({'transform' => {type => [['(hello)', 'world']]}}) assert_equal result, mms.transform_text(type, text) # matches in config mms.expects(:config).at_least_once.returns({'transform' => {type => [[/(hello)/, 'world']]}}) assert_equal [type, 'world'], mms.transform_text(type, text) mms.expects(:config).at_least_once.returns({'transform' => {type => [[/^Ignore this part, (.+)/, '\1']]}}) assert_equal [type, text], mms.transform_text(type, "Ignore this part, " + text) # chaining transforms mms.expects(:config).at_least_once.returns({'transform' => {type => [[/(hello)/, 'world'], [/(world)/, 'mars']]}}) assert_equal [type, 'mars'], mms.transform_text(type, text) # has a Iconv problem mms.expects(:config).at_least_once.returns({'transform' => {type => [['(hello)', 'world']]}}) assert_equal result, mms.transform_text(type, text) end def test_transform_text_to_utf8 mail = mail('iconv-fr-text-01.mail') mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_equal 1, mms.media['text/plain'].size assert_equal 1, mms.media['text/html'].size file = mms.media['text/plain'][0] assert_not_nil file assert_equal true, File::exist?(file) text_lines = IO.readlines("#{file}") text = text_lines.join # ASCII-8BIT -> D'ici un mois G\xE9orgie # UTF-8 -> D'ici un mois Géorgie if RUBY_VERSION < "1.9" assert_equal("sample email message Fwd: sub D'ici un mois Géorgie", mms.subject) assert_equal("D'ici un mois Géorgie body", text_lines.first.strip) else assert_equal(Iconv.new('UTF-8', 'ISO-8859-1').iconv("sample email message Fwd: sub D'ici un mois Géorgie"), mms.subject) assert_equal(Iconv.new('UTF-8', 'ISO-8859-1').iconv("D'ici un mois G\xE9orgie body"), text_lines.first.strip) end end def test_subject s = 'hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) assert_equal s, mms.subject # second time through shouldn't process the subject again mail.expects(:subject).never assert_equal s, mms.subject end def test_subject_with_bad_mail_subject mail = stub_mail mail.stubs(:subject).returns(nil) mms = MMS2R::Media.new(mail) assert_equal '', mms.subject end def test_subject_with_subject_ignored s = 'hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) mms.stubs(:config).returns({'ignore' => {'text/plain' => [s]}}) assert_equal '', mms.subject end def test_subject_with_subject_transformed s = 'Default Subject: hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) mms.stubs(:config).returns( { 'ignore' => {}, 'transform' => {'text/plain' => [[/Default Subject: (.+)/, '\1']]}}) assert_equal 'hello world', mms.subject end def test_attachment_should_return_nil_if_files_for_type_are_not_found mms = MMS2R::Media.new stub_mail mms.stubs(:media).returns({}) assert_nil mms.send(:attachment, ['text']) end def test_attachment_should_return_nil_if_empty_files_are_found mms = MMS2R::Media.new stub_mail mms.stubs(:media).returns({'text/plain' => [Tempfile.new('test')]}) assert_nil mms.send(:attachment, ['text']) end def test_type_from_filename mms = MMS2R::Media.new stub_mail assert_equal 'image/jpeg', mms.send(:type_from_filename, "example.jpg") end def test_type_from_filename_should_be_nil mms = MMS2R::Media.new stub_mail assert_nil mms.send(:type_from_filename, "example.example") end def test_attachment_should_return_duck_typed_file mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") size = File.size(temp_text_file("hello world")) temp_small = temp_text_file("hello") mms.stubs(:media).returns({'text/plain' => [temp_small, temp_big]}) duck_file = mms.send(:attachment, ['text']) assert_not_nil duck_file assert_equal true, File::exist?(duck_file) assert_equal true, File::exist?(temp_big) assert_equal temp_big, duck_file.local_path assert_equal File.basename(temp_big), duck_file.original_filename assert_equal size, duck_file.size assert_equal 'text/plain', duck_file.content_type end def test_empty_body mms = MMS2R::Media.new stub_mail mms.stubs(:default_text).returns(nil) assert_equal "", mms.body end def test_body mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") mms.stubs(:default_text).returns(File.new(temp_big)) body = mms.body assert_equal "hello world", body end def test_body_when_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") mms.stubs(:default_html).returns(File.new(temp_big)) assert_equal "hello world teapot", mms.body end def test_default_text mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'text/plain' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_text.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_text.local_path end def test_default_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") temp_small = temp_text_file("<html><head><title>hello</title></head><body>world<body></html>") mms.stubs(:media).returns({'text/html' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_html.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_html.local_path end def test_default_media mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'image/jpeg' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_media.local_path end def test_default_media_treats_image_and_video_equally mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big_image = temp_text_file("hello world") temp_small_image = temp_text_file("hello") temp_big_video = temp_text_file("hello world again") temp_small_video = temp_text_file("hello again") mms.stubs(:media).returns({'image/jpeg' => [temp_small_image, temp_big_image], 'video/mpeg' => [temp_small_video, temp_big_video], }) assert_equal temp_big_video, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big_video, mms.default_media.local_path end #def test_default_media_treats_gif_and_jpg_equally # #it doesn't matter that these are text files, we just need say they are images # temp_big = temp_text_file("hello world") # temp_small = temp_text_file("hello") # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/jpeg' => [temp_big], 'image/gif' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/gif' => [temp_big], 'image/jpg' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path #end def test_purge mms = MMS2R::Media.new stub_mail mms.purge assert_equal false, File.exist?(mms.media_dir) end def test_ignore_media_by_filename_equality name = 'foo.txt' type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [name]}}) # type is not in the ingore part = stub(:body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and filename are in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal true, mms.ignore_media?(type, part) # type but not file name are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_filename name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'foo.txt', mms.filename?(part) end def test_long_filename name = 'x' * 300 + '.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'x' * 251 + '.txt', mms.filename?(part) end def test_filename_when_file_extension_missing_part name = 'foo' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.txt', mms.filename?(part) name = 'foo.janky' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.janky.txt', mms.filename?(part) end def test_ignore_media_by_filename_regexp name = 'foo.txt' regexp = /foo\.txt/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [regexp, 'nil.txt']}}) # type is not in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the filename are in the ingore part = stub(:filename => name) assert_equal true, mms.ignore_media?(type, part) # type but not regexp for filename are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_by_regexp_on_file_content name = 'foo.txt' content = "aaaaaaahello worldbbbbbbbbb" regexp = /.*Hello World.*/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => ['nil.txt', regexp]}}) part = stub(:filename => name, :body => Mail::Body.new(content)) # type is not in the ingore assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the content are in the ingore assert_equal true, mms.ignore_media?(type, part) # type but not regexp for content are in the ignore part = stub(:filename => name, :body => Mail::Body.new('no teapots')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_when_file_content_is_empty mms = MMS2R::Media.new stub_mail # there is no conf but the part's body is empty part = stub(:filename => 'foo.txt', :body => Mail::Body.new) assert_equal true, mms.ignore_media?('text/test', part) # there is no conf but the part's body is white space part = stub(:filename => 'foo.txt', :body => Mail::Body.new("\t\n\t\n ")) assert_equal true, mms.ignore_media?('text/test', part) end def test_add_file mail = stub_mail mail.stubs(:from).returns(['[email protected]']) mms = MMS2R::Media.new(mail) mms.stubs(:media).returns({}) assert_nil mms.media['text/html'] mms.add_file('text/html', '/tmp/foo.html') assert_equal ['/tmp/foo.html'], mms.media['text/html'] mms.add_file('text/html', '/tmp/bar.html') assert_equal ['/tmp/foo.html', '/tmp/bar.html'], mms.media['text/html'] end def test_temp_file name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal name, File.basename(mms.temp_file(part)) end def test_process_media_for_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', 'hello world']) result = mms.process_media(part) assert_equal 'text/plain', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_with_empty_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', ''])
monde/mms2r
744ff12064551464e7b08e366e6cda14602e6dff
make the spec valid
diff --git a/mms2r.gemspec b/mms2r.gemspec index 0329977..a0a9c6e 100644 --- a/mms2r.gemspec +++ b/mms2r.gemspec @@ -1,45 +1,45 @@ # -*- encoding: utf-8 -*- Gem::Specification.new do |s| s.name = "mms2r" - s.version = "3.4.0" + s.version = "3.6.1" s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version= s.authors = ["Mike Mondragon"] s.date = "2011-10-31" s.description = "== DESCRIPTION\n\nMMS2R by Mike Mondragon\nhttp://mms2r.rubyforge.org/\nhttps://github.com/monde/mms2r\nhttps://github.com/monde/mms2r/issues\nhttp://peepcode.com/products/mms2r-pdf\n\nMMS2R is a library that decodes the parts of an MMS message to disk while\nstripping out advertising injected by the mobile carriers. MMS messages are\nmultipart email and the carriers often inject branding into these messages. Use\nMMS2R if you want to get at the real user generated content from a MMS without\nhaving to deal with the cruft from the carriers.\n\nIf MMS2R is not aware of a particular carrier no extra processing is done to the\nMMS other than decoding and consolidating its media." s.email = ["[email protected]"] s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.TMail.txt", "README.txt"] s.files = ["Gemfile", "Gemfile.lock", "History.txt", "Manifest.txt", "README.TMail.txt", "README.txt", "Rakefile", "conf/1nbox.net.yml", "conf/aliases.yml", "conf/bellsouth.net.yml", "conf/from.yml", "conf/mediamessaging.o2.co.uk.yml", "conf/messaging.nextel.com.yml", "conf/mms.3ireland.ie.yml", "conf/mms.ae.yml", "conf/mms.alltel.com.yml", "conf/mms.att.net.yml", "conf/mms.dobson.net.yml", "conf/mms.luxgsm.lu.yml", "conf/mms.mobileiam.ma.yml", "conf/mms.mtn.co.za.yml", "conf/mms.mycricket.com.yml", "conf/mms.myhelio.com.yml", "conf/mms.netcom.no.yml", "conf/mms.o2online.de.yml", "conf/mms.three.co.uk.yml", "conf/mms.uscc.net.mail", "conf/mms.vodacom4me.co.za.yml", "conf/mms2r_media.yml", "conf/mobile.indosat.net.id.yml", "conf/msg.telus.com.yml", "conf/orangemms.net.yml", "conf/pm.sprint.com.yml", "conf/pxt.vodafone.net.nz.yml", "conf/rci.rogers.com.yml", "conf/sms.sasktel.com.yml", "conf/tmomail.net.yml", "conf/txt.bell.ca.yml", "conf/unicel.com.yml", "conf/vmpix.com.yml", "conf/vzwpix.com.yml", "conf/waw.plspictures.com.yml", "dev_tools/anonymizer.rb", "dev_tools/debug_sprint_nokogiri_parsing.rb", "init.rb", "lib/ext/mail.rb", "lib/ext/object.rb", "lib/mms2r.rb", "lib/mms2r/media.rb", "lib/mms2r/media/sprint.rb", "mms2r.gemspec", "test/fixtures/1nbox-2images-01.mail", "test/fixtures/1nbox-2images-02.mail", "test/fixtures/1nbox-2images-03.mail", "test/fixtures/1nbox-2images-04.mail", "test/fixtures/3ireland-mms-01.mail", "test/fixtures/ad_new.txt", "test/fixtures/alltel-image-01.mail", "test/fixtures/alltel-mms-01.mail", "test/fixtures/alltel-mms-03.mail", "test/fixtures/apple-double-image-01.mail", "test/fixtures/att-blackberry-02.mail", "test/fixtures/att-blackberry.mail", "test/fixtures/att-image-01.mail", "test/fixtures/att-image-02.mail", "test/fixtures/att-iphone-01.mail", "test/fixtures/att-iphone-02.mail", "test/fixtures/att-iphone-03.mail", "test/fixtures/att-text-01.mail", "test/fixtures/bell-canada-image-01.mail", "test/fixtures/cingularme-text-01.mail", "test/fixtures/cingularme-text-02.mail", "test/fixtures/dici_un_mois_georgie.txt", "test/fixtures/dobson-image-01.mail", "test/fixtures/dot.jpg", "test/fixtures/generic.mail", "test/fixtures/handsets.yml", "test/fixtures/helio-image-01.mail", "test/fixtures/helio-message-01.mail", "test/fixtures/iconv-fr-text-01.mail", "test/fixtures/indosat-image-01.mail", "test/fixtures/indosat-image-02.mail", "test/fixtures/info2go-image-01.mail", "test/fixtures/iphone-image-01.mail", "test/fixtures/luxgsm-image-01.mail", "test/fixtures/maroctelecom-france-mms-01.mail", "test/fixtures/mediamessaging_o2_co_uk-image-01.mail", "test/fixtures/mmode-image-01.mail", "test/fixtures/mms.ae-image-01.mail", "test/fixtures/mms.mycricket.com-pic-and-text.mail", "test/fixtures/mms.mycricket.com-pic.mail", "test/fixtures/mmsreply.t-mobile.co.uk-text-image-01.mail", "test/fixtures/mobile.mycingular.com-text-01.mail", "test/fixtures/mtn-southafrica-mms.mail", "test/fixtures/mycingular-image-01.mail", "test/fixtures/netcom-image-01.mail", "test/fixtures/nextel-image-01.mail", "test/fixtures/nextel-image-02.mail", "test/fixtures/nextel-image-03.mail", "test/fixtures/nextel-image-04.mail", "test/fixtures/o2-de-image-01.mail", "test/fixtures/orange-uk-image-01.mail", "test/fixtures/orangefrance-text-and-image.mail", "test/fixtures/orangepoland-text-01.mail", "test/fixtures/orangepoland-text-02.mail", "test/fixtures/pics.cingularme.com-image-01.mail", "test/fixtures/pxt-image-01.mail", "test/fixtures/rogers-canada-mms-01.mail", "test/fixtures/sasktel-image-01.mail", "test/fixtures/sprint-broken-image-01.mail", "test/fixtures/sprint-image-01.mail", "test/fixtures/sprint-new-image-01.mail", "test/fixtures/sprint-pcs-text-01.mail", "test/fixtures/sprint-purged-image-01.mail", "test/fixtures/sprint-text-01.mail", "test/fixtures/sprint-two-images-01.mail", "test/fixtures/sprint-video-01.mail", "test/fixtures/sprint.mov", "test/fixtures/suncom-blackberry.mail", "test/fixtures/telus-image-01.mail", "test/fixtures/three-uk-image-01.mail", "test/fixtures/tmo.blackberry.net-image-01.mail", "test/fixtures/tmobile-blackberry-02.mail", "test/fixtures/tmobile-blackberry.mail", "test/fixtures/tmobile-image-01.mail", "test/fixtures/tmobile-image-02.mail", "test/fixtures/unicel-image-01.mail", "test/fixtures/us-cellular-image-01.mail", "test/fixtures/verizon-blackberry.mail", "test/fixtures/verizon-image-01.mail", "test/fixtures/verizon-image-02.mail", "test/fixtures/verizon-image-03.mail", "test/fixtures/verizon-text-01.mail", "test/fixtures/verizon-video-01.mail", "test/fixtures/virgin-mobile-image-01.mail", "test/fixtures/virgin.ca-text-01.mail", "test/fixtures/vodacom4me-co-za-01.mail", "test/fixtures/vodacom4me-co-za-02.mail", "test/fixtures/vodacom4me-southafrica-mms-01.mail", "test/fixtures/vodacom4me-southafrica-mms-04.mail", "test/fixtures/vtext-text-01.mail", "test/fixtures/vzwpix.com-image-01.mail", "test/fixtures/waw.plspictures.com-image-01.mail", "test/hax.rb", "test/test_1nbox_net.rb", "test/test_bell_canada.rb", "test/test_bellsouth_net.rb", "test/test_helper.rb", "test/test_mediamessaging_o2_co_uk.rb", "test/test_messaging_nextel_com.rb", "test/test_messaging_sprintpcs_com.rb", "test/test_mms2r_media.rb", "test/test_mms_3ireland_ie.rb", "test/test_mms_ae.rb", "test/test_mms_alltel_com.rb", "test/test_mms_att_net.rb", "test/test_mms_dobson_net.rb", "test/test_mms_luxgsm_lu.rb", "test/test_mms_mobileiam_ma.rb", "test/test_mms_mtn_co_za.rb", "test/test_mms_mycricket_com.rb", "test/test_mms_myhelio_com.rb", "test/test_mms_netcom_no.rb", "test/test_mms_o2online_de.rb", "test/test_mms_three_co_uk.rb", "test/test_mms_uscc_net.rb", "test/test_mms_vodacom4me_co_za.rb", "test/test_mobile_indosat_net_id.rb", "test/test_msg_telus_com.rb", "test/test_orangemms_net.rb", "test/test_pm_sprint_com.rb", "test/test_pxt_vodafone_net_nz.rb", "test/test_rci_rogers_com.rb", "test/test_sms_sasktel_com.rb", "test/test_tmomail_net.rb", "test/test_unicel_com.rb", "test/test_vmpix_com.rb", "test/test_vzwpix_com.rb", "test/test_waw_plspictures_com.rb", "vendor/plugins/mms2r/lib/autotest/discover.rb", "vendor/plugins/mms2r/lib/autotest/mms2r.rb", ".gemtest"] s.homepage = "https://github.com/monde/mms2r" s.rdoc_options = ["--main", "README.txt"] s.require_paths = ["lib"] s.rubyforge_project = "mms2r" s.rubygems_version = "1.8.10" s.summary = "Extract user media from MMS (and not carrier cruft)" s.test_files = ["test/test_orangemms_net.rb", "test/test_waw_plspictures_com.rb", "test/test_mediamessaging_o2_co_uk.rb", "test/test_vzwpix_com.rb", "test/test_unicel_com.rb", "test/test_messaging_sprintpcs_com.rb", "test/test_mms_luxgsm_lu.rb", "test/test_rci_rogers_com.rb", "test/test_mms_uscc_net.rb", "test/test_mms_netcom_no.rb", "test/test_1nbox_net.rb", "test/test_sms_sasktel_com.rb", "test/test_mms_att_net.rb", "test/test_mobile_indosat_net_id.rb", "test/test_messaging_nextel_com.rb", "test/test_mms_mtn_co_za.rb", "test/test_mms_vodacom4me_co_za.rb", "test/test_pxt_vodafone_net_nz.rb", "test/test_mms_dobson_net.rb", "test/test_helper.rb", "test/test_msg_telus_com.rb", "test/test_mms_o2online_de.rb", "test/test_mms2r_media.rb", "test/test_bell_canada.rb", "test/test_tmomail_net.rb", "test/test_mms_3ireland_ie.rb", "test/test_pm_sprint_com.rb", "test/test_mms_alltel_com.rb", "test/test_mms_mobileiam_ma.rb", "test/test_mms_mycricket_com.rb", "test/test_bellsouth_net.rb", "test/test_mms_three_co_uk.rb", "test/test_vmpix_com.rb", "test/test_mms_myhelio_com.rb", "test/test_mms_ae.rb"] if s.respond_to? :specification_version then s.specification_version = 3 if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then s.add_runtime_dependency(%q<nokogiri>, [">= 1.4.4"]) s.add_runtime_dependency(%q<mail>, [">= 2.2.10"]) s.add_runtime_dependency(%q<uuidtools>, [">= 2.1.1"]) s.add_runtime_dependency(%q<exifr>, [">= 1.0.3"]) s.add_development_dependency(%q<hoe>, ["~> 2.12"]) else s.add_dependency(%q<nokogiri>, [">= 1.4.4"]) s.add_dependency(%q<mail>, [">= 2.2.10"]) s.add_dependency(%q<uuidtools>, [">= 2.1.1"]) s.add_dependency(%q<exifr>, [">= 1.0.3"]) s.add_dependency(%q<hoe>, ["~> 2.12"]) end else s.add_dependency(%q<nokogiri>, [">= 1.4.4"]) s.add_dependency(%q<mail>, [">= 2.2.10"]) s.add_dependency(%q<uuidtools>, [">= 2.1.1"]) s.add_dependency(%q<exifr>, [">= 1.0.3"]) s.add_dependency(%q<hoe>, ["~> 2.12"]) end end
monde/mms2r
01c61e54ba95de835fa1cbb1034042d4864a50f9
Use Net::HTTP#get2 to fetch Sprint content.
diff --git a/History.txt b/History.txt index 8dc58b3..5a946d1 100644 --- a/History.txt +++ b/History.txt @@ -1,408 +1,413 @@ +### 3.6.1 / 2012-02-11 (Mr. Gojira - Owner Mr. Gojira's Driving School) + +* 1 minor enhancement + * use Net::HTTP#get2 to fetch Sprint content + ### 3.6.0 / 2012-01-19 (Agent 216 - assassin, master of infiltration and sabotage) * 1 major enhancement * Ruby 1.8.7, 1.9.2, and 1.9.3 compatible * 1 bug fix * A fix for the utf-8 encoding issue with ruby 1.9.2 - minimul / Christian ### 3.5.1 / 2011-12-11 (Mashed Potato Johnson - oldest living blues guitarist in the world) * 1 bug fix * A fix for the utf-8 encoding issue with ruby 1.9.2 - James McGrath ### 3.5.0 / 2011-12-01 (Dr. Milminiman Lamilim Swimwambli - Marriage expert) * 1 major bug fix * In Ruby 1.9.X MMS2R::Media::Sprint was not fetching content from Sprint's CDN correctly because the implementation of Net::HTTP in 1.9.X passes a User-Agent header of "Ruby" to which Sprint responds with a fake 500 - with help from James McGrath ### 3.4.1 / 2011-11-06 (Fatty Ding-Dongs, Dethklok foster child) * 2 major enhancements * Additional means to detect android, iphone, motorola, nokia, palm handsets * Additional known SMS/MMS domains mm.att.net, labwig.net, cdma.sasktel.com ### 3.4.0 / 2011-10-31 (Serveta Skwigelf, Skwisgaar's hot mom) * 2 major enhancements * regexp's in yaml configs are store as a ruby regexp and not a string that is evaled. * character encoding capability with 1.8 rubies and 1.9 rubies. ### 3.3.1 / 2011-01-01 (Reverend Aslaug Wartooth (deceased), Toki's dad) * 2 minor enhancements * new method #default_html returns the default html attachment * #body will return the default plain text, or default stripped html text ### 3.3.0 / 2010-12-31 (Charles Foster Offdensen - CFO, dethklok) * 1 major enhancement * MMS2R::Media::Sprint is now a module that is extended in for processing Sprint content rather than being child class of MMS2R::Media Extension is the strategy to use for overwriting template methods now * 1 minor enhancement * process new Sprint subject - Jason Hooper * new SaskTel mms/sms domain alias sasktel.com * new Virgin Mobile mms/sms domain alias yrmobl.com ### 3.2.0 / 2010-08-17 (Antonio "Tony" DiMarco Thunderbottom - bassist) * 3 minor enhancements * updated readme with latest sites known to use mms2r * bundler assimilated * loading rubygems only if it's required, like rake ### 3.1.0 / 2010-07-09 (Dick "Magic Ears" Knubbler - music producer) * 8 minor enhancements * Detects additional Bell/AT&T domain sbcglobal.net as a handset * Detects additional Virgin mobile domains pixmbl.com vmobl.com as a handset * Expanded mobile phone detection for handset makers by : Casio, Google Nexus One, LG Electronics, Motorola, Pantech, Qualcom, Samsung, Sprint, UTStarCom * EXIF Reader (exifr) is integral to MMS2R and is now a required gem * upgrade Mail to 2.2.5 * depend on latest gems * corrected example - Jason Hooper * added As Seen On The Internet to README that lists sites known to be using MMS2R in some fashion ### 3.0.1 / 2010-03-28 (Lavona Succuboso - leader of "Succuboso Explosion") * 1 minor enhancement * support for U.S. Cellular ### 3.0.0 / 2010-02-24 (General Crozier - Chairman of the Joint Chiefs of Staff) * 1 new feature * dependence upon Mail gem rather than TMail gem ### 2.4.1 / 2010-02-07 (Vater Orlaag - political and spiritual specialist) * 3 minor enhancements * make sure filename is free of new lines - laurynas * recognize HTC HERO200 as a smart phone * recognize HTC Eris as a smart phone ### 2.4.0 / 2009-12-20 (Dr. Nanemiltred Philtendrieden - specialist on celebrity death) * 1 new feature * replace Hpricot with Nokogiri for html parsing of Sprint data * 3 minor enhancements * smartphone identities stored in conf/mms2r_media.yml * identify Motorola Droid as a smartphone * identify T-Mobile Dash as a smartphone * use uuidtools for naming temp directories - kbaum ### 2.3.0 / 2009-08-30 (Snakes 'n' Barrels Greatest Hits) * 5 new features * detect smartphone status/type based on model metadata from jpeg and tiff exif data using exifr gem, access exif data with MMS2R::Media#exif * make MMS2R Rails gem packaging friendly with an init.rb - Scott Taylor, smtlaissezfaire * delegate missing methods to mms2r's tmail object so that mms2r behaves as if it were a tmail object - Sai Emrys, saizai * default_media can return an attachment of application content type - Brendan Lim, brendanlim * MMS2R.parse(raw_mail) convenience class method that parses and returns an mms2r from a mail file - saizai * 4 minor enhancements * make examples more 'mail' specific to enforce the fact that an mms is a multipart email - saizai * update for text in vzwpix.com default carrier message * detecting smartphone (blackberries and iphones for now) is more versatile from reading mail headers * expanded filtering of carrier advertising text in mms from smartphones ### 2.2.0 / 2009-01-04 (Rikki Kixx - owner of a franchise of rehab centers) * 3 new features * MMS2R::Media#is_mobile? best guess if the sender was a mobile device * MMS2R::Media#device_type? best guess of the mobile device type. Simple heuristics thus far for :blackberry :iphone :handset :unknown could be expanded for exif probing or additinal shifting of mail header * from array in conf/from.yml to provide granularity to determine carrier domain (caused by tmo.blackberry.net) * 4 minor enhancements * support for Virgin Canada messaging service vmobile.ca * support for text service messaging.sprintpcs.com * additional BlackBerry coverage from T-Mobile tmo.blackberry.net provider * legacy support for mobile.mycingular.com, pics.cingularme.com * 3 bug fixes * iPhone default subject - jesse dp http://rubyforge.org/tracker/?func=detail&atid=11789&aid=22951&group_id=3065 * add sprintpcs.com to pm.sprint.com aliases * fix OS X long filename issues - Matt Conway ### 2.1.3 / 2008-11-06 (Dr. Ramonolith Chesterfield - Military pharmaceutical psychotropic drug manufacturing expert * 1 minor enhancement * added mms.ae support ### 2.1.2 / 2008-10-21 (Toki's mom, Anja Wartooth) * 2 minor enhancments * Sprint subject update - jesse dp * Virgin Mobile support vmpix.com ### 2.1.1 / 2008-09-24 (Lavona Succuboso, Nathan Explosion uber-groupie) * 4 minor enhancments * Bell Canada support txt.bell.ca - Matt Conway / Snap My Life - http://github.com/wr0ngway, http://github.com/sml * Unicel support unicel.com - Michael DelGaudio * info2go.com support / Unicel * TELUS Corporation support mms.telusmobility.com, msg.telus.com * add test to check that gem builds correctly as a github gem * 1 bug fix * Iconv utf8 fix - Kai Kai ### 2.1.0 / 2008-07-30 (Dr. Gibbons – Birthday expert and Murderface expert) * 1 major enhancement: * opens up TMail for improved query method patterned code in MMS2R * 2 minor enhancements: * UK O2 support mediamessaging.o2.co.uk - Jeremy Wilkins * Write non text files with binary bit set on Windows - David Alm * source hosted on github: git clone git://github.com/monde/mms2r.git ### 2.0.5 / 2008-07-17 (Dr. Ralphus Galkensmelter - Psychological death expert) * Deal with Apple Mail multipart/appledouble - jesse dp ### 2.0.4 / 2008-04-28 (Mr. Selatcia - elder member of The Tribunal) * updated mms.vodacom4me.co.za Vodacom South Africa - Vijay Yellapragada * 1nbox.net / Idea cellular 1nbox.net - Vijay Yellapragada * mms.3ireland.ie / 3 Ireland - Vijay Yellapragada * mms.alltel.com / Alltel (reverted message.alltel.com) - Vijay Yellapragada * mms.mobileiam.ma / Maroc Telecom - Vijay Yellapragada * mms.mtn.co.za / MTM South Africa - Vijay Yellapragada * rci.rogers.com / Rogers of Canada - Vijay Yellapragada * mmsreply.t-mobile.co.uk / T-Mobile UK - Vijay Yellapragada * waw.plspictures.com / PLSPICTURES.COM mms hosting service ### 2.0.3 / 2008-04-15 (Enter Taxman - The 1040 MMS Form) * fix case when part is image/jpeg declared 'application/octet-stream' * trim dangling image/jpeg text from blackberry messages * file extensions added to filenames that are missing extensions in part headers * anonymize images in fixtures to reduce gem size * T-Mobile update - jesse dp * AT&T/T-Mobile Blackberrry update - Dave Myron ### 2.0.2 / 2008-02-22 (The Jomfru Brothers - proprietors of diefordethklok.com) * added support for mms.vodacom4me.co.za Vodacom South Africa - Jason Haruska * added support for bellsouth.net - Jason Haruska * added support for mms.mycricket.com * Improved Blackberry and iPhone suport - Jason Haruska * added :number key to configuration to provide rules for specifying alternative phone number location * return sender's phone number for mobile.indosat.net.id * return sender's phone number for mms.luxgsm.lu * return sender's phone number for mms.vodacom4me.co.za ### 2.0.1 / 2008-02-08 (Professor Jerry Gustav Munndig - Child control expert) * strip out common blackberry and iPhone signatures * handle carriers that use external mail services such as Yahoo! as the From address * Add support for mobile.indosat.net.id (and yahoo.co.id) - Jason Haruska * Add support for sms.sasktel.com - Jason Haruska ### 2.0.0 / 2008-01-23 (Skwisgaar Skwigelf - fastest guitarist alive) * added support for pxt.vodafone.net.nz PXT New Zealand * added support for mms.o2online.de O2 Germany * added support for orangemms.net Orange UK * added support for txt.att.net AT&T * added support for mms.luxgsm.lu LUXGSM S.A. * added support for mms.netcom.no NetCom (Norway) * added support for mms.three.co.uk Hutchison 3G UK Ltd * removed deprecated #get_number use #number * removed deprecated #get_subject use #subject * removed deprecated #get_body use #body * removed deprecated #get_media use #default_media * removed deprecated #get_text use #default_text * removed deprecated #get_attachment use #attachment * fixed error when Sprint content server responds 500 * better yaml configs * moved TMail dependency from Rails ActionMailer SVN to 'official' Gem * ::new greedily processes MMS unless otherwise specified as an initialize option :process => :lazy * logger moved to initialize option :logger => some_logger * testing using mocks and stubs instead of duck raped Net::HTTP * fixed typo in name of method #attachement to #attachment * fixed broken downloading of Sprint videos ### 1.1.12 / 2007-10-21 (Dr. Ronald von Moldenberg - Endorsement specialist) * fetch original images from Sprint content server (Layton Wedgeworth) * ignore Sprint messages when requested content has been purged from their content server ### 1.1.11 / 2007-10-20 (Dr. Armand Skagerakk Frederickshaven - Mythology expert) * minor fix for attachment_fu where it might call #path on the cgi temp file that is returned by get_attachment * renamed a_t_t_media.rb to att_media.rb to make it autotest happy * masthead.jpg misplaced in mms2r_t_mobile_media_ignore.yml (Layton Wedgeworth) * overridden SprintMedia#process failed to accept block (Layton Wedgeworth) * added method_deprecated to help mark methods that are going to be deprecated in preparation of 1.2.x release * #get_number marked deprecated, use #number instead * #get_subject marked deprecated, use #subject instead * #get_body marked deprecated, use #body instead * #get_text marked deprecated, use #default_text instead * #get_attachment marked deprecated, use #attachment instead * #get_media marked deprecated, use #default_media instead ### 1.1.10 / 2007-09-30 (Face Bones) * fixed a case for a nil match on From in the create method (Luke Francl) * added support for Alltel message.alltel.com (Ben Wood) ### 1.1.9 / 2007-09-08 (Rebecca Nightrod - controlling girlfriend of Nathan Explosion) * fixed broken support for act_as_attachment and attachment_fu ### 1.1.8 / 2007-09-08 (James Grishnack - Head of Behemoth Productions, producer of Blood Ocean) * Added support for Orange of France, Orange orange.fr (Julian Biard) * purge in the process block removed, purge must be called explicitly after processing to clean up extracted temporary media files. ### 1.1.7 / 2007-08-25 (Adam Nergal, friend of Skwisgaar, but not Pickles) * Added support for Orange of Poland, Orange mmsemail.orange.pl (Zbigniew Sobiecki) * Cleaned up documentation modifiers * Cleaned out non-Ruby code idioms ### 1.1.6 / 2007-08-11 (Mustakrakish, the Lake Troll part 2) * Redo of release mistake of 1.1.5 ### 1.1.5 / 2007-08-11 (Mustakrakish, the Lake Troll) * AT&T => mms.att.net not clearing out default "multimedia message" subject to nil (Will Jessup) * Ignore case on default subject for all carriers in corresponding conf/mms2r_XXX_media_subject.yml ### 1.1.4 / 2007-08-07 (Dr. Rockso) * AT&T => mms.att.net support (thanks Mike Chen and Dave Myron) * get_body returns nil when there is not user text (sorry Will!) ### 1.1.3 / 2007-07-10 (Charles Foster Ofdensen) * Helio support by Will Jessup * get_subject returns nil on default carrier subjects ### 1.1.2 / 2007-06-13 (Dethklok roadie #2) * placed versioned hpricot dependency in Hoe's extra_deps (an attempt to appease firebrigade gods or not cause Gem::RemoteInstallationCancelled whichever you prefer) ### 1.1.1 / 2007-06-11 (Dethklok roadie) * rescue rcov non-dependency in Rakefile to make firebrigade happy ### 1.1.0 / 2007-06-08 (Toki Wartooth) * get_body to return body text (Luke Francl) * get_subject returns "" for default subjects now * default subjects listed in yaml by carrier in conf directory * added granularity to Cingular, Sprint, and Verizon carrier services (Will Jessup) * refactored Sprint instance to process all media (Will Jessup + Mike) * optimized text transformations (Will Jessup) * properly handle ISO-8859-1 and UTF-8 text (Will Jessup) * autotest powers activate! (ZenTest autotest discovery enabled) * configuration file ignores, transforms, and subjects all store Regexp's * Put vendor Text::Format & TMail::Mail as an external subversion dependency to the 1.2 stable branch of Rails ActionMailer * added get_number method to return the phone number associated with this MMS * get_media and get_text attachment_fu helper return the largest piece of media of that type if the more than one exits in the media (Luke Francl) * added block support to process() method (Shane Vitarana) ### 1.0.7 / 2007-04-27 (Senator Stampingston) * patch submitted by Luke Francl * added a get_subject method that returns nil when any MMS has a default carrier subject * get_subject returns nil for '', 'Multimedia message', '(no subject)', 'You have new Picture Mail!' ### 1.0.6 / 2007-04-24 (Pickles the Drummer) * patch submitted by Luke Francl * added support for mms.dobson.net (Dobson aka Cellular One) (Luke) * DRY'd up unit tests (Luke) * added get_media instance method that returns first video or image as File (Luke) * File from get_media can be used by/with attachment_fu (Luke) * added get_text instance method that returns first non advertising text * File from get_text can be used by/with attachment_fu ### 1.0.5 / 2007-04-10 (William Murderface) * patch submitted by Luke Francl * made ignore_media? start its text check from the start of the file (Luke) * added new text transform for Verizon messages (Luke) * updated Nextel ignore conf (Luke) * added additional samples and tests for T-Mobile & Verizon (Luke) * cleaned up MMS2R::Media documentation * added Sprint broken image test for when media goes stale on their content server * fixed teardown typo in lots of plases * added tests for 4 three samples of unique variants of Sprint/Nextel text * 100% test coverage! ### 1.0.4 / 2007-04-09 (Metalocalypse) * fix teardown in test_mms2r_sprint.rb (shanesbrain.net) * clean up Net::HTTP in MMS2R::SprintMedia (shanesbrain.net) * added accessor MMS2R::Media.media_dir * fixed a nil issue with underlying tmp working dir * added exception handling around Net::HTTP in MMS2R::SprintMedia ### 1.0.3 / 2007-04-05 (Paper Cut) * Cleaned up packaging and errors in example found by Shane V. http://shanesbrain.net/ ### 1.0.2 / 2007-03-07 * Reorganized tests and fixtures * Added carriers: * Cingular => cingularme.com * Nextel => messaging.nextel.com * Verizon => vtext.com ### 1.0.1 / 2007-03-07 * Flubbed RubyForge release ... do not use this. ### 1.0.0 / 2007-03-06 * Birthday! * AT&T/Cingular => mmode.com * Cingular => mms.mycingular.com * Sprint => pm.sprint.com * Sprint => messaging.sprintpcs.com * T-Mobile => tmomail.net * Verizon => vzwpix.com diff --git a/lib/mms2r.rb b/lib/mms2r.rb index b3808d8..33682fc 100644 --- a/lib/mms2r.rb +++ b/lib/mms2r.rb @@ -1,82 +1,83 @@ #-- # Copyright (c) 2007-2010 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ module MMS2R ## # A hash of MMS2R processors keyed by MMS carrier domain. CARRIERS = {} ## # Registers a class as a processor for a MMS domain. Should only be # used in special cases such as MMS2R::Media::Sprint for 'pm.sprint.com' def self.register(domain, processor_class) MMS2R::CARRIERS[domain] = processor_class end ## # A hash of file extensions for common mime-types EXT = { 'text/plain' => 'text', 'text/plain' => 'txt', 'text/html' => 'html', 'image/png' => 'png', 'image/gif' => 'gif', 'image/jpeg' => 'jpeg', 'image/jpeg' => 'jpg', 'video/quicktime' => 'mov', 'video/3gpp2' => '3g2' } class MMS2R::Media ## # MMS2R library version - VERSION = '3.6.0' + VERSION = '3.6.1' ## # Spoof User-Agent, primarily for the Sprint CDN USER_AGENT = "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C28 Safari/419.3" end # Simple convenience function to make it a one-liner: # MMS2R.parse raw_mail or MMS2R.parse File.load(raw_mail) # Combined w/ the method_missing delegation, this should behave as an enhanced Mail object, more or less. - def self.parse raw_mail + def self.parse raw_mail, options = {} mail = Mail.new raw_mail - MMS2R::Media.new(mail) end + MMS2R::Media.new(mail, options) + end end %W{ yaml mail fileutils pathname tmpdir yaml digest/sha1 iconv exifr }.each do |g| begin require g rescue LoadError require 'rubygems' require g end end if RUBY_VERSION >= "1.9" begin require 'psych' YAML::ENGINE.yamler= 'syck' if defined?(YAML::ENGINE) rescue LoadError end end require File.join(File.dirname(__FILE__), 'ext/mail') require File.join(File.dirname(__FILE__), 'ext/object') require File.join(File.dirname(__FILE__), 'mms2r/media') require File.join(File.dirname(__FILE__), 'mms2r/media/sprint') MMS2R.register('pm.sprint.com', MMS2R::Media::Sprint) diff --git a/lib/mms2r/media/sprint.rb b/lib/mms2r/media/sprint.rb index 217fbab..a04c1b4 100644 --- a/lib/mms2r/media/sprint.rb +++ b/lib/mms2r/media/sprint.rb @@ -1,196 +1,198 @@ #-- # Copyright (c) 2007-2010 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ require 'net/http' require 'nokogiri' require 'cgi' module MMS2R class Media ## # Sprint version of MMS2R::Media # # Sprint is an annoying carrier because they don't actually transmit user # generated content (like images or videos) directly in the MMS message. # Instead, they hijack the media that is sent from the cellular subscriber # and place that content on a content server. In place of the media # the recipient receives a HTML message with unsolicited Sprint # advertising and links back to their content server. The recipient has # to click through Sprint more pages to view the content. # # The default subject on these messages from the # carrier is "You have new Picture Mail!" module Sprint ## # Override process() because Sprint doesn't attach media (images, video, # etc.) to its MMS. Media such as images and videos are hosted on a # Sprint content server. MMS2R::Media::Sprint has to pick apart an # HTML attachment to find the URL to the media on Sprint's content # server and download each piece of content. Any text message part of # the MMS if it exists is embedded in the html. def process unless @was_processed log("#{self.class} processing", :info) #sprint MMS are multipart parts = @mail.parts #find the payload html doc = nil parts.each do |p| next unless p.part_type? == 'text/html' d = Nokogiri(p.body.decoded) title = d.at('title').inner_html if title =~ /You have new Picture Mail!/ doc = d @is_video = (p.body.decoded =~ /type=&quot;VIDEO&quot;&gt;/m ? true : false) end end return if doc.nil? # it was a dud @is_video ||= false # break it down sprint_phone_number(doc) sprint_process_text(doc) sprint_process_media(doc) @was_processed = true end # when process acts upon a block if block_given? media.each do |k, v| yield(k, v) end end end private ## # Digs out where Sprint hides the phone number def sprint_phone_number(doc) c = doc.search("/html/head/comment()").last t = c.content.gsub(/\s+/m," ").strip #@number returned in parent's #number @number = / name=&quot;MDN&quot;&gt;(\d+)&lt;/.match(t)[1] end ## # Pulls out the user text form the MMS and adds the text to media hash def sprint_process_text(doc) # there is at least one <pre> with MMS text if text has been included by # the user. (note) we'll have to verify that if they attach multiple texts # to the MMS then Sprint stacks it up in multiple <pre>'s. The only <pre> # tag in the document is for text from the user. doc.search("/html/body//pre").each do |pre| type = 'text/plain' text = pre.inner_html.strip next if text.empty? type, text = transform_text(type, text) type, file = sprint_write_file(type, text.strip) add_file(type, file) unless type.nil? || file.nil? end end ## # Fetch all the media that is referred to in the doc def sprint_process_media(doc) srcs = Array.new # collect all the images in the document, even though # they are <img> tag some might actually refer to video. # To know the link refers to vide one must look at the # content type on the http GET response. imgs = doc.search("/html/body//img") imgs.each do |i| src = i.attributes['src'] next unless src src = src.text # we don't want to double fetch content and we only # want to fetch media from the content server, you get # a clue about that as there is a RECIPIENT in the URI path # of real content next unless /mmps\/RECIPIENT\//.match(src) next if srcs.detect{|s| s.eql?(src)} srcs << src end #we've got the payload now, go fetch them cnt = 0 srcs.each do |src| begin uri = URI.parse(CGI.unescapeHTML(src)) unless @is_video query={} uri.query.split('&').each{|a| p=a.split('='); query[p[0]] = p[1]} - query.delete_if{|k, v| k == 'limitsize' or k == 'squareoutput' } + query.delete_if{|k, v| k == 'limitsize' || k == 'squareoutput' } uri.query = query.map{|k,v| "#{k}=#{v}"}.join("&") end # sprint is a ghetto, they expect to see &amp; for video request uri.query = uri.query.gsub(/&/, "&amp;") if @is_video connection = Net::HTTP.new(uri.host, uri.port) - response, content = connection.get( + #connection.set_debug_output $stdout + response = connection.get2( uri.request_uri, { "User-Agent" => MMS2R::Media::USER_AGENT } ) + content = response.body rescue StandardError => err log("#{self.class} processing error, #{$!}", :error) next end # if the Sprint content server uses response code 500 when the content is purged # the content type will text/html and the body will be the message if response.content_type == 'text/html' && response.code == "500" log("Sprint content server returned response code 500", :error) next end # setup the file path and file base = /\/RECIPIENT\/([^\/]+)\//.match(src)[1] type = response.content_type file_name = "#{base}-#{cnt}.#{self.class.default_ext(type)}" file = File.join(msg_tmp_dir(),File.basename(file_name)) # write it and add it to the media hash type, file = sprint_write_file(type, content, file) add_file(type, file) unless type.nil? || file.nil? cnt = cnt + 1 end end ## # Creates a temporary file based on the type def sprint_temp_file(type) file_name = "#{Time.now.to_f}.#{self.class.default_ext(type)}" File.join(msg_tmp_dir(),File.basename(file_name)) end ## # Writes the content to a file and returns the type, file as a tuple. def sprint_write_file(type, content, file = nil) file = sprint_temp_file(type) if file.nil? log("#{self.class} writing file #{file}", :info) # force the encoding to be utf-8 content = content.force_encoding("UTF-8") if content.respond_to?(:force_encoding) File.open(file,'w'){ |f| f.write(content) } return type, file end end end end diff --git a/test/test_pm_sprint_com.rb b/test/test_pm_sprint_com.rb index 0526638..757fa2e 100644 --- a/test/test_pm_sprint_com.rb +++ b/test/test_pm_sprint_com.rb @@ -1,257 +1,239 @@ require "test_helper" class TestPmSprintCom < Test::Unit::TestCase include MMS2R::TestHelper def mock_sprint_image(message_id) response = mock('response') body = mock('body') connection = mock('connection') response.expects(:content_type).twice.returns('image/jpeg') + response.expects(:body).returns(body) response.expects(:code).never Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection - connection.expects(:get).with( + connection.expects(:get2).with( # 1.9.2 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90&ext=.jpg&iconifyVideo=true&wm=1' # 1.8.7 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&outquality=90&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU' kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } - ).once.returns([response, body]) + ).once.returns(response) end def mock_sprint_purged_image(message_id) response = mock('response') body = mock('body') connection = mock('connection') response.expects(:content_type).once.returns('text/html') + response.expects(:body).returns(body) response.expects(:code).once.returns('500') Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection - connection.expects(:get).with( + connection.expects(:get2).with( # 1.9.2 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90&ext=.jpg&iconifyVideo=true&wm=1' # 1.8.7 # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&outquality=90&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU' kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } - ).once.returns([response, body]) + ).once.returns(response) end def test_mms_should_have_text mail = mail('sprint-text-01.mail') mms = MMS2R::Media.new(mail) assert_equal "2068765309", mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_equal 1, mms.media['text/plain'].size file = mms.media['text/plain'].first assert_equal true, File.exist?(file) assert_match(/\.txt$/, File.basename(file)) assert_equal "Tea Pot", IO.read(file) mms.purge end def test_mms_should_have_a_phone_number mail = mail('sprint-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier mms.purge end def test_should_have_simple_video mail = mail('sprint-video-01.mail') response = mock('response') body = mock('body') connection = mock('connection') response.expects(:content_type).twice.returns('video/quicktime') + response.expects(:body).returns(body) response.expects(:code).never Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection - connection.expects(:get).with( + connection.expects(:get2).with( kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } - ).once.returns([response, body]) + ).once.returns(response) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_not_nil mms.media['video/quicktime'] assert_equal 1, mms.media['video/quicktime'].size assert_equal "000_259e41e851be9b1d_1-0.mov", File.basename(mms.media['video/quicktime'][0]) mms.purge end def test_should_have_simple_image mail = mail('sprint-image-01.mail') mock_sprint_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_not_nil mms.media['image/jpeg'][0] assert_match(/001_2066c7013e7ca833_1-0.jpg$/, mms.media['image/jpeg'][0]) mms.purge end def test_collect_image_using_block mail = mail('sprint-image-01.mail') mock_sprint_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size file_array = nil mms.process do |k, v| file_array = v if (k == 'image/jpeg') assert_equal 1, file_array.size file = file_array.first assert_not_nil file = file_array.first assert_equal "001_2066c7013e7ca833_1-0.jpg", File.basename(file) end mms.purge end def test_process_internals_should_only_be_executed_once mail = mail('sprint-image-01.mail') mock_sprint_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size # second time through shouldn't go into the was_processed block mms.mail.expects(:parts).never mms.process{|k, v| } mms.purge end def test_should_have_two_images mail = mail('sprint-two-images-01.mail') response = mock('response') body = mock('body') connection = mock('connection') response.expects(:content_type).times(4).returns('image/jpeg') + response.expects(:body).twice.returns(body) response.expects(:code).never Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).twice.returns connection - connection.expects(:get).with( + connection.expects(:get2).with( kind_of(String), { "User-Agent" => MMS2R::Media::USER_AGENT } - ).twice.returns([response, body]) - - # response1 = mock('response1') - # body1 = mock('body1') - # connection1 = mock('connection1') - # response1.expects(:content_type).at_least_once.returns('image/jpeg') - # response1.expects(:code).never - # Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection1 - # connection1.expects(:get).with( - # kind_of(String), - # { "User-Agent" => MMS2R::Media::USER_AGENT } - # ).once.returns([response1, body1]) - - # response2 = mock('response2') - # body2 = mock('body2') - # connection2 = mock('connection2') - # response2.expects(:content_type).at_least_once.returns('image/jpeg') - # response2.expects(:code).never - # Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection2 - # connection2.expects(:get).with( - # kind_of(String), - # { "User-Agent" => MMS2R::Media::USER_AGENT } - # ).once.returns([response2, body2]) + ).twice.returns(response) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_equal 2, mms.media['image/jpeg'].size assert_not_nil mms.media['image/jpeg'][0] assert_not_nil mms.media['image/jpeg'][1] assert_match(/001_104058d23d79fb6a_1-0.jpg$/, mms.media['image/jpeg'][0]) assert_match(/001_104058d23d79fb6a_1-1.jpg$/, mms.media['image/jpeg'][1]) mms.purge end def test_image_should_be_missing # this test is questionable mail = mail('sprint-broken-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 0, mms.media.size mms.purge end def test_image_should_be_purged_from_content_server mail = mail('sprint-image-01.mail') mock_sprint_purged_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 0, mms.media.size mms.purge end def test_body_should_return_empty_when_there_is_no_user_text mail = mail('sprint-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal "", mms.body end def test_sprint_write_file mail = mock(:message_id => 'a') mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') mms = MMS2R::Media.new(mail, :process => :lazy) type = 'text/plain' content = 'foo' file = Tempfile.new('sprint') file.close type, file = mms.send(:sprint_write_file, type, content, file.path) assert_equal 'text/plain', type assert_equal content, IO.read(file) end def test_subject mail = mail('sprint-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal "", mms.subject end def test_new_subject mail = mail('sprint-new-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal "", mms.subject end end
monde/mms2r
e842600dd4dbba3ac59c7bd8dc1af3c75fc4bf0f
Refining the UTF-8 and making the gem Ruby 1.8.7, 1.9.2, 1.9.3, compatible.
diff --git a/Gemfile b/Gemfile index e9281ad..ee4f968 100644 --- a/Gemfile +++ b/Gemfile @@ -1,19 +1,20 @@ # -*- ruby -*- -source :gemcutter +source :rubygems gem "nokogiri" gem "mail" gem "exifr" +# gem "psych" group :development, :test do gem "rdoc" gem "rubyforge" gem "gemcutter" gem "hoe" gem "rcov" gem "test-unit", "=1.2.3" gem "mocha" end # vim: syntax=ruby diff --git a/Gemfile.lock b/Gemfile.lock index bf8e0ce..39b1bb3 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,46 +1,46 @@ GEM remote: http://rubygems.org/ specs: exifr (1.1.1) - gemcutter (0.7.0) - hoe (2.12.3) + gemcutter (0.7.1) + hoe (2.12.5) rake (~> 0.8) i18n (0.6.0) - json (1.6.1) - json_pure (1.6.1) - mail (2.3.0) + json (1.6.5) + json_pure (1.6.5) + mail (2.4.0) i18n (>= 0.4.0) mime-types (~> 1.16) treetop (~> 1.4.8) metaclass (0.0.1) mime-types (1.17.2) - mocha (0.10.0) + mocha (0.10.2) metaclass (~> 0.0.1) nokogiri (1.5.0) - polyglot (0.3.2) + polyglot (0.3.3) rake (0.9.2.2) rcov (0.9.11) - rdoc (3.11) + rdoc (3.12) json (~> 1.4) rubyforge (2.0.4) json_pure (>= 1.1.7) test-unit (1.2.3) hoe (>= 1.5.1) treetop (1.4.10) polyglot polyglot (>= 0.3.1) PLATFORMS ruby DEPENDENCIES exifr gemcutter hoe mail mocha nokogiri rcov rdoc rubyforge test-unit (= 1.2.3) diff --git a/History.txt b/History.txt index b983f5e..8dc58b3 100644 --- a/History.txt +++ b/History.txt @@ -1,401 +1,408 @@ +### 3.6.0 / 2012-01-19 (Agent 216 - assassin, master of infiltration and sabotage) + +* 1 major enhancement + * Ruby 1.8.7, 1.9.2, and 1.9.3 compatible +* 1 bug fix + * A fix for the utf-8 encoding issue with ruby 1.9.2 - minimul / Christian + ### 3.5.1 / 2011-12-11 (Mashed Potato Johnson - oldest living blues guitarist in the world) * 1 bug fix * A fix for the utf-8 encoding issue with ruby 1.9.2 - James McGrath ### 3.5.0 / 2011-12-01 (Dr. Milminiman Lamilim Swimwambli - Marriage expert) * 1 major bug fix * In Ruby 1.9.X MMS2R::Media::Sprint was not fetching content from Sprint's CDN correctly because the implementation of Net::HTTP in 1.9.X passes a User-Agent header of "Ruby" to which Sprint responds with a fake 500 - with help from James McGrath ### 3.4.1 / 2011-11-06 (Fatty Ding-Dongs, Dethklok foster child) * 2 major enhancements * Additional means to detect android, iphone, motorola, nokia, palm handsets * Additional known SMS/MMS domains mm.att.net, labwig.net, cdma.sasktel.com ### 3.4.0 / 2011-10-31 (Serveta Skwigelf, Skwisgaar's hot mom) * 2 major enhancements * regexp's in yaml configs are store as a ruby regexp and not a string that is evaled. * character encoding capability with 1.8 rubies and 1.9 rubies. ### 3.3.1 / 2011-01-01 (Reverend Aslaug Wartooth (deceased), Toki's dad) * 2 minor enhancements * new method #default_html returns the default html attachment * #body will return the default plain text, or default stripped html text ### 3.3.0 / 2010-12-31 (Charles Foster Offdensen - CFO, dethklok) * 1 major enhancement * MMS2R::Media::Sprint is now a module that is extended in for processing Sprint content rather than being child class of MMS2R::Media Extension is the strategy to use for overwriting template methods now * 1 minor enhancement * process new Sprint subject - Jason Hooper * new SaskTel mms/sms domain alias sasktel.com * new Virgin Mobile mms/sms domain alias yrmobl.com ### 3.2.0 / 2010-08-17 (Antonio "Tony" DiMarco Thunderbottom - bassist) * 3 minor enhancements * updated readme with latest sites known to use mms2r * bundler assimilated * loading rubygems only if it's required, like rake ### 3.1.0 / 2010-07-09 (Dick "Magic Ears" Knubbler - music producer) * 8 minor enhancements * Detects additional Bell/AT&T domain sbcglobal.net as a handset * Detects additional Virgin mobile domains pixmbl.com vmobl.com as a handset * Expanded mobile phone detection for handset makers by : Casio, Google Nexus One, LG Electronics, Motorola, Pantech, Qualcom, Samsung, Sprint, UTStarCom * EXIF Reader (exifr) is integral to MMS2R and is now a required gem * upgrade Mail to 2.2.5 * depend on latest gems * corrected example - Jason Hooper * added As Seen On The Internet to README that lists sites known to be using MMS2R in some fashion ### 3.0.1 / 2010-03-28 (Lavona Succuboso - leader of "Succuboso Explosion") * 1 minor enhancement * support for U.S. Cellular ### 3.0.0 / 2010-02-24 (General Crozier - Chairman of the Joint Chiefs of Staff) * 1 new feature * dependence upon Mail gem rather than TMail gem ### 2.4.1 / 2010-02-07 (Vater Orlaag - political and spiritual specialist) * 3 minor enhancements * make sure filename is free of new lines - laurynas * recognize HTC HERO200 as a smart phone * recognize HTC Eris as a smart phone ### 2.4.0 / 2009-12-20 (Dr. Nanemiltred Philtendrieden - specialist on celebrity death) * 1 new feature * replace Hpricot with Nokogiri for html parsing of Sprint data * 3 minor enhancements * smartphone identities stored in conf/mms2r_media.yml * identify Motorola Droid as a smartphone * identify T-Mobile Dash as a smartphone * use uuidtools for naming temp directories - kbaum ### 2.3.0 / 2009-08-30 (Snakes 'n' Barrels Greatest Hits) * 5 new features * detect smartphone status/type based on model metadata from jpeg and tiff exif data using exifr gem, access exif data with MMS2R::Media#exif * make MMS2R Rails gem packaging friendly with an init.rb - Scott Taylor, smtlaissezfaire * delegate missing methods to mms2r's tmail object so that mms2r behaves as if it were a tmail object - Sai Emrys, saizai * default_media can return an attachment of application content type - Brendan Lim, brendanlim * MMS2R.parse(raw_mail) convenience class method that parses and returns an mms2r from a mail file - saizai * 4 minor enhancements * make examples more 'mail' specific to enforce the fact that an mms is a multipart email - saizai * update for text in vzwpix.com default carrier message * detecting smartphone (blackberries and iphones for now) is more versatile from reading mail headers * expanded filtering of carrier advertising text in mms from smartphones ### 2.2.0 / 2009-01-04 (Rikki Kixx - owner of a franchise of rehab centers) * 3 new features * MMS2R::Media#is_mobile? best guess if the sender was a mobile device * MMS2R::Media#device_type? best guess of the mobile device type. Simple heuristics thus far for :blackberry :iphone :handset :unknown could be expanded for exif probing or additinal shifting of mail header * from array in conf/from.yml to provide granularity to determine carrier domain (caused by tmo.blackberry.net) * 4 minor enhancements * support for Virgin Canada messaging service vmobile.ca * support for text service messaging.sprintpcs.com * additional BlackBerry coverage from T-Mobile tmo.blackberry.net provider * legacy support for mobile.mycingular.com, pics.cingularme.com * 3 bug fixes * iPhone default subject - jesse dp http://rubyforge.org/tracker/?func=detail&atid=11789&aid=22951&group_id=3065 * add sprintpcs.com to pm.sprint.com aliases * fix OS X long filename issues - Matt Conway ### 2.1.3 / 2008-11-06 (Dr. Ramonolith Chesterfield - Military pharmaceutical psychotropic drug manufacturing expert * 1 minor enhancement * added mms.ae support ### 2.1.2 / 2008-10-21 (Toki's mom, Anja Wartooth) * 2 minor enhancments * Sprint subject update - jesse dp * Virgin Mobile support vmpix.com ### 2.1.1 / 2008-09-24 (Lavona Succuboso, Nathan Explosion uber-groupie) * 4 minor enhancments * Bell Canada support txt.bell.ca - Matt Conway / Snap My Life - http://github.com/wr0ngway, http://github.com/sml * Unicel support unicel.com - Michael DelGaudio * info2go.com support / Unicel * TELUS Corporation support mms.telusmobility.com, msg.telus.com * add test to check that gem builds correctly as a github gem * 1 bug fix * Iconv utf8 fix - Kai Kai ### 2.1.0 / 2008-07-30 (Dr. Gibbons – Birthday expert and Murderface expert) * 1 major enhancement: * opens up TMail for improved query method patterned code in MMS2R * 2 minor enhancements: * UK O2 support mediamessaging.o2.co.uk - Jeremy Wilkins * Write non text files with binary bit set on Windows - David Alm * source hosted on github: git clone git://github.com/monde/mms2r.git ### 2.0.5 / 2008-07-17 (Dr. Ralphus Galkensmelter - Psychological death expert) * Deal with Apple Mail multipart/appledouble - jesse dp ### 2.0.4 / 2008-04-28 (Mr. Selatcia - elder member of The Tribunal) * updated mms.vodacom4me.co.za Vodacom South Africa - Vijay Yellapragada * 1nbox.net / Idea cellular 1nbox.net - Vijay Yellapragada * mms.3ireland.ie / 3 Ireland - Vijay Yellapragada * mms.alltel.com / Alltel (reverted message.alltel.com) - Vijay Yellapragada * mms.mobileiam.ma / Maroc Telecom - Vijay Yellapragada * mms.mtn.co.za / MTM South Africa - Vijay Yellapragada * rci.rogers.com / Rogers of Canada - Vijay Yellapragada * mmsreply.t-mobile.co.uk / T-Mobile UK - Vijay Yellapragada * waw.plspictures.com / PLSPICTURES.COM mms hosting service ### 2.0.3 / 2008-04-15 (Enter Taxman - The 1040 MMS Form) * fix case when part is image/jpeg declared 'application/octet-stream' * trim dangling image/jpeg text from blackberry messages * file extensions added to filenames that are missing extensions in part headers * anonymize images in fixtures to reduce gem size * T-Mobile update - jesse dp * AT&T/T-Mobile Blackberrry update - Dave Myron ### 2.0.2 / 2008-02-22 (The Jomfru Brothers - proprietors of diefordethklok.com) * added support for mms.vodacom4me.co.za Vodacom South Africa - Jason Haruska * added support for bellsouth.net - Jason Haruska * added support for mms.mycricket.com * Improved Blackberry and iPhone suport - Jason Haruska * added :number key to configuration to provide rules for specifying alternative phone number location * return sender's phone number for mobile.indosat.net.id * return sender's phone number for mms.luxgsm.lu * return sender's phone number for mms.vodacom4me.co.za ### 2.0.1 / 2008-02-08 (Professor Jerry Gustav Munndig - Child control expert) * strip out common blackberry and iPhone signatures * handle carriers that use external mail services such as Yahoo! as the From address * Add support for mobile.indosat.net.id (and yahoo.co.id) - Jason Haruska * Add support for sms.sasktel.com - Jason Haruska ### 2.0.0 / 2008-01-23 (Skwisgaar Skwigelf - fastest guitarist alive) * added support for pxt.vodafone.net.nz PXT New Zealand * added support for mms.o2online.de O2 Germany * added support for orangemms.net Orange UK * added support for txt.att.net AT&T * added support for mms.luxgsm.lu LUXGSM S.A. * added support for mms.netcom.no NetCom (Norway) * added support for mms.three.co.uk Hutchison 3G UK Ltd * removed deprecated #get_number use #number * removed deprecated #get_subject use #subject * removed deprecated #get_body use #body * removed deprecated #get_media use #default_media * removed deprecated #get_text use #default_text * removed deprecated #get_attachment use #attachment * fixed error when Sprint content server responds 500 * better yaml configs * moved TMail dependency from Rails ActionMailer SVN to 'official' Gem * ::new greedily processes MMS unless otherwise specified as an initialize option :process => :lazy * logger moved to initialize option :logger => some_logger * testing using mocks and stubs instead of duck raped Net::HTTP * fixed typo in name of method #attachement to #attachment * fixed broken downloading of Sprint videos ### 1.1.12 / 2007-10-21 (Dr. Ronald von Moldenberg - Endorsement specialist) * fetch original images from Sprint content server (Layton Wedgeworth) * ignore Sprint messages when requested content has been purged from their content server ### 1.1.11 / 2007-10-20 (Dr. Armand Skagerakk Frederickshaven - Mythology expert) * minor fix for attachment_fu where it might call #path on the cgi temp file that is returned by get_attachment * renamed a_t_t_media.rb to att_media.rb to make it autotest happy * masthead.jpg misplaced in mms2r_t_mobile_media_ignore.yml (Layton Wedgeworth) * overridden SprintMedia#process failed to accept block (Layton Wedgeworth) * added method_deprecated to help mark methods that are going to be deprecated in preparation of 1.2.x release * #get_number marked deprecated, use #number instead * #get_subject marked deprecated, use #subject instead * #get_body marked deprecated, use #body instead * #get_text marked deprecated, use #default_text instead * #get_attachment marked deprecated, use #attachment instead * #get_media marked deprecated, use #default_media instead ### 1.1.10 / 2007-09-30 (Face Bones) * fixed a case for a nil match on From in the create method (Luke Francl) * added support for Alltel message.alltel.com (Ben Wood) ### 1.1.9 / 2007-09-08 (Rebecca Nightrod - controlling girlfriend of Nathan Explosion) * fixed broken support for act_as_attachment and attachment_fu ### 1.1.8 / 2007-09-08 (James Grishnack - Head of Behemoth Productions, producer of Blood Ocean) * Added support for Orange of France, Orange orange.fr (Julian Biard) * purge in the process block removed, purge must be called explicitly after processing to clean up extracted temporary media files. ### 1.1.7 / 2007-08-25 (Adam Nergal, friend of Skwisgaar, but not Pickles) * Added support for Orange of Poland, Orange mmsemail.orange.pl (Zbigniew Sobiecki) * Cleaned up documentation modifiers * Cleaned out non-Ruby code idioms ### 1.1.6 / 2007-08-11 (Mustakrakish, the Lake Troll part 2) * Redo of release mistake of 1.1.5 ### 1.1.5 / 2007-08-11 (Mustakrakish, the Lake Troll) * AT&T => mms.att.net not clearing out default "multimedia message" subject to nil (Will Jessup) * Ignore case on default subject for all carriers in corresponding conf/mms2r_XXX_media_subject.yml ### 1.1.4 / 2007-08-07 (Dr. Rockso) * AT&T => mms.att.net support (thanks Mike Chen and Dave Myron) * get_body returns nil when there is not user text (sorry Will!) ### 1.1.3 / 2007-07-10 (Charles Foster Ofdensen) * Helio support by Will Jessup * get_subject returns nil on default carrier subjects ### 1.1.2 / 2007-06-13 (Dethklok roadie #2) * placed versioned hpricot dependency in Hoe's extra_deps (an attempt to appease firebrigade gods or not cause Gem::RemoteInstallationCancelled whichever you prefer) ### 1.1.1 / 2007-06-11 (Dethklok roadie) * rescue rcov non-dependency in Rakefile to make firebrigade happy ### 1.1.0 / 2007-06-08 (Toki Wartooth) * get_body to return body text (Luke Francl) * get_subject returns "" for default subjects now * default subjects listed in yaml by carrier in conf directory * added granularity to Cingular, Sprint, and Verizon carrier services (Will Jessup) * refactored Sprint instance to process all media (Will Jessup + Mike) * optimized text transformations (Will Jessup) * properly handle ISO-8859-1 and UTF-8 text (Will Jessup) * autotest powers activate! (ZenTest autotest discovery enabled) * configuration file ignores, transforms, and subjects all store Regexp's * Put vendor Text::Format & TMail::Mail as an external subversion dependency to the 1.2 stable branch of Rails ActionMailer * added get_number method to return the phone number associated with this MMS * get_media and get_text attachment_fu helper return the largest piece of media of that type if the more than one exits in the media (Luke Francl) * added block support to process() method (Shane Vitarana) ### 1.0.7 / 2007-04-27 (Senator Stampingston) * patch submitted by Luke Francl * added a get_subject method that returns nil when any MMS has a default carrier subject * get_subject returns nil for '', 'Multimedia message', '(no subject)', 'You have new Picture Mail!' ### 1.0.6 / 2007-04-24 (Pickles the Drummer) * patch submitted by Luke Francl * added support for mms.dobson.net (Dobson aka Cellular One) (Luke) * DRY'd up unit tests (Luke) * added get_media instance method that returns first video or image as File (Luke) * File from get_media can be used by/with attachment_fu (Luke) * added get_text instance method that returns first non advertising text * File from get_text can be used by/with attachment_fu ### 1.0.5 / 2007-04-10 (William Murderface) * patch submitted by Luke Francl * made ignore_media? start its text check from the start of the file (Luke) * added new text transform for Verizon messages (Luke) * updated Nextel ignore conf (Luke) * added additional samples and tests for T-Mobile & Verizon (Luke) * cleaned up MMS2R::Media documentation * added Sprint broken image test for when media goes stale on their content server * fixed teardown typo in lots of plases * added tests for 4 three samples of unique variants of Sprint/Nextel text * 100% test coverage! ### 1.0.4 / 2007-04-09 (Metalocalypse) * fix teardown in test_mms2r_sprint.rb (shanesbrain.net) * clean up Net::HTTP in MMS2R::SprintMedia (shanesbrain.net) * added accessor MMS2R::Media.media_dir * fixed a nil issue with underlying tmp working dir * added exception handling around Net::HTTP in MMS2R::SprintMedia ### 1.0.3 / 2007-04-05 (Paper Cut) * Cleaned up packaging and errors in example found by Shane V. http://shanesbrain.net/ ### 1.0.2 / 2007-03-07 * Reorganized tests and fixtures * Added carriers: * Cingular => cingularme.com * Nextel => messaging.nextel.com * Verizon => vtext.com ### 1.0.1 / 2007-03-07 * Flubbed RubyForge release ... do not use this. ### 1.0.0 / 2007-03-06 * Birthday! * AT&T/Cingular => mmode.com * Cingular => mms.mycingular.com * Sprint => pm.sprint.com * Sprint => messaging.sprintpcs.com * T-Mobile => tmomail.net * Verizon => vzwpix.com diff --git a/Manifest.txt b/Manifest.txt index 334b4f2..ef08e0f 100644 --- a/Manifest.txt +++ b/Manifest.txt @@ -1,184 +1,186 @@ .gitignore Gemfile Gemfile.lock History.txt Manifest.txt README.TMail.txt README.txt Rakefile conf/1nbox.net.yml conf/aliases.yml conf/bellsouth.net.yml conf/from.yml conf/mediamessaging.o2.co.uk.yml conf/messaging.nextel.com.yml conf/mms.3ireland.ie.yml conf/mms.ae.yml conf/mms.alltel.com.yml conf/mms.att.net.yml conf/mms.dobson.net.yml conf/mms.luxgsm.lu.yml conf/mms.mobileiam.ma.yml conf/mms.mtn.co.za.yml conf/mms.mycricket.com.yml conf/mms.myhelio.com.yml conf/mms.netcom.no.yml conf/mms.o2online.de.yml conf/mms.three.co.uk.yml conf/mms.uscc.net.yml conf/mms.vodacom4me.co.za.yml conf/mms2r_media.yml conf/mobile.indosat.net.id.yml conf/msg.telus.com.yml conf/orangemms.net.yml conf/pm.sprint.com.yml conf/pxt.vodafone.net.nz.yml conf/rci.rogers.com.yml conf/sms.sasktel.com.yml conf/tmomail.net.yml conf/txt.bell.ca.yml conf/unicel.com.yml conf/vmpix.com.yml conf/vzwpix.com.yml conf/waw.plspictures.com.yml dev_tools/anonymizer.rb dev_tools/debug_sprint_nokogiri_parsing.rb init.rb lib/ext/mail.rb lib/ext/object.rb lib/mms2r.rb lib/mms2r/media.rb lib/mms2r/media/sprint.rb mms2r.gemspec test/fixtures/1nbox-2images-01.mail test/fixtures/1nbox-2images-02.mail test/fixtures/1nbox-2images-03.mail test/fixtures/1nbox-2images-04.mail test/fixtures/3ireland-mms-01.mail test/fixtures/ad_new.txt test/fixtures/alltel-image-01.mail test/fixtures/alltel-mms-01.mail test/fixtures/alltel-mms-03.mail test/fixtures/apple-double-image-01.mail test/fixtures/att-blackberry-02.mail test/fixtures/att-blackberry.mail test/fixtures/att-image-01.mail test/fixtures/att-image-02.mail test/fixtures/att-iphone-01.mail test/fixtures/att-iphone-02.mail test/fixtures/att-iphone-03.mail test/fixtures/att-text-01.mail test/fixtures/bell-canada-image-01.mail test/fixtures/cingularme-text-01.mail test/fixtures/cingularme-text-02.mail test/fixtures/dici_un_mois_georgie.txt test/fixtures/dobson-image-01.mail test/fixtures/dot.jpg test/fixtures/generic.mail test/fixtures/handsets.yml test/fixtures/helio-image-01.mail test/fixtures/helio-message-01.mail test/fixtures/iconv-fr-text-01.mail test/fixtures/indosat-image-01.mail test/fixtures/indosat-image-02.mail test/fixtures/info2go-image-01.mail +test/fixtures/invalid-byte-seq-outlook.mail test/fixtures/iphone-image-01.mail test/fixtures/iphone-image-02.mail test/fixtures/luxgsm-image-01.mail test/fixtures/maroctelecom-france-mms-01.mail test/fixtures/mediamessaging_o2_co_uk-image-01.mail test/fixtures/mmode-image-01.mail test/fixtures/mms.ae-image-01.mail test/fixtures/mms.mycricket.com-pic-and-text.mail test/fixtures/mms.mycricket.com-pic.mail test/fixtures/mmsreply.t-mobile.co.uk-text-image-01.mail test/fixtures/mobile.mycingular.com-text-01.mail test/fixtures/mtn-southafrica-mms.mail test/fixtures/mycingular-image-01.mail test/fixtures/netcom-image-01.mail test/fixtures/nextel-image-01.mail test/fixtures/nextel-image-02.mail test/fixtures/nextel-image-03.mail test/fixtures/nextel-image-04.mail test/fixtures/o2-de-image-01.mail test/fixtures/orange-uk-image-01.mail test/fixtures/orangefrance-text-and-image.mail test/fixtures/orangepoland-text-01.mail test/fixtures/orangepoland-text-02.mail test/fixtures/pics.cingularme.com-image-01.mail test/fixtures/pxt-image-01.mail test/fixtures/rogers-canada-mms-01.mail test/fixtures/sasktel-image-01.mail test/fixtures/sprint-blackberry-01.mail test/fixtures/sprint-broken-image-01.mail test/fixtures/sprint-image-01.mail test/fixtures/sprint-new-image-01.mail test/fixtures/sprint-pcs-text-01.mail test/fixtures/sprint-purged-image-01.mail test/fixtures/sprint-text-01.mail test/fixtures/sprint-two-images-01.mail test/fixtures/sprint-video-01.mail test/fixtures/sprint.mov test/fixtures/suncom-blackberry.mail test/fixtures/telus-image-01.mail test/fixtures/three-uk-image-01.mail test/fixtures/tmo.blackberry.net-image-01.mail test/fixtures/tmobile-blackberry-02.mail test/fixtures/tmobile-blackberry.mail test/fixtures/tmobile-image-01.mail test/fixtures/tmobile-image-02.mail test/fixtures/unicel-image-01.mail test/fixtures/us-cellular-image-01.mail test/fixtures/verizon-blackberry.mail test/fixtures/verizon-image-01.mail test/fixtures/verizon-image-02.mail test/fixtures/verizon-image-03.mail test/fixtures/verizon-text-01.mail test/fixtures/verizon-video-01.mail test/fixtures/virgin-mobile-image-01.mail test/fixtures/virgin.ca-text-01.mail test/fixtures/vodacom4me-co-za-01.mail test/fixtures/vodacom4me-co-za-02.mail test/fixtures/vodacom4me-southafrica-mms-01.mail test/fixtures/vodacom4me-southafrica-mms-04.mail test/fixtures/vtext-text-01.mail test/fixtures/vzwpix.com-image-01.mail test/fixtures/waw.plspictures.com-image-01.mail test/test_1nbox_net.rb test/test_bell_canada.rb test/test_bellsouth_net.rb test/test_helper.rb +test/test_invalid_byte_seq_outlook.rb test/test_mediamessaging_o2_co_uk.rb test/test_messaging_nextel_com.rb test/test_messaging_sprintpcs_com.rb test/test_mms2r_media.rb test/test_mms_3ireland_ie.rb test/test_mms_ae.rb test/test_mms_alltel_com.rb test/test_mms_att_net.rb test/test_mms_dobson_net.rb test/test_mms_luxgsm_lu.rb test/test_mms_mobileiam_ma.rb test/test_mms_mtn_co_za.rb test/test_mms_mycricket_com.rb test/test_mms_myhelio_com.rb test/test_mms_netcom_no.rb test/test_mms_o2online_de.rb test/test_mms_three_co_uk.rb test/test_mms_uscc_net.rb test/test_mms_vodacom4me_co_za.rb test/test_mobile_indosat_net_id.rb test/test_msg_telus_com.rb test/test_orangemms_net.rb test/test_pm_sprint_com.rb test/test_pxt_vodafone_net_nz.rb test/test_rci_rogers_com.rb test/test_sms_sasktel_com.rb test/test_sprint.rb test/test_tmomail_net.rb test/test_unicel_com.rb test/test_vmpix_com.rb test/test_vzwpix_com.rb test/test_waw_plspictures_com.rb vendor/plugins/mms2r/lib/autotest/discover.rb vendor/plugins/mms2r/lib/autotest/mms2r.rb diff --git a/Rakefile b/Rakefile index 3456fa8..0902222 100644 --- a/Rakefile +++ b/Rakefile @@ -1,44 +1,45 @@ # -*- ruby -*- begin require 'hoe' rescue LoadError require 'rubygems' require 'hoe' end + $LOAD_PATH.unshift File.join(File.dirname(__FILE__), "lib") require 'mms2r' require 'rake' Hoe.plugin :bundler Hoe.spec('mms2r') do |p| p.version = MMS2R::Media::VERSION p.rubyforge_name = 'mms2r' p.author = ['Mike Mondragon'] p.email = ['[email protected]'] p.summary = 'Extract user media from MMS (and not carrier cruft)' p.description = p.paragraphs_of('README.txt', 2..5).join("\n\n") p.url = p.paragraphs_of('README.txt', 1).first.strip p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n") p.readme_file = 'README.txt' p.history_file = 'History.txt' p.extra_deps << ['nokogiri', '>= 1.4.4'] p.extra_deps << ['mail', '>= 2.2.10'] p.extra_deps << ['uuidtools', '>= 2.1.1'] p.extra_deps << ['exifr', '>= 1.0.3'] p.clean_globs << 'coverage' end begin require 'rcov/rcovtask' Rcov::RcovTask.new do |rcov| rcov.pattern = 'test/**/test_*.rb' rcov.verbose = true rcov.rcov_opts << "--exclude rcov.rb" end rescue task :rcov => :check_dependencies end # vim: syntax=Ruby diff --git a/lib/mms2r.rb b/lib/mms2r.rb index e649900..b3808d8 100644 --- a/lib/mms2r.rb +++ b/lib/mms2r.rb @@ -1,76 +1,82 @@ #-- # Copyright (c) 2007-2010 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ module MMS2R ## # A hash of MMS2R processors keyed by MMS carrier domain. CARRIERS = {} ## # Registers a class as a processor for a MMS domain. Should only be # used in special cases such as MMS2R::Media::Sprint for 'pm.sprint.com' def self.register(domain, processor_class) MMS2R::CARRIERS[domain] = processor_class end ## # A hash of file extensions for common mime-types EXT = { 'text/plain' => 'text', 'text/plain' => 'txt', 'text/html' => 'html', 'image/png' => 'png', 'image/gif' => 'gif', 'image/jpeg' => 'jpeg', 'image/jpeg' => 'jpg', 'video/quicktime' => 'mov', 'video/3gpp2' => '3g2' } class MMS2R::Media ## # MMS2R library version - VERSION = '3.5.1' + VERSION = '3.6.0' ## # Spoof User-Agent, primarily for the Sprint CDN USER_AGENT = "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C28 Safari/419.3" end # Simple convenience function to make it a one-liner: # MMS2R.parse raw_mail or MMS2R.parse File.load(raw_mail) # Combined w/ the method_missing delegation, this should behave as an enhanced Mail object, more or less. def self.parse raw_mail mail = Mail.new raw_mail MMS2R::Media.new(mail) end end %W{ yaml mail fileutils pathname tmpdir yaml digest/sha1 iconv exifr }.each do |g| begin require g rescue LoadError require 'rubygems' require g end end -# HAX to not deal with Psych YAML parser in Ruby >= 1.9 -#YAML::ENGINE.yamler= 'syck' if defined?(YAML::ENGINE) +if RUBY_VERSION >= "1.9" + begin + require 'psych' + YAML::ENGINE.yamler= 'syck' if defined?(YAML::ENGINE) + rescue LoadError + end +end + require File.join(File.dirname(__FILE__), 'ext/mail') require File.join(File.dirname(__FILE__), 'ext/object') require File.join(File.dirname(__FILE__), 'mms2r/media') require File.join(File.dirname(__FILE__), 'mms2r/media/sprint') MMS2R.register('pm.sprint.com', MMS2R::Media::Sprint) diff --git a/lib/mms2r/media.rb b/lib/mms2r/media.rb index a9a1621..fdd4fac 100644 --- a/lib/mms2r/media.rb +++ b/lib/mms2r/media.rb @@ -1,839 +1,844 @@ #-- # Copyright (c) 2007-2010 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ ## # = Synopsis # # MMS2R is a library to collect media files from MMS messages. MMS messages # are multipart emails and mobile carriers often inject branding into these # messages. MMS2R strips the advertising from an MMS leaving the actual user # generated media. # # The Tracker for MMS2R is located at # http://rubyforge.org/tracker/?group_id=3065 # Please submit bugs and feature requests using the Tracker. # # If MMS from a carrier not known by MMS2R is encountered please submit a # sample to the author for inclusion in this project. # # == Stand Alone Example # # begin # require 'mms2r' # rescue LoadError # require 'rubygems' # require 'mms2r' # end # mail = Mail.read("sample-MMS.file") # mms = MMS2R::Media.new(mail) # subject = mms.subject # number = mms.number # file = mms.default_media # mms.purge # # == Rails ActionMailer#receive w/ AttachmentFu Example # # def receive(mail) # mms = MMS2R::Media.new(mail) # picture = Picture.new # picture is an attachemnt_fu model # picture.title = mms.subject # picture.uploaded_data = mms.default_media # picture.save! # mms.purge # end # # == More Examples # # See the README.txt file for more examples # # == Built In Configuration # # A custom configuration can be created for processing the MMS from carriers # that are not currently known by MMS2R. In the conf/ directory create a # YAML file named by combining the domain name of the MMS sender plus a .yml # extension. For instance the configuration of senders from AT&T's cellular # service with a Sender pattern of [email protected] have a configuration # named conf/mms.att.net.yml # # The YAML configuration contains a Hash with instructions for determining what # is content generated by the user and what is content inserted by the carrier. # # The root hash itself has two hashes under the keys 'ignore' and 'transform', # and an array under the 'number' key. # Each hash is itself keyed by mime-type. The value pointed to by the mime-type # key is an array. The ignore arrays are first inspected as regular expressions # else are used as a equality for a string filename. Ignores # work by filename # for the multi-part of the MMS that is being inspected. The array pointed to # by the 'number' key represents an alternate mail header where the sender's # number can be found with a regular expression and replacement value for a # gsub. # # The transform arrays are themselves an array of two element arrays. The elements # are regexp parameters for gsub. # # Ignore instructions are honored first then transform instructions. In the sample, # masthead.jpg is ignored as a regular expression, and spacer.gif is ignored as a # filename comparison. The transform has a match and a replacement, see the gsub # documentation for more information about match and replace. # # -- # ignore: # image/jpeg: # - /^masthead.jpg$/i # image/gif: # - spacer.gif # text/plain: # - /\AThis message was sent using PIX-FLIX Messaging service from .*/m # transform: # text/plain: # - - /\A(.+?)\s+This message was sent using PIX-FLIX Messaging .*/m # - "\1" # number: # - from # - /^([^\s]+)\s.*/ # - "\1" # # Carriers often provide their services under many different domain names. # The conf/aliases.yml is a YAML file with a hash that maps alternative or # legacy carrier names to the most common name of their service. For example # in terms of MMS2R txt.att.net is an alias for mms.att.net. Therefore when # an MMS with a Sender of txt.att.net is processed MMS2R will use the # mms.att.net configuration to process the message. module MMS2R class MMS2R::Media # Pass off everything we don't do to the Mail object # TODO: refactor to explicit addition a la http://blog.jayfields.com/2008/02/ruby-replace-methodmissing-with-dynamic.html def method_missing method, *args, &block mail.send method, *args, &block end ## # Mail object that the media files were derived from. attr_reader :mail ## # media returns the hash of media. The media hash is keyed by mime-type # such as 'text/plain' and the value mapped to the key is an array of # media that are of that type. attr_reader :media ## # Carrier is the domain name of the carrier. If the carrier is not known # the carrier will be set to 'mms2r.media' attr_reader :carrier ## # Base working dir where media for a unique mms message are dropped attr_reader :media_dir ## # Determine if return-path or from is going to be used to desiginate the # origin carrier. If the domain in the From header is listed in # conf/from.yaml then that is the carrier domain. Else if there is a # Return-Path header its address's domain is the carrier doamin, else # use From header's address domain. def self.domain(mail) return_path = case when mail.return_path mail.return_path ? mail.return_path.split('@').last : '' else '' end from_domain = case when mail.from && mail.from.first mail.from.first.split('@').last else '' end f = File.expand_path(File.join(self.conf_dir(), "from.yml")) from = YAML::load_file(f) ret = case when from.include?(from_domain) from_domain when return_path.present? return_path else from_domain end ret end ## # Initialize a new MMS2R::Media comprised of a mail. # # Specify options to initialize with: # :logger => some_logger for logging # :process => :lazy, for non-greedy processing upon initialization # # #process will have to be called explicitly if the lazy process option # is chosen. def initialize(mail, opts={}) @mail = mail @logger = opts[:logger] log("#{self.class} created", :info) @carrier = self.class.domain(mail) @dir_count = 0 sha = Digest::SHA1.hexdigest("#{@carrier}-#{Time.now.to_i}-#{rand}") @media_dir = File.expand_path( File.join(self.tmp_dir(), "#{self.safe_message_id(@mail.message_id)}_#{sha}")) @media = {} @was_processed = false @number = nil @subject = nil @body = nil @exif = nil @default_media = nil @default_text = nil @default_html = nil f = File.expand_path(File.join(self.conf_dir(), "aliases.yml")) @aliases = YAML::load_file(f) conf = "#{@aliases[@carrier] || @carrier}.yml" f = File.expand_path(File.join(self.conf_dir(), conf)) c = File.exist?(f) ? YAML::load_file(f) : {} @config = self.class.initialize_config(c) processor_module = MMS2R::CARRIERS[@carrier] extend processor_module if processor_module lazy = (opts[:process] == :lazy) rescue false self.process() unless lazy end ## # Get the phone number associated with this MMS if it exists. The value # returned is simplistic, it is just the user name of the from address # before the @ symbol. Validation of the number is left to you. Most # carriers are using the real phone number as the username. def number unless @number params = config['number'] if params && params.any? && (header = mail.header[params[0]]) @number = header.to_s.gsub(params[1], params[2]) end if @number.nil? || @number.blank? @number = mail.from.first.split(/@|\//).first rescue "" end end @number end ## # Return the Subject for this message, returns "" for default carrier # subject such as 'Multimedia message' for ATT&T carrier. def subject unless @subject subject = mail.subject.strip rescue "" ignores = config['ignore']['text/plain'] if ignores && ignores.detect{|s| s == subject} @subject = "" else @subject = transform_text('text/plain', subject).last end end @subject end # Convenience method that returns a string including all the text of the # default text/plain file found. If the plain text is blank then it returns # stripped down version of the title and body of default text/html. Returns # empty string if no body text is found. def body text_file = default_text @body = text_file ? IO.readlines(text_file.path).join.strip : "" - ic = Iconv.new('UTF-8//IGNORE', 'UTF-8') - @body = ic.iconv(@body) + @body.force_encoding("ISO-8859-1") if RUBY_VERSION >= "1.9" && @body.encoding == "ASCII-8BIT" + + begin + ic = Iconv.new('UTF-8', 'ISO-8859-1' ) + @body = ic.iconv(@body) + @body << ic.iconv(nil) + ic.close + rescue Exception => e + end + if @body.blank? && html_file = default_html html = Nokogiri::HTML(IO.read(html_file.path)) @body = (html.xpath("//head/title").map(&:text) + html.xpath("//body/*").map(&:text)).join(" ") end @body end # Returns a File with the most likely candidate for the user-submitted # media. Given that most MMS messages only have one file attached, this # method will try to return that file. Singleton methods are added to # the File object so it can be used in place of a CGI upload (local_path, # original_filename, size, and content_type) such as in conjunction with # AttachementFu. The largest file found in terms of bytes is returned. # # Returns nil if there are not any video or image Files found. def default_media @default_media ||= attachment(['video', 'image', 'application', 'text']) end # Returns a File with the most likely candidate that is text, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_text @default_text ||= attachment(['text/plain']) end # Returns a File with the most likely candidate that is html, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_html @default_html ||= attachment(['text/html']) end ## # process is a template method and collects all the media in a MMS. # Override helper methods to this template to clean out advertising and/or # ignore media that are advertising. This method should not be overridden # unless there is an extreme special case in processing the media of a MMS # (like Sprint) # # Helper methods for the process template: # * ignore_media? -- true if the media contained in a part should be ignored. # * process_media -- retrieves media to temporary file, returns path to file. # * transform_text -- called by process_media, strips out advertising. # * temp_file -- creates a temporary filepath based on information from the part. # # Block support: # Call process() with a block to automatically iterate through media. # For example, to process and receive only media of video type: # mms.process do |media_type, file| # results << file if media_type =~ /video/ # end # # note: purge must be explicitly called to remove the media files # mms2r extracts from an mms message. def process() # :yields: media_type, file unless @was_processed log("#{self.class} processing", :info) parts = mail.multipart? ? mail.parts : [mail] # Double check for multipart/related, if it exists replace it with its # children parts. Do this twice as multipart/alternative can have # children and we want to fold everything down for i in 1..2 flat = [] parts.each do |p| if p.multipart? p.parts.each {|mp| flat << mp } else flat << p end end parts = flat.dup end # get to work parts.each do |p| t = p.part_type? unless ignore_media?(t,p) t,f = process_media(p) add_file(t,f) unless t.nil? || f.nil? end end @was_processed = true end # when process acts upon a block if block_given? media.each do |k, v| yield(k, v) end end end ## # Helper for process template method to determine if media contained in a # part should be ignored. Producers should override this method to return # true for media such as images that are advertising, carrier logos, etc. # See the ignore section in the discussion of the built-in configuration. def ignore_media?(type, part) ignores = config['ignore'][type] || [] ignore = ignores.detect{ |test| filename?(part) == test} ignore ||= ignores.detect{ |test| filename?(part) =~ test if test.is_a?(Regexp) } ignore ||= ignores.detect{ |test| part.body.decoded.strip =~ test if test.is_a?(Regexp) } ignore ||= (part.body.decoded.strip.size == 0 ? true : nil) ignore.nil? ? false : true end ## # Helper for process template method to decode the part based on its type # and write its content to a temporary file. Returns path to temporary # file that holds the content. Parts with a main type of text will have # their contents transformed with a call to transform_text # # Producers should only override this method if the parts of the MMS need # special treatment besides what is expected for a normal mime part (like # Sprint). # # Returns a tuple of content type, file path def process_media(part) # Mail body auto-magically decodes quoted # printable for text/html type. file = temp_file(part) if part.part_type? =~ /^text\// || part.part_type? == 'application/smil' type, content = transform_text_part(part) mode = 'wb' else if part.part_type? == 'application/octet-stream' type = type_from_filename(filename?(part)) else type = part.part_type? end content = part.body.decoded mode = 'wb' # open with binary bit for Windows for non text end return type, nil if content.nil? || content.empty? log("#{self.class} writing file #{file}", :info) File.open(file, mode){ |f| f.write(content) } return type, file end ## # Helper for process_media template method to transform text. # See the transform section in the discussion of the built-in # configuration. def transform_text(type, text, original_encoding = 'ISO-8859-1') return type, text if !config['transform'] || !(transforms = config['transform'][type]) - if RUBY_VERSION < "1.9" - #convert to UTF-8 - begin - c = Iconv.new('UTF-8', original_encoding ) - utf_t = c.iconv(text) - rescue Exception => e - utf_t = text - end - else - utf_t = text.encoding == "ASCII-8BIT" ? text.force_encoding("ISO-8859-1").encode("UTF-8") : text + begin + ic = Iconv.new('UTF-8', original_encoding ) + utf_t = ic.iconv(text) + utf_t << ic.iconv(nil) + ic.close + rescue Exception => e + utf_t = text end transforms.each do |transform| next unless transform.size == 2 p = transform.first r = transform.last utf_t = utf_t.gsub(p, r) rescue utf_t end return type, utf_t end ## # Helper for process_media template method to transform text. def transform_text_part(part) type = part.part_type? text = part.body.decoded.strip transform_text(type, text) end ## # Helper for process template method to name a temporary filepath based on # information in the part. This version attempts to honor the name of the # media as labeled in the part header and creates a unique temporary # directory for writing the file so filename collision does not occur. # Consumers of this method expect the directory structure to the file # exists, if the method is overridden it is mandatory that this behavior is # retained. def temp_file(part) file_name = filename?(part) File.expand_path(File.join(msg_tmp_dir(),File.basename(file_name))) end ## # Purges the unique MMS2R::Media.media_dir directory created # for this producer and all of the media that it contains. def purge() log("#{self.class} purging #{@media_dir} and all its contents", :info) FileUtils.rm_rf(@media_dir) end ## # Helper to add a file to the media hash. def add_file(type, file) media[type] = [] unless media[type] media[type] << file end ## # Helper to temp_file to create a unique temporary directory that is a # child of tmp_dir This version is based on the message_id of the mail. def msg_tmp_dir() @dir_count += 1 dir = File.expand_path(File.join(@media_dir, "#{@dir_count}")) FileUtils.mkdir_p(dir) dir end ## # returns a filename declared for a part, or a default if its not defined def filename?(part) name = part.filename if (name.nil? || name.empty?) if part.content_id && (matched = /^<(.+)>$/.match(part.content_id)) name = matched[1] else name = "#{Time.now.to_f}.#{self.default_ext(part.part_type?)}" end end # FIXME FWIW, janky look for dot extension 1 to 4 chars long name = (name =~ /\..{1,4}$/ ? name : "#{name}.#{self.default_ext(part.part_type?)}").strip # handle excessively large filenames if name.size > 255 ext = File.extname(name) base = File.basename(name, ext) name = "#{base[0, 255 - ext.size]}#{ext}" end name end def aliases @aliases end ## # Best guess of the mobile device type. Simple heuristics thus far by # inspecting mail headers and jpeg/tiff exif metadata, and file name. # Known smart phone types thus far are # # * :blackberry # * :dash # * :droid # * :htc # * :iphone # * :lge # * :motorola # * :nokia # * :palm # * :pantech # * :samsung # # If the message is from a carrier known to MMS2R, and not a smart phone # its type is returned as :handset # Otherwise device type is :unknown def device_type? file = attachment(['image']) if file original = file.original_filename @exif = case original when /\.je?pg$/i EXIFR::JPEG.new(file) when /\.tiff?$/i EXIFR::TIFF.new(file) end if @exif models = config['device_types']['models'] rescue {} models.each do |type, regex| return type if @exif.model =~ regex end makes = config['device_types']['makes'] rescue {} makes.each do |type, regex| return type if @exif.make =~ regex end software = config['device_types']['software'] rescue {} software.each do |type, regex| return type if @exif.software =~ regex end end end headers = config['device_types']['headers'] rescue {} headers.keys.each do |header| - if mail.header[header.downcase] + if mail.header[header] # headers[header] refers to a hash of smart phone types with regex values # that if they match, the header signals the type should be returned headers[header].each do |type, regex| - return type if mail.header[header.downcase].decoded =~ regex - field = mail.header.fields.detect { |field| field.name.downcase == header.downcase } + return type if mail.header[header].decoded =~ regex + field = mail.header.fields.detect { |field| field.name == header } return type if field && field.to_s =~ regex end end end file = attachment(['image']) if file original_filename = file.original_filename filenames = config['device_types']['filenames'] rescue {} filenames.each do |type, regex| return type if original_filename =~ regex end end file = attachment(['video']) if file original_filename = file.original_filename filenames = config['device_types']['filenames'] rescue {} filenames.each do |type, regex| return type if original_filename =~ regex end end boundary = mail.boundary boundaries = config['device_types']['boundary'] rescue {} boundaries.each do |type, regex| return type if boundary =~ regex end return :handset if File.exist?( File.expand_path( File.join(self.conf_dir, "#{self.aliases[self.carrier] || self.carrier}.yml") ) ) :unknown end ## # exif object on default image from exifr gem def exif device_type? unless @exif @exif end ## # The source of the MMS was some sort of mobile or smart phone def is_mobile? self.device_type? != :unknown end ## # Get the temporary directory where media files are written to. def self.tmp_dir @@tmp_dir ||= File.expand_path(File.join(Dir.tmpdir, (ENV['USER'].nil? ? '':ENV['USER']), 'mms2r')) end ## # Set the temporary directory where media files are written to. def self.tmp_dir=(d) @@tmp_dir=d end ## # Get the directory where conf files are stored. def self.conf_dir @@conf_dir ||= File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'conf')) end ## # Set the directory where conf files are stored. def self.conf_dir=(d) @@conf_dir=d end ## # Helper to create a safe directory path element based on the mail message # id. def self.safe_message_id(mid) mid.nil? ? "#{Time.now.to_i}" : mid.gsub(/\$|<|>|@|\./, "") end ## # Returns a default file extension based on a content type def self.default_ext(content_type) if MMS2R::EXT[content_type] MMS2R::EXT[content_type] elsif content_type content_type.split('/').last end end ## # Joins the generic mms2r configuration with the carrier specific # configuration. def self.initialize_config(c) f = File.expand_path(File.join(self.conf_dir(), "mms2r_media.yml")) conf = YAML::load_file(f) conf['ignore'] ||= {} unless conf['ignore'] conf['transform'] = {} unless conf['transform'] conf['number'] = [] unless conf['number'] return conf unless c kinds = ['ignore', 'transform'] kinds.each do |kind| if c[kind] c[kind].each do |type,array| conf[kind][type] = [] unless conf[kind][type] conf[kind][type] += array end end end conf['number'] = c['number'] if c['number'] conf end def log(message, level = :info) @logger.send(level, message) unless @logger.nil? end ## # convenience accessor for self.class.conf_dir def conf_dir self.class.conf_dir end ## # convenience accessor for self.class.conf_dir def tmp_dir self.class.tmp_dir end ## # convenience accessor for self.class.default_ext def default_ext(type) self.class.default_ext(type) end ## # convenience accessor for self.class.safe_message_id def safe_message_id(message_id) self.class.safe_message_id(message_id) end ## # convenience accessor for self.class.initialize_confg def initialize_config(config) self.class.initialize_config(config) end private ## # accessor for the config def config @config end ## # guess content type from filename def type_from_filename(filename) ext = filename.split('.').last ent = MMS2R::EXT.detect{|k,v| v == ext} ent.nil? ? nil : ent.first end ## # used by #default_media and #text to return the biggest attachment type # listed in the types array def attachment(types) # get all the files that are of the major types passed in files = [] types.each do |type| media.keys.find_all{|k| type.include?("/") ? k == type : k.index(type) == 0 }.each do |key| files += media[key] end end return nil if files.empty? # set temp holders file = nil # explicitly declare the file and size size = 0 mime_type = nil #get the largest file files.each do |path| if File.size(path) > size size = File.size(path) file = File.new(path) media.each do |type,_files| mime_type = type if _files.detect{ |_path| _path == path } end end end return nil if file.nil? # These singleton methods implement the interface necessary to be used # as a drop-in replacement for files uploaded with CGI.rb. # This helps if you want to use the files with, for example, # attachment_fu. def file.local_path self.path end def file.original_filename File.basename(self.path) end def file.size File.size(self.path) end # this one is kind of confusing because it needs a closure. class << file self end.send(:define_method, :content_type) { mime_type } file end end end diff --git a/test/fixtures/invalid-byte-seq-outlook.mail b/test/fixtures/invalid-byte-seq-outlook.mail new file mode 100644 index 0000000..b484103 --- /dev/null +++ b/test/fixtures/invalid-byte-seq-outlook.mail @@ -0,0 +1,342 @@ +Delivered-To: [email protected] +Received: by 10.52.184.102 with SMTP id et6cs208438vdc; + Mon, 16 Jan 2012 14:19:35 -0800 (PST) +Received: by 10.180.20.69 with SMTP id l5mr17988972wie.19.1326752373488; + Mon, 16 Jan 2012 14:19:33 -0800 (PST) +Return-Path: <[email protected]> +Received: from mail-wi0-f172.toogle.com (mail-wi0-f172.toogle.com [209.85.212.172]) + by mx.toogle.com with ESMTPS id c7si13165326wia.5.2012.01.16.14.19.32 + (version=TLSv1/SSLv3 cipher=OTHER); + Mon, 16 Jan 2012 14:19:33 -0800 (PST) +Received-SPF: neutral (toogle.com: 209.85.212.172 is neither permitted nor denied by best guess record for domain of [email protected]) client-ip=209.85.212.172; +Authentication-Results: mx.toogle.com; spf=neutral (toogle.com: 209.85.212.172 is neither permitted nor denied by best guess record for domain of [email protected]) [email protected] +Received: by wics10 with SMTP id s10so1698315wic.31 + for <[email protected]>; Mon, 16 Jan 2012 14:19:32 -0800 (PST) +Received: by 10.180.73.72 with SMTP id j8mr12775876wiv.2.1326752372616; + Mon, 16 Jan 2012 14:19:32 -0800 (PST) +X-Forwarded-To: [email protected] +X-Forwarded-For: [email protected] [email protected] +Delivered-To: [email protected] +Received: by 10.216.22.196 with SMTP id t46cs153584wet; + Mon, 16 Jan 2012 14:19:31 -0800 (PST) +Received: by 10.236.168.37 with SMTP id j25mr19473152yhl.92.1326752370735; + Mon, 16 Jan 2012 14:19:30 -0800 (PST) +Return-Path: <[email protected]> +Received: from barracuda.ngSmith.com (barracuda.ngSmith.com. [192.168.97.98]) + by mx.toogle.com with ESMTP id i66si8419543yhn.66.2012.01.16.14.19.28; + Mon, 16 Jan 2012 14:19:30 -0800 (PST) +Received-SPF: pass (toogle.com: best guess record for domain of [email protected] designates 192.168.97.98 as permitted sender) client-ip=192.168.97.98; +X-ASG-Debug-ID: 1326752367-0199b2096162000001-x7cFak +Received: from Mail.NGSmith.com (legacy.ngSmith.com [192.168.0.61]) by barracuda.ngSmith.com with ESMTP id f6DuStHCxnYrGzVR for <[email protected]>; Mon, 16 Jan 2012 16:19:27 -0600 (CST) +X-Barracuda-Envelope-From: [email protected] +Received: from MSPEXCH1.ngSmith.com ([fe80::ecf7:ebc1:c6af:b594]) by + MSPEXCH2.ngSmith.com ([fe80::4106:cc1:bb08:dd9f%15]) with mapi id + 14.01.0339.001; Mon, 16 Jan 2012 16:19:27 -0600 +From: Aaron Doe <[email protected]> +X-Barracuda-Apparent-Source-IP: fe80::ecf7:ebc1:c6af:b594 +To: ProformaExpress <[email protected]> +Subject: RE: Issue 14794:Don M. says.. Aaron - I completed RNS Test Question + 3, which was done as a 'Cargo Control Number' query. H +Thread-Topic: Issue 14794:Don M. says.. Aaron - I completed RNS Test + Question 3, which was done as a 'Cargo Control Number' query. H +X-ASG-Orig-Subj: RE: Issue 14794:Don M. says.. Aaron - I completed RNS Test Question + 3, which was done as a 'Cargo Control Number' query. H +Thread-Index: AQHM1JquY55Wte0hREivWFQKTv0KkpYPkFyF +Date: Mon, 16 Jan 2012 22:19:26 +0000 +Message-ID: <[email protected]> +References: <[email protected]> +In-Reply-To: <[email protected]> +Accept-Language: en-US +Content-Language: en-US +X-MS-Has-Attach: +X-MS-TNEF-Correlator: +x-originating-ip: [192.168.106.241] +Content-Type: text/plain; charset="Windows-1252" +Content-Transfer-Encoding: quoted-printable +MIME-Version: 1.0 +X-Barracuda-Connect: legacy.ngSmith.com[192.168.0.61] +X-Barracuda-Start-Time: 1326752367 +X-Barracuda-URL: http://192.168.0.95:8000/cgi-mod/mark.cgi +X-Virus-Scanned: by bsmtpd at ngSmith.com +X-Barracuda-Spam-Score: 0.00 +X-Barracuda-Spam-Status: No, SCORE=0.00 using global scores of TAG_LEVEL=1000.0 QUARANTINE_LEVEL=1000.0 KILL_LEVEL=9.0 tests= +X-Barracuda-Spam-Report: Code version 3.2, rules version 3.2.2.86107 + Rule breakdown below + pts rule name description + ---- ---------------------- -------------------------------------------------- + +Don, + +Please have express change "CC" to "ABT" +Aaron + +________________________________ +From: ProformaExpress [[email protected]] +Sent: Monday, January 16, 2012 4:10 PM +To: Christian Doe; Pat Doe; Don Doe; Jim Doe; Michael H= +anson; Tim Doe; Aaron Doe +Subject: Issue 14794:Don M. says.. Aaron - I completed RNS Test Question 3,= + which was done as a 'Cargo Control Number' query. H + + +Direct link to Issue 14794<http://trakr.net/list/ProformaExpress/rev= +ise/14794> I am working on this<http://trakr.net/list/ProformaExpr= +ess/work/19406> + + +#10 Don Doe said less than a minute ago [Mon, Jan 16, 2012 02:10 PM = +PST] status:active + + + +Aaron - I completed RNS Test Question 3, which was done as a 'Cargo Control= + Number' query. + +Having a problem, per attached, where the EDIFACT file is showing the Notif= +ication_Qualifier (Reference Qualifier) as - TN - which should only be used= + for Transaction Number queries. + +In this case the EDIFACT file should be showing 'ABT' for a Cargo Control N= +umber Query - not TN. + +The Express XML is showing 'CC' for the 'Notification_Qualifier' on Cargo C= +ontrol Number queries. + +When you get the CC, it has to be shown as ABT in the EDIFACT. + +The last test question (2) required query by Transaction Number - so TN was= + correct. + +When you get 'CC' - please change to 'ABT' in the EDIFACT. + +Let me know if you need additional information. + +Thanks + + + + +Wrong_Reference_Qualifier.xlsx<http://trakr.net/uploads/1/14794/Wron= +g_Reference_Qualifier.xlsx> view<http://trakr.net/uploads/1/14794/Wr= +ong_Reference_Qualifier.xlsx?viewer=3D1> + + + + Email(s) sent to: Christian Doe,Pat Doe,Don Doe,Jim,= +Michael Doe,Tim Doe,Aaron Doe + Direct link to Issue 14794<http://trakr.net/list/ProformaExp= +ress/revise/14794> + +All attachments for this issue: + +Wrong_Reference_Qualifier.xlsx<http://trakr.net/uploads/1/14794/Wron= +g_Reference_Qualifier.xlsx> view<http://trakr.net/uploads/1/14794/Wr= +ong_Reference_Qualifier.xlsx?viewer=3D1> +RNS_Query_by_Transaction_Number.xlsx<http://trakr.net/uploads/1/1479= +4/RNS_Query_by_Transaction_Number.xlsx> view<http://trakr.net/upload= +s/1/14794/RNS_Query_by_Transaction_Number.xlsx?viewer=3D1> +RNS_Qeury_specifics.xlsx<http://trakr.net/uploads/1/14794/RNS_Qeury_= +specifics.xlsx> view<http://trakr.net/uploads/1/14794/RNS_Qeury_spec= +ifics.xlsx?viewer=3D1> + + + Issue History.. +#9 Don Doe said about 7 hours ago [Mon, Jan 16, 2012 07:10 AM PST] = + + status:active + + + +Per Judi's email below - RNS Question 2 is correct. +Have sent # 3 now. + +Question 2 was sent on Thursday so she is taking a couple days, +or more, to get back with the question status. +_________________________________________ +From: Johnson, Judi +Sent: Monday, January 16, 2012 9:27 AM +To: Don Doe +Subject: RE: RNS Client Test Package =96 Question 2 + +Hi Don +That is correct +Go to test 3 +Bye Judi +_________________________________________ +From: Don Doe [mailto:[email protected]<mailto:[email protected]>] +Sent: January 12, 2012 5:03 PM +To: Johnson, Judi +Subject: RE: RNS Client Test Package - 1 +Importance: High + +Hi Judi, + +I have sent the RNS Transaction for Test Question 2 again. +The programmer has fixed the RNS Transaction showing TN for Transaction Num= +ber. + + + + +#8 Don Doe said 4 days ago [Thu, Jan 12, 2012 07:58 AM PST] = + status:active + + + +OK - sending it again. +Thanks + + + + +#7 Aaron Doe said 4 days ago [Thu, Jan 12, 2012 07:48 AM PST] = + status:active + + + +Refreshed the map. I tested and it is working now. + +Aaron + + + + +#6 Don Doe said 4 days ago [Thu, Jan 12, 2012 06:26 AM PST] = + status:active + + + +I just re-sent the RNS Query Test 2 again - but got the same results. + +Express sent - <notification_qualifier>TN</notification_qualifier> + +But - ABT was sent to CBSA again: +UNB+UNOA:2+6128547363+RCCECECPT:12+120112:0810+22++CUSREP'UNG+CUSREP+612854= +7363+PARSPDN+120112:0810+22+UN+D:96A'UNH+0022+CUSREP:D:96A:UN'BGM+998'DTM+1= +32:20120112:203'RFF+ABT:14142123913549'UNT+5+0022'UNE+1+22'UNZ+1+22' + + + + +#5 Aaron Doe said 4 days ago [Thu, Jan 12, 2012 02:25 AM PST] = + status:active + + + +The qualifier is mapped. Please retest. + + + + +#4 Don Doe said 5 days ago [Wed, Jan 11, 2012 11:02 AM PST] = + status:active + + + +Aaron - TN or ABT are both being included in the XML when oppopriate. +Can you not go by this? + +Getting for the Transaction Number query - +<Notification_qualifier>TN</Notification_qualifier> +or +<Notification_qualifier>ABT</Notification_qualifier> + +Do you have to have an indicator also? + +Should I recreate the RNS transaction to send or are you sending the one yo= +u fixed? +Thanks + + + + + +#3 Aaron Doe said 5 days ago [Wed, Jan 11, 2012 10:25 AM PST] = + status:active + + + +I changed =93ABT=94 to =93TN=94. If you need to switch between the CCN and = +the TN I will need an indicator in the xml. Don recheck step 1. + + + + +#2 Don Doe said 5 days ago [Wed, Jan 11, 2012 07:51 AM PST] = + status:active + + + +When completing the RNS Query Test 2 - sending by Transaction Number - have= + to send "TN" for the Reference Qualifier, per attached. + +But the EDIFACT sent shows ABT (for Cargo Control Number) in error. . + +The XML file sent from Express - also attached - does show TN - but the EDI= +FACT file is showing: ABT + +Please correct - as soon as possible. + +Thanks + + + + +RNS_Query_by_Transaction_Number.xlsx<http://trakr.net/uploads/1/1479= +4/RNS_Query_by_Transaction_Number.xlsx> view<http://trakr.net/upload= +s/1/14794/RNS_Query_by_Transaction_Number.xlsx?viewer=3D1> + + + + +#1 Don Doe said 6 days ago [Tue, Jan 10, 2012 07:58 PM PST] = + status:active + + + +I completed the RNS Test Question 2 today. Still waiting to hear the result= +s from Judi at CBSA. + +Question 2 requires that you do the query using the Transaction Id. +In this case, Judi told me to use - 14142123913549 for the Transaction Id -= + which I did. + +But, per attached, the Query Responses grid doesn't tell you that this quer= +y was completed by "Transaction Id" and doesn't show the "Transaction Id" u= +sed with the query. + +Need to have a column that shows whether the RNS Query was done by Cargo Co= +ntrol Number (CCN), Conveyance Reference, or Transaction Id. + +Also need to be able to see the Transaction #, CCN, or Conveyance Reference= + used within the Query Responses. + +This would let the user know what type of query was sent and make it easier= + to know which RNS Query is which. + +Let me know if any questions. + +Thanks. + + + + +RNS_Qeury_specifics.xlsx<http://trakr.net/uploads/1/14794/RNS_Qeury_= +specifics.xlsx> view<http://trakr.net/uploads/1/14794/RNS_Qeury_spec= +ifics.xlsx?viewer=3D1> + + +C-TPAT SVI Partner ID: norBro01937 / norCon01149=0D + +This message and any attachments are intended solely for the addressee(s) a= +nd are confidential. If you receive this message in error, please delete i= +t and immediately notify the sender. Norman G. Smith, Inc. accepts no lia= +bility for any claims in connection with the content or the transmission of= + this message. To better protect yourself, we suggest you obtain written a= +dvice from the applicable Government agency. =0D +All business is transacted subject to our Terms and Conditions of Service. = + Visit http://www.ngSmith.com/tools/forms/eng/terms_conditions.pdf for a f= +ull copy.=0D=0D + + + diff --git a/test/test_invalid_byte_seq_outlook.rb b/test/test_invalid_byte_seq_outlook.rb new file mode 100644 index 0000000..75a6b6a --- /dev/null +++ b/test/test_invalid_byte_seq_outlook.rb @@ -0,0 +1,27 @@ +require "test_helper" + +class TestInvalidByteSeqOutlook < Test::Unit::TestCase + include MMS2R::TestHelper + + def test_bad_outlook + mail = mail('invalid-byte-seq-outlook.mail') + mms = MMS2R::Media.new(mail) + body = mms.body +=begin + + assert_equal "+919812345678", mms.number + assert_equal "1nbox.net", mms.carrier + assert_equal 2, mms.media.size + + assert_not_nil mms.media['text/plain'] + assert_equal 1, mms.media['text/plain'].size + assert_equal "testing123456789012", open(mms.media['text/plain'].first).read + + assert_not_nil mms.media['image/jpeg'] + assert_equal 1, mms.media['text/plain'].size + assert_match(/@003\.jpg$/, mms.media['image/jpeg'].first) +=end + + mms.purge + end +end diff --git a/test/test_mms2r_media.rb b/test/test_mms2r_media.rb index f14c737..3f63b54 100644 --- a/test/test_mms2r_media.rb +++ b/test/test_mms2r_media.rb @@ -1,758 +1,758 @@ # encoding: UTF-8 require "test_helper" class TestMms2rMedia < Test::Unit::TestCase include MMS2R::TestHelper def use_temp_dirs MMS2R::Media.tmp_dir = @tmpdir MMS2R::Media.conf_dir = @confdir end def setup - @tmpdir = File.join(Dir.tmpdir, "#{Time.now.to_i}-t") + @oldtmpdir = MMS2R::Media.tmp_dir || File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") + @oldconfdir = MMS2R::Media.conf_dir || File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") + FileUtils.mkdir_p(@oldtmpdir) + FileUtils.mkdir_p(@oldconfdir) + + @tmpdir = File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") FileUtils.mkdir_p(@tmpdir) - @confdir = File.join(Dir.tmpdir, "#{Time.now.to_i}-c") + @confdir = File.join(Dir.tmpdir, "#{Time.now.to_i}-#{rand(1000)}") FileUtils.mkdir_p(@confdir) - - @oldtmpdir = MMS2R::Media.tmp_dir - @oldconfdir = MMS2R::Media.conf_dir end def teardown FileUtils.rm_rf(@tmpdir) FileUtils.rm_rf(@confdir) MMS2R::Media.tmp_dir = @oldtmpdir MMS2R::Media.conf_dir = @oldconfdir end def stub_mail(vals = {}) attrs = { :from => '[email protected]', :to => '[email protected]', :subject => 'This is a test email', :body => 'a', }.merge(vals) Mail.new do from attrs[:from] to attrs[:to] subject attrs[:subject] body attrs[:body] end end def test_faux_user_agent assert_equal "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C28 Safari/419.3", MMS2R::Media::USER_AGENT end def test_class_parse mms = mail('generic.mail') assert_equal ['[email protected]'], mms.from end def temp_text_file(text) tf = Tempfile.new("test" + rand.to_s) tf.puts(text) tf.close tf.path end def test_tmp_dir use_temp_dirs() MMS2R::Media.tmp_dir = @tmpdir assert_equal @tmpdir, MMS2R::Media.tmp_dir end def test_conf_dir use_temp_dirs() MMS2R::Media.conf_dir = @confdir assert_equal @confdir, MMS2R::Media.conf_dir end def test_safe_message_id mid1_b="1234abcd" mid1_a="1234abcd" mid2_b="<01234567.0123456789012.JavaMail.fooba@foo-bars999>" mid2_a="012345670123456789012JavaMailfoobafoo-bars999" assert_equal mid1_a, MMS2R::Media.safe_message_id(mid1_b) assert_equal mid2_a, MMS2R::Media.safe_message_id(mid2_b) end def test_default_ext assert_equal nil, MMS2R::Media.default_ext(nil) assert_equal 'text', MMS2R::Media.default_ext('text') assert_equal 'txt', MMS2R::Media.default_ext('text/plain') assert_equal 'test', MMS2R::Media.default_ext('example/test') end def test_base_initialize_config_tries_to_open_default_config_yaml f = File.join(MMS2R::Media.conf_dir, 'mms2r_media.yml') YAML.expects(:load_file).once.with(f).returns({}) config = MMS2R::Media.initialize_config(nil) end def test_base_initialize_config config = MMS2R::Media.initialize_config(nil) # test defaults shipped in mms2r_media.yml assert_not_nil config assert_equal true, config['ignore'].is_a?(Hash) assert_equal true, config['transform'].is_a?(Hash) assert_equal true, config['number'].is_a?(Array) end def test_instance_initialize_config mms = MMS2R::Media.new stub_mail config = mms.initialize_config(nil) # test defaults shipped in mms2r_media.yml assert_not_nil config assert_equal true, config['ignore'].is_a?(Hash) assert_equal true, config['transform'].is_a?(Hash) assert_equal true, config['number'].is_a?(Array) end def test_initialize_config_contatenation c = {'ignore' => {'text/plain' => [/A TEST/]}, 'transform' => {'text/plain' => [/FOO/, '']}, 'number' => ['from', /^([^\s]+)\s.*/, '\1'] } config = MMS2R::Media.initialize_config(c) assert_not_nil config['ignore']['text/plain'].detect{|v| v == /A TEST/} assert_not_nil config['transform']['text/plain'].detect{|v| v == /FOO/} assert_not_nil config['number'].first == 'from' end def test_aliased_new_returns_default_processor_instance mms = MMS2R::Media.new stub_mail assert_not_nil mms assert_equal true, mms.respond_to?(:process) assert_equal MMS2R::Media, mms.class end def test_lazy_process_option mms = MMS2R::Media.new stub_mail, :process => :lazy mms.expects(:process).never end def test_logger_option logger = mock() logger.expects(:info).at_least_once mms = MMS2R::Media.new stub_mail, :logger => logger end def test_default_processor_initialize_tries_to_open_config_for_carrier mms_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'mms2r_media.yml')) aliases_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'aliases.yml')) from_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'from.yml')) example_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'example.com.yml')) YAML.expects(:load_file).at_least_once.with(mms_yaml).returns({}) YAML.expects(:load_file).at_least_once.with(aliases_yaml).returns({}) YAML.expects(:load_file).at_least_once.with(from_yaml).returns([]) YAML.expects(:load_file).never.with(example_yaml) mms = MMS2R::Media.new stub_mail end def test_mms_phone_number mail = stub_mail mail.stubs(:from).returns(['[email protected]']) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number end def test_mms_phone_number_from_config mail = stub_mail(:from => '"+2068675309" <[email protected]>') mms = MMS2R::Media.new(mail) mms.expects(:config).once.returns({'number' => ['from', /^([^\s]+)\s.*/, '\1']}) assert_equal '+2068675309', mms.number end def test_mms_phone_number_with_errors mail = stub_mail mail.stubs(:from).returns(nil) mms = MMS2R::Media.new(mail) assert_nothing_raised do assert_equal '', mms.number end end def test_transform_text_plain mail = stub_mail mail.stubs(:from).returns(nil) mms = MMS2R::Media.new(mail) type = 'test/type' text = 'hello' # no match in the config result = [type, text] assert_equal result, mms.transform_text(type, text) # testing the default config assert_equal ['text/plain', ''], mms.transform_text('text/plain', "Sent via BlackBerry from T-Mobile") assert_equal ['text/plain', ''], mms.transform_text('text/plain', "Sent from my Verizon Wireless BlackBerry") assert_equal ['text/plain', ''], mms.transform_text('text/plain', 'Sent from my iPhone') assert_equal ['text/plain', ''], mms.transform_text('text/plain', 'Sent from your iPhone.') assert_equal ['text/plain', ''], mms.transform_text('text/plain', " \n\nimage/jpeg") # has a bad regexp mms.expects(:config).at_least_once.returns({'transform' => {type => [['(hello)', 'world']]}}) assert_equal result, mms.transform_text(type, text) # matches in config mms.expects(:config).at_least_once.returns({'transform' => {type => [[/(hello)/, 'world']]}}) assert_equal [type, 'world'], mms.transform_text(type, text) mms.expects(:config).at_least_once.returns({'transform' => {type => [[/^Ignore this part, (.+)/, '\1']]}}) assert_equal [type, text], mms.transform_text(type, "Ignore this part, " + text) # chaining transforms mms.expects(:config).at_least_once.returns({'transform' => {type => [[/(hello)/, 'world'], [/(world)/, 'mars']]}}) assert_equal [type, 'mars'], mms.transform_text(type, text) # has a Iconv problem mms.expects(:config).at_least_once.returns({'transform' => {type => [['(hello)', 'world']]}}) assert_equal result, mms.transform_text(type, text) end def test_transform_text_to_utf8 mail = mail('iconv-fr-text-01.mail') mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_equal 1, mms.media['text/plain'].size assert_equal 1, mms.media['text/html'].size file = mms.media['text/plain'][0] assert_not_nil file assert_equal true, File::exist?(file) text_lines = IO.readlines("#{file}") text = text_lines.join - # ASCII-8BIT -> D'ici un mois G\xC3\xA9orgie - # UTF-8 -> D'ici un mois Géorgie + # ASCII-8BIT -> D'ici un mois G\xE9orgie + # UTF-8 -> D'ici un mois Géorgie if RUBY_VERSION < "1.9" - assert_equal("D'ici un mois Géorgie body", text_lines.first.strip) assert_equal("sample email message Fwd: sub D'ici un mois Géorgie", mms.subject) + assert_equal("D'ici un mois Géorgie body", text_lines.first.strip) else - #assert_equal("D'ici un mois Géorgie body", text_lines.first.strip) - assert_equal("D'ici un mois G\xE9orgie body", text_lines.first.strip) - assert_equal("sample email message Fwd: sub D'ici un mois Géorgie", mms.subject) + assert_equal(Iconv.new('UTF-8', 'ISO-8859-1').iconv("sample email message Fwd: sub D'ici un mois Géorgie"), mms.subject) + assert_equal(Iconv.new('UTF-8', 'ISO-8859-1').iconv("D'ici un mois G\xE9orgie body"), text_lines.first.strip) end - mms.purge end def test_subject s = 'hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) assert_equal s, mms.subject # second time through shouldn't process the subject again mail.expects(:subject).never assert_equal s, mms.subject end def test_subject_with_bad_mail_subject mail = stub_mail mail.stubs(:subject).returns(nil) mms = MMS2R::Media.new(mail) assert_equal '', mms.subject end def test_subject_with_subject_ignored s = 'hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) mms.stubs(:config).returns({'ignore' => {'text/plain' => [s]}}) assert_equal '', mms.subject end def test_subject_with_subject_transformed s = 'Default Subject: hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) mms.stubs(:config).returns( { 'ignore' => {}, 'transform' => {'text/plain' => [[/Default Subject: (.+)/, '\1']]}}) assert_equal 'hello world', mms.subject end def test_attachment_should_return_nil_if_files_for_type_are_not_found mms = MMS2R::Media.new stub_mail mms.stubs(:media).returns({}) assert_nil mms.send(:attachment, ['text']) end def test_attachment_should_return_nil_if_empty_files_are_found mms = MMS2R::Media.new stub_mail mms.stubs(:media).returns({'text/plain' => [Tempfile.new('test')]}) assert_nil mms.send(:attachment, ['text']) end def test_type_from_filename mms = MMS2R::Media.new stub_mail assert_equal 'image/jpeg', mms.send(:type_from_filename, "example.jpg") end def test_type_from_filename_should_be_nil mms = MMS2R::Media.new stub_mail assert_nil mms.send(:type_from_filename, "example.example") end def test_attachment_should_return_duck_typed_file mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") size = File.size(temp_text_file("hello world")) temp_small = temp_text_file("hello") mms.stubs(:media).returns({'text/plain' => [temp_small, temp_big]}) duck_file = mms.send(:attachment, ['text']) assert_not_nil duck_file assert_equal true, File::exist?(duck_file) assert_equal true, File::exist?(temp_big) assert_equal temp_big, duck_file.local_path assert_equal File.basename(temp_big), duck_file.original_filename assert_equal size, duck_file.size assert_equal 'text/plain', duck_file.content_type end def test_empty_body mms = MMS2R::Media.new stub_mail mms.stubs(:default_text).returns(nil) assert_equal "", mms.body end def test_body mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") mms.stubs(:default_text).returns(File.new(temp_big)) body = mms.body assert_equal "hello world", body end def test_body_when_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") mms.stubs(:default_html).returns(File.new(temp_big)) assert_equal "hello world teapot", mms.body end def test_default_text mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'text/plain' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_text.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_text.local_path end def test_default_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") temp_small = temp_text_file("<html><head><title>hello</title></head><body>world<body></html>") mms.stubs(:media).returns({'text/html' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_html.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_html.local_path end def test_default_media mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'image/jpeg' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_media.local_path end def test_default_media_treats_image_and_video_equally mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big_image = temp_text_file("hello world") temp_small_image = temp_text_file("hello") temp_big_video = temp_text_file("hello world again") temp_small_video = temp_text_file("hello again") mms.stubs(:media).returns({'image/jpeg' => [temp_small_image, temp_big_image], 'video/mpeg' => [temp_small_video, temp_big_video], }) assert_equal temp_big_video, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big_video, mms.default_media.local_path end #def test_default_media_treats_gif_and_jpg_equally # #it doesn't matter that these are text files, we just need say they are images # temp_big = temp_text_file("hello world") # temp_small = temp_text_file("hello") # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/jpeg' => [temp_big], 'image/gif' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/gif' => [temp_big], 'image/jpg' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path #end def test_purge mms = MMS2R::Media.new stub_mail mms.purge assert_equal false, File.exist?(mms.media_dir) end def test_ignore_media_by_filename_equality name = 'foo.txt' type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [name]}}) # type is not in the ingore part = stub(:body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and filename are in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal true, mms.ignore_media?(type, part) # type but not file name are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_filename name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'foo.txt', mms.filename?(part) end def test_long_filename name = 'x' * 300 + '.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'x' * 251 + '.txt', mms.filename?(part) end def test_filename_when_file_extension_missing_part name = 'foo' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.txt', mms.filename?(part) name = 'foo.janky' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.janky.txt', mms.filename?(part) end def test_ignore_media_by_filename_regexp name = 'foo.txt' regexp = /foo\.txt/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [regexp, 'nil.txt']}}) # type is not in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the filename are in the ingore part = stub(:filename => name) assert_equal true, mms.ignore_media?(type, part) # type but not regexp for filename are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_by_regexp_on_file_content name = 'foo.txt' content = "aaaaaaahello worldbbbbbbbbb" regexp = /.*Hello World.*/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => ['nil.txt', regexp]}}) part = stub(:filename => name, :body => Mail::Body.new(content)) # type is not in the ingore assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the content are in the ingore assert_equal true, mms.ignore_media?(type, part) # type but not regexp for content are in the ignore part = stub(:filename => name, :body => Mail::Body.new('no teapots')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_when_file_content_is_empty mms = MMS2R::Media.new stub_mail # there is no conf but the part's body is empty part = stub(:filename => 'foo.txt', :body => Mail::Body.new) assert_equal true, mms.ignore_media?('text/test', part) # there is no conf but the part's body is white space part = stub(:filename => 'foo.txt', :body => Mail::Body.new("\t\n\t\n ")) assert_equal true, mms.ignore_media?('text/test', part) end def test_add_file mail = stub_mail mail.stubs(:from).returns(['[email protected]']) mms = MMS2R::Media.new(mail) mms.stubs(:media).returns({}) assert_nil mms.media['text/html'] mms.add_file('text/html', '/tmp/foo.html') assert_equal ['/tmp/foo.html'], mms.media['text/html'] mms.add_file('text/html', '/tmp/bar.html') assert_equal ['/tmp/foo.html', '/tmp/bar.html'], mms.media['text/html'] end def test_temp_file name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal name, File.basename(mms.temp_file(part)) end def test_process_media_for_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', 'hello world']) result = mms.process_media(part) assert_equal 'text/plain', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_with_empty_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', '']) assert_equal ['text/plain', nil], mms.process_media(part) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_application_smil name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['application/smil', nil]) part = stub(:filename => name, :content_type => 'application/smil', :part_type? => 'application/smil', :main_type => 'application') assert_equal ['application/smil', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['application/smil', 'hello world']) result = mms.process_media(part) assert_equal 'application/smil', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_application_octet_stream_when_image name = 'fake.jpg' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'application/octet-stream', :part_type? => 'application/octet-stream', :body => Mail::Body.new("data"), :main_type => 'application') result = mms.process_media(part) assert_equal 'image/jpeg', result.first assert_match(/fake\.jpg$/, result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_all_other_media name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :main_type => 'faux', :part_type? => 'faux/text', :body => Mail::Body.new(nil)) assert_equal ['faux/text', nil], mms.process_media(part) part = stub(:filename => name, :main_type => 'faux', :part_type? => 'faux/text', :body => Mail::Body.new('hello world')) result = mms.process_media(part) assert_equal 'faux/text', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process mms = MMS2R::Media.new stub_mail assert_equal 1, mms.media.size assert_not_nil mms.media['text/plain'] assert_equal 1, mms.media['text/plain'].size assert_equal true, File.exist?(mms.media['text/plain'].first) assert_equal 1, File.size(mms.media['text/plain'].first) mms.purge end def test_process_with_multipart_double_parts mail = mail('apple-double-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_not_nil mms.media['application/applefile'] assert_equal 1, mms.media['application/applefile'].size assert_not_nil mms.media['image/jpeg'] assert_equal 1, mms.media['image/jpeg'].size assert_match(/DSCN1715\.jpg$/, mms.media['image/jpeg'].first) assert_file_size mms.media['image/jpeg'].first, 337 mms.purge end def test_process_with_multipart_alternative_parts mail = stub_mail plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new('a'), :main_type => 'text') plain.stubs(:multipart?).at_least_once.returns(false) html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new('a'), :main_type => 'text') html.stubs(:multipart?).at_least_once.returns(false) multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) multi.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:parts).at_least_once.returns([multi]) # the multipart/alternative should get flattend to text and html mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_equal 2, mms.media.size assert_not_nil mms.media['text/plain'] assert_not_nil mms.media['text/html'] assert_equal 1, mms.media['text/plain'].size assert_equal 1, mms.media['text/html'].size assert_equal 'message.txt', File.basename(mms.media['text/plain'].first) assert_equal 'message.html', File.basename(mms.media['text/html'].first) assert_equal true, File.exist?(mms.media['text/plain'].first) assert_equal true, File.exist?(mms.media['text/html'].first) assert_equal 1, File.size(mms.media['text/plain'].first) assert_equal 1, File.size(mms.media['text/html'].first) mms.purge end def test_process_when_media_is_ignored mail = stub_mail plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new(''), :main_type => 'text') plain.stubs(:multipart?).at_least_once.returns(false) html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new(''), :main_type => 'text') html.stubs(:multipart?).at_least_once.returns(false) multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) multi.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:parts).at_least_once.returns([multi]) mms = MMS2R::Media.new(mail, :process => :lazy) mms.stubs(:config).returns({'ignore' => {'text/plain' => ['message.txt'], 'text/html' => ['message.html']}}) assert_nothing_raised { mms.process } # the multipart/alternative should get flattend to text and html and then # what's flattened is ignored assert_equal 0, mms.media.size mms.purge end def test_process_when_yielding_to_a_block mail = stub_mail plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new('a'), :main_type => 'text') plain.stubs(:multipart?).at_least_once.returns(false) html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new('b'), :main_type => 'text') html.stubs(:multipart?).at_least_once.returns(false) multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) multi.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:parts).at_least_once.returns([multi]) # the multipart/alternative should get flattend to text and html mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size mms.process do |type, files| assert_equal 1, files.size assert_equal true, type == 'text/plain' || type == 'text/html' assert_equal true, File.basename(files.first) == 'message.txt' || File.basename(files.first) == 'message.html' assert_equal true, File::exist?(files.first) end mms.purge end def test_domain_from_return_path mail = mock() mail.expects(:from).at_least_once.returns([]) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'null.example.com', domain end def test_domain_from_from mail = mock() mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'null.example.com', domain end def test_domain_from_from_yaml f = File.join(MMS2R::Media.conf_dir, 'from.yml') YAML.expects(:load_file).once.with(f).returns(['example.com']) mail = mock() mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'example.com', domain end def test_unknown_device_type mail = mail('generic.mail') mms = MMS2R::Media.new(mail) assert_equal :unknown, mms.device_type? assert_equal false, mms.is_mobile? end def test_iphone_device_type_by_header iphones = ['att-iphone-01.mail', 'iphone-image-01.mail'] iphones.each do |iphone| mail = mail(iphone) mms = MMS2R::Media.new(mail) assert_equal :iphone, mms.device_type?, "fixture #{iphone} was not a iphone" assert_equal true, mms.is_mobile?
monde/mms2r
8f614579de34d45e14d3fb41fa0a9332bd3367b1
Fix for invalid byte sequence in UTF-8
diff --git a/lib/mms2r/media.rb b/lib/mms2r/media.rb index 472ceb4..a9a1621 100644 --- a/lib/mms2r/media.rb +++ b/lib/mms2r/media.rb @@ -1,780 +1,782 @@ #-- # Copyright (c) 2007-2010 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ ## # = Synopsis # # MMS2R is a library to collect media files from MMS messages. MMS messages # are multipart emails and mobile carriers often inject branding into these # messages. MMS2R strips the advertising from an MMS leaving the actual user # generated media. # # The Tracker for MMS2R is located at # http://rubyforge.org/tracker/?group_id=3065 # Please submit bugs and feature requests using the Tracker. # # If MMS from a carrier not known by MMS2R is encountered please submit a # sample to the author for inclusion in this project. # # == Stand Alone Example # # begin # require 'mms2r' # rescue LoadError # require 'rubygems' # require 'mms2r' # end # mail = Mail.read("sample-MMS.file") # mms = MMS2R::Media.new(mail) # subject = mms.subject # number = mms.number # file = mms.default_media # mms.purge # # == Rails ActionMailer#receive w/ AttachmentFu Example # # def receive(mail) # mms = MMS2R::Media.new(mail) # picture = Picture.new # picture is an attachemnt_fu model # picture.title = mms.subject # picture.uploaded_data = mms.default_media # picture.save! # mms.purge # end # # == More Examples # # See the README.txt file for more examples # # == Built In Configuration # # A custom configuration can be created for processing the MMS from carriers # that are not currently known by MMS2R. In the conf/ directory create a # YAML file named by combining the domain name of the MMS sender plus a .yml # extension. For instance the configuration of senders from AT&T's cellular # service with a Sender pattern of [email protected] have a configuration # named conf/mms.att.net.yml # # The YAML configuration contains a Hash with instructions for determining what # is content generated by the user and what is content inserted by the carrier. # # The root hash itself has two hashes under the keys 'ignore' and 'transform', # and an array under the 'number' key. # Each hash is itself keyed by mime-type. The value pointed to by the mime-type # key is an array. The ignore arrays are first inspected as regular expressions # else are used as a equality for a string filename. Ignores # work by filename # for the multi-part of the MMS that is being inspected. The array pointed to # by the 'number' key represents an alternate mail header where the sender's # number can be found with a regular expression and replacement value for a # gsub. # # The transform arrays are themselves an array of two element arrays. The elements # are regexp parameters for gsub. # # Ignore instructions are honored first then transform instructions. In the sample, # masthead.jpg is ignored as a regular expression, and spacer.gif is ignored as a # filename comparison. The transform has a match and a replacement, see the gsub # documentation for more information about match and replace. # # -- # ignore: # image/jpeg: # - /^masthead.jpg$/i # image/gif: # - spacer.gif # text/plain: # - /\AThis message was sent using PIX-FLIX Messaging service from .*/m # transform: # text/plain: # - - /\A(.+?)\s+This message was sent using PIX-FLIX Messaging .*/m # - "\1" # number: # - from # - /^([^\s]+)\s.*/ # - "\1" # # Carriers often provide their services under many different domain names. # The conf/aliases.yml is a YAML file with a hash that maps alternative or # legacy carrier names to the most common name of their service. For example # in terms of MMS2R txt.att.net is an alias for mms.att.net. Therefore when # an MMS with a Sender of txt.att.net is processed MMS2R will use the # mms.att.net configuration to process the message. module MMS2R class MMS2R::Media # Pass off everything we don't do to the Mail object # TODO: refactor to explicit addition a la http://blog.jayfields.com/2008/02/ruby-replace-methodmissing-with-dynamic.html def method_missing method, *args, &block mail.send method, *args, &block end ## # Mail object that the media files were derived from. attr_reader :mail ## # media returns the hash of media. The media hash is keyed by mime-type # such as 'text/plain' and the value mapped to the key is an array of # media that are of that type. attr_reader :media ## # Carrier is the domain name of the carrier. If the carrier is not known # the carrier will be set to 'mms2r.media' attr_reader :carrier ## # Base working dir where media for a unique mms message are dropped attr_reader :media_dir ## # Determine if return-path or from is going to be used to desiginate the # origin carrier. If the domain in the From header is listed in # conf/from.yaml then that is the carrier domain. Else if there is a # Return-Path header its address's domain is the carrier doamin, else # use From header's address domain. def self.domain(mail) return_path = case when mail.return_path mail.return_path ? mail.return_path.split('@').last : '' else '' end from_domain = case when mail.from && mail.from.first mail.from.first.split('@').last else '' end f = File.expand_path(File.join(self.conf_dir(), "from.yml")) from = YAML::load_file(f) ret = case when from.include?(from_domain) from_domain when return_path.present? return_path else from_domain end ret end ## # Initialize a new MMS2R::Media comprised of a mail. # # Specify options to initialize with: # :logger => some_logger for logging # :process => :lazy, for non-greedy processing upon initialization # # #process will have to be called explicitly if the lazy process option # is chosen. def initialize(mail, opts={}) @mail = mail @logger = opts[:logger] log("#{self.class} created", :info) @carrier = self.class.domain(mail) @dir_count = 0 sha = Digest::SHA1.hexdigest("#{@carrier}-#{Time.now.to_i}-#{rand}") @media_dir = File.expand_path( File.join(self.tmp_dir(), "#{self.safe_message_id(@mail.message_id)}_#{sha}")) @media = {} @was_processed = false @number = nil @subject = nil @body = nil @exif = nil @default_media = nil @default_text = nil @default_html = nil f = File.expand_path(File.join(self.conf_dir(), "aliases.yml")) @aliases = YAML::load_file(f) conf = "#{@aliases[@carrier] || @carrier}.yml" f = File.expand_path(File.join(self.conf_dir(), conf)) c = File.exist?(f) ? YAML::load_file(f) : {} @config = self.class.initialize_config(c) processor_module = MMS2R::CARRIERS[@carrier] extend processor_module if processor_module lazy = (opts[:process] == :lazy) rescue false self.process() unless lazy end ## # Get the phone number associated with this MMS if it exists. The value # returned is simplistic, it is just the user name of the from address # before the @ symbol. Validation of the number is left to you. Most # carriers are using the real phone number as the username. def number unless @number params = config['number'] if params && params.any? && (header = mail.header[params[0]]) @number = header.to_s.gsub(params[1], params[2]) end if @number.nil? || @number.blank? @number = mail.from.first.split(/@|\//).first rescue "" end end @number end ## # Return the Subject for this message, returns "" for default carrier # subject such as 'Multimedia message' for ATT&T carrier. def subject unless @subject subject = mail.subject.strip rescue "" ignores = config['ignore']['text/plain'] if ignores && ignores.detect{|s| s == subject} @subject = "" else @subject = transform_text('text/plain', subject).last end end @subject end # Convenience method that returns a string including all the text of the # default text/plain file found. If the plain text is blank then it returns # stripped down version of the title and body of default text/html. Returns # empty string if no body text is found. def body text_file = default_text @body = text_file ? IO.readlines(text_file.path).join.strip : "" + ic = Iconv.new('UTF-8//IGNORE', 'UTF-8') + @body = ic.iconv(@body) if @body.blank? && html_file = default_html html = Nokogiri::HTML(IO.read(html_file.path)) @body = (html.xpath("//head/title").map(&:text) + html.xpath("//body/*").map(&:text)).join(" ") end @body end # Returns a File with the most likely candidate for the user-submitted # media. Given that most MMS messages only have one file attached, this # method will try to return that file. Singleton methods are added to # the File object so it can be used in place of a CGI upload (local_path, # original_filename, size, and content_type) such as in conjunction with # AttachementFu. The largest file found in terms of bytes is returned. # # Returns nil if there are not any video or image Files found. def default_media @default_media ||= attachment(['video', 'image', 'application', 'text']) end # Returns a File with the most likely candidate that is text, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_text @default_text ||= attachment(['text/plain']) end # Returns a File with the most likely candidate that is html, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_html @default_html ||= attachment(['text/html']) end ## # process is a template method and collects all the media in a MMS. # Override helper methods to this template to clean out advertising and/or # ignore media that are advertising. This method should not be overridden # unless there is an extreme special case in processing the media of a MMS # (like Sprint) # # Helper methods for the process template: # * ignore_media? -- true if the media contained in a part should be ignored. # * process_media -- retrieves media to temporary file, returns path to file. # * transform_text -- called by process_media, strips out advertising. # * temp_file -- creates a temporary filepath based on information from the part. # # Block support: # Call process() with a block to automatically iterate through media. # For example, to process and receive only media of video type: # mms.process do |media_type, file| # results << file if media_type =~ /video/ # end # # note: purge must be explicitly called to remove the media files # mms2r extracts from an mms message. def process() # :yields: media_type, file unless @was_processed log("#{self.class} processing", :info) parts = mail.multipart? ? mail.parts : [mail] # Double check for multipart/related, if it exists replace it with its # children parts. Do this twice as multipart/alternative can have # children and we want to fold everything down for i in 1..2 flat = [] parts.each do |p| if p.multipart? p.parts.each {|mp| flat << mp } else flat << p end end parts = flat.dup end # get to work parts.each do |p| t = p.part_type? unless ignore_media?(t,p) t,f = process_media(p) add_file(t,f) unless t.nil? || f.nil? end end @was_processed = true end # when process acts upon a block if block_given? media.each do |k, v| yield(k, v) end end end ## # Helper for process template method to determine if media contained in a # part should be ignored. Producers should override this method to return # true for media such as images that are advertising, carrier logos, etc. # See the ignore section in the discussion of the built-in configuration. def ignore_media?(type, part) ignores = config['ignore'][type] || [] ignore = ignores.detect{ |test| filename?(part) == test} ignore ||= ignores.detect{ |test| filename?(part) =~ test if test.is_a?(Regexp) } ignore ||= ignores.detect{ |test| part.body.decoded.strip =~ test if test.is_a?(Regexp) } ignore ||= (part.body.decoded.strip.size == 0 ? true : nil) ignore.nil? ? false : true end ## # Helper for process template method to decode the part based on its type # and write its content to a temporary file. Returns path to temporary # file that holds the content. Parts with a main type of text will have # their contents transformed with a call to transform_text # # Producers should only override this method if the parts of the MMS need # special treatment besides what is expected for a normal mime part (like # Sprint). # # Returns a tuple of content type, file path def process_media(part) # Mail body auto-magically decodes quoted # printable for text/html type. file = temp_file(part) if part.part_type? =~ /^text\// || part.part_type? == 'application/smil' type, content = transform_text_part(part) mode = 'wb' else if part.part_type? == 'application/octet-stream' type = type_from_filename(filename?(part)) else type = part.part_type? end content = part.body.decoded mode = 'wb' # open with binary bit for Windows for non text end return type, nil if content.nil? || content.empty? log("#{self.class} writing file #{file}", :info) File.open(file, mode){ |f| f.write(content) } return type, file end ## # Helper for process_media template method to transform text. # See the transform section in the discussion of the built-in # configuration. def transform_text(type, text, original_encoding = 'ISO-8859-1') return type, text if !config['transform'] || !(transforms = config['transform'][type]) if RUBY_VERSION < "1.9" #convert to UTF-8 begin c = Iconv.new('UTF-8', original_encoding ) utf_t = c.iconv(text) rescue Exception => e utf_t = text end else utf_t = text.encoding == "ASCII-8BIT" ? text.force_encoding("ISO-8859-1").encode("UTF-8") : text end transforms.each do |transform| next unless transform.size == 2 p = transform.first r = transform.last utf_t = utf_t.gsub(p, r) rescue utf_t end return type, utf_t end ## # Helper for process_media template method to transform text. def transform_text_part(part) type = part.part_type? text = part.body.decoded.strip transform_text(type, text) end ## # Helper for process template method to name a temporary filepath based on # information in the part. This version attempts to honor the name of the # media as labeled in the part header and creates a unique temporary # directory for writing the file so filename collision does not occur. # Consumers of this method expect the directory structure to the file # exists, if the method is overridden it is mandatory that this behavior is # retained. def temp_file(part) file_name = filename?(part) File.expand_path(File.join(msg_tmp_dir(),File.basename(file_name))) end ## # Purges the unique MMS2R::Media.media_dir directory created # for this producer and all of the media that it contains. def purge() log("#{self.class} purging #{@media_dir} and all its contents", :info) FileUtils.rm_rf(@media_dir) end ## # Helper to add a file to the media hash. def add_file(type, file) media[type] = [] unless media[type] media[type] << file end ## # Helper to temp_file to create a unique temporary directory that is a # child of tmp_dir This version is based on the message_id of the mail. def msg_tmp_dir() @dir_count += 1 dir = File.expand_path(File.join(@media_dir, "#{@dir_count}")) FileUtils.mkdir_p(dir) dir end ## # returns a filename declared for a part, or a default if its not defined def filename?(part) name = part.filename if (name.nil? || name.empty?) if part.content_id && (matched = /^<(.+)>$/.match(part.content_id)) name = matched[1] else name = "#{Time.now.to_f}.#{self.default_ext(part.part_type?)}" end end # FIXME FWIW, janky look for dot extension 1 to 4 chars long name = (name =~ /\..{1,4}$/ ? name : "#{name}.#{self.default_ext(part.part_type?)}").strip # handle excessively large filenames if name.size > 255 ext = File.extname(name) base = File.basename(name, ext) name = "#{base[0, 255 - ext.size]}#{ext}" end name end def aliases @aliases end ## # Best guess of the mobile device type. Simple heuristics thus far by # inspecting mail headers and jpeg/tiff exif metadata, and file name. # Known smart phone types thus far are # # * :blackberry # * :dash # * :droid # * :htc # * :iphone # * :lge # * :motorola # * :nokia # * :palm # * :pantech # * :samsung # # If the message is from a carrier known to MMS2R, and not a smart phone # its type is returned as :handset # Otherwise device type is :unknown def device_type? file = attachment(['image']) if file original = file.original_filename @exif = case original when /\.je?pg$/i EXIFR::JPEG.new(file) when /\.tiff?$/i EXIFR::TIFF.new(file) end if @exif models = config['device_types']['models'] rescue {} models.each do |type, regex| return type if @exif.model =~ regex end makes = config['device_types']['makes'] rescue {} makes.each do |type, regex| return type if @exif.make =~ regex end software = config['device_types']['software'] rescue {} software.each do |type, regex| return type if @exif.software =~ regex end end end headers = config['device_types']['headers'] rescue {} headers.keys.each do |header| if mail.header[header.downcase] # headers[header] refers to a hash of smart phone types with regex values # that if they match, the header signals the type should be returned headers[header].each do |type, regex| return type if mail.header[header.downcase].decoded =~ regex field = mail.header.fields.detect { |field| field.name.downcase == header.downcase } return type if field && field.to_s =~ regex end end end file = attachment(['image']) if file original_filename = file.original_filename filenames = config['device_types']['filenames'] rescue {} filenames.each do |type, regex| return type if original_filename =~ regex end end file = attachment(['video']) if file original_filename = file.original_filename filenames = config['device_types']['filenames'] rescue {} filenames.each do |type, regex| return type if original_filename =~ regex end end boundary = mail.boundary boundaries = config['device_types']['boundary'] rescue {} boundaries.each do |type, regex| return type if boundary =~ regex end return :handset if File.exist?( File.expand_path( File.join(self.conf_dir, "#{self.aliases[self.carrier] || self.carrier}.yml") ) ) :unknown end ## # exif object on default image from exifr gem def exif device_type? unless @exif @exif end ## # The source of the MMS was some sort of mobile or smart phone def is_mobile? self.device_type? != :unknown end ## # Get the temporary directory where media files are written to. def self.tmp_dir @@tmp_dir ||= File.expand_path(File.join(Dir.tmpdir, (ENV['USER'].nil? ? '':ENV['USER']), 'mms2r')) end ## # Set the temporary directory where media files are written to. def self.tmp_dir=(d) @@tmp_dir=d end ## # Get the directory where conf files are stored. def self.conf_dir @@conf_dir ||= File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'conf')) end ## # Set the directory where conf files are stored. def self.conf_dir=(d) @@conf_dir=d end ## # Helper to create a safe directory path element based on the mail message # id. def self.safe_message_id(mid) mid.nil? ? "#{Time.now.to_i}" : mid.gsub(/\$|<|>|@|\./, "") end ## # Returns a default file extension based on a content type def self.default_ext(content_type) if MMS2R::EXT[content_type] MMS2R::EXT[content_type] elsif content_type content_type.split('/').last end end ## # Joins the generic mms2r configuration with the carrier specific # configuration. def self.initialize_config(c) f = File.expand_path(File.join(self.conf_dir(), "mms2r_media.yml")) conf = YAML::load_file(f) conf['ignore'] ||= {} unless conf['ignore'] conf['transform'] = {} unless conf['transform'] conf['number'] = [] unless conf['number'] return conf unless c kinds = ['ignore', 'transform'] kinds.each do |kind| if c[kind] c[kind].each do |type,array| conf[kind][type] = [] unless conf[kind][type] conf[kind][type] += array end end end conf['number'] = c['number'] if c['number'] conf end def log(message, level = :info) @logger.send(level, message) unless @logger.nil? end ## # convenience accessor for self.class.conf_dir def conf_dir self.class.conf_dir end ## # convenience accessor for self.class.conf_dir def tmp_dir self.class.tmp_dir end ## # convenience accessor for self.class.default_ext def default_ext(type) self.class.default_ext(type) end ## # convenience accessor for self.class.safe_message_id def safe_message_id(message_id) self.class.safe_message_id(message_id) end ## # convenience accessor for self.class.initialize_confg def initialize_config(config) self.class.initialize_config(config) end private ## # accessor for the config def config @config end ## # guess content type from filename def type_from_filename(filename) ext = filename.split('.').last ent = MMS2R::EXT.detect{|k,v| v == ext} ent.nil? ? nil : ent.first end ## # used by #default_media and #text to return the biggest attachment type # listed in the types array def attachment(types)
monde/mms2r
6dc91b2879e14a9673a959df62baf4ed8d0f2f6d
Make utf-8 fix play nice with Ruby 1.8.7. Bump version.
diff --git a/History.txt b/History.txt index 66fe0b4..b983f5e 100644 --- a/History.txt +++ b/History.txt @@ -1,396 +1,401 @@ +### 3.5.1 / 2011-12-11 (Mashed Potato Johnson - oldest living blues guitarist in the world) + +* 1 bug fix + * A fix for the utf-8 encoding issue with ruby 1.9.2 - James McGrath + ### 3.5.0 / 2011-12-01 (Dr. Milminiman Lamilim Swimwambli - Marriage expert) * 1 major bug fix * In Ruby 1.9.X MMS2R::Media::Sprint was not fetching content from Sprint's CDN correctly because the implementation of Net::HTTP in 1.9.X passes a User-Agent header of "Ruby" to which Sprint responds with a fake 500 - with help from James McGrath ### 3.4.1 / 2011-11-06 (Fatty Ding-Dongs, Dethklok foster child) * 2 major enhancements * Additional means to detect android, iphone, motorola, nokia, palm handsets * Additional known SMS/MMS domains mm.att.net, labwig.net, cdma.sasktel.com ### 3.4.0 / 2011-10-31 (Serveta Skwigelf, Skwisgaar's hot mom) * 2 major enhancements * regexp's in yaml configs are store as a ruby regexp and not a string that is evaled. * character encoding capability with 1.8 rubies and 1.9 rubies. ### 3.3.1 / 2011-01-01 (Reverend Aslaug Wartooth (deceased), Toki's dad) * 2 minor enhancements * new method #default_html returns the default html attachment * #body will return the default plain text, or default stripped html text ### 3.3.0 / 2010-12-31 (Charles Foster Offdensen - CFO, dethklok) * 1 major enhancement * MMS2R::Media::Sprint is now a module that is extended in for processing Sprint content rather than being child class of MMS2R::Media Extension is the strategy to use for overwriting template methods now * 1 minor enhancement * process new Sprint subject - Jason Hooper * new SaskTel mms/sms domain alias sasktel.com * new Virgin Mobile mms/sms domain alias yrmobl.com ### 3.2.0 / 2010-08-17 (Antonio "Tony" DiMarco Thunderbottom - bassist) * 3 minor enhancements * updated readme with latest sites known to use mms2r * bundler assimilated * loading rubygems only if it's required, like rake ### 3.1.0 / 2010-07-09 (Dick "Magic Ears" Knubbler - music producer) * 8 minor enhancements * Detects additional Bell/AT&T domain sbcglobal.net as a handset * Detects additional Virgin mobile domains pixmbl.com vmobl.com as a handset * Expanded mobile phone detection for handset makers by : Casio, Google Nexus One, LG Electronics, Motorola, Pantech, Qualcom, Samsung, Sprint, UTStarCom * EXIF Reader (exifr) is integral to MMS2R and is now a required gem * upgrade Mail to 2.2.5 * depend on latest gems * corrected example - Jason Hooper * added As Seen On The Internet to README that lists sites known to be using MMS2R in some fashion ### 3.0.1 / 2010-03-28 (Lavona Succuboso - leader of "Succuboso Explosion") * 1 minor enhancement * support for U.S. Cellular ### 3.0.0 / 2010-02-24 (General Crozier - Chairman of the Joint Chiefs of Staff) * 1 new feature * dependence upon Mail gem rather than TMail gem ### 2.4.1 / 2010-02-07 (Vater Orlaag - political and spiritual specialist) * 3 minor enhancements * make sure filename is free of new lines - laurynas * recognize HTC HERO200 as a smart phone * recognize HTC Eris as a smart phone ### 2.4.0 / 2009-12-20 (Dr. Nanemiltred Philtendrieden - specialist on celebrity death) * 1 new feature * replace Hpricot with Nokogiri for html parsing of Sprint data * 3 minor enhancements * smartphone identities stored in conf/mms2r_media.yml * identify Motorola Droid as a smartphone * identify T-Mobile Dash as a smartphone * use uuidtools for naming temp directories - kbaum ### 2.3.0 / 2009-08-30 (Snakes 'n' Barrels Greatest Hits) * 5 new features * detect smartphone status/type based on model metadata from jpeg and tiff exif data using exifr gem, access exif data with MMS2R::Media#exif * make MMS2R Rails gem packaging friendly with an init.rb - Scott Taylor, smtlaissezfaire * delegate missing methods to mms2r's tmail object so that mms2r behaves as if it were a tmail object - Sai Emrys, saizai * default_media can return an attachment of application content type - Brendan Lim, brendanlim * MMS2R.parse(raw_mail) convenience class method that parses and returns an mms2r from a mail file - saizai * 4 minor enhancements * make examples more 'mail' specific to enforce the fact that an mms is a multipart email - saizai * update for text in vzwpix.com default carrier message * detecting smartphone (blackberries and iphones for now) is more versatile from reading mail headers * expanded filtering of carrier advertising text in mms from smartphones ### 2.2.0 / 2009-01-04 (Rikki Kixx - owner of a franchise of rehab centers) * 3 new features * MMS2R::Media#is_mobile? best guess if the sender was a mobile device * MMS2R::Media#device_type? best guess of the mobile device type. Simple heuristics thus far for :blackberry :iphone :handset :unknown could be expanded for exif probing or additinal shifting of mail header * from array in conf/from.yml to provide granularity to determine carrier domain (caused by tmo.blackberry.net) * 4 minor enhancements * support for Virgin Canada messaging service vmobile.ca * support for text service messaging.sprintpcs.com * additional BlackBerry coverage from T-Mobile tmo.blackberry.net provider * legacy support for mobile.mycingular.com, pics.cingularme.com * 3 bug fixes * iPhone default subject - jesse dp http://rubyforge.org/tracker/?func=detail&atid=11789&aid=22951&group_id=3065 * add sprintpcs.com to pm.sprint.com aliases * fix OS X long filename issues - Matt Conway ### 2.1.3 / 2008-11-06 (Dr. Ramonolith Chesterfield - Military pharmaceutical psychotropic drug manufacturing expert * 1 minor enhancement * added mms.ae support ### 2.1.2 / 2008-10-21 (Toki's mom, Anja Wartooth) * 2 minor enhancments * Sprint subject update - jesse dp * Virgin Mobile support vmpix.com ### 2.1.1 / 2008-09-24 (Lavona Succuboso, Nathan Explosion uber-groupie) * 4 minor enhancments * Bell Canada support txt.bell.ca - Matt Conway / Snap My Life - http://github.com/wr0ngway, http://github.com/sml * Unicel support unicel.com - Michael DelGaudio * info2go.com support / Unicel * TELUS Corporation support mms.telusmobility.com, msg.telus.com * add test to check that gem builds correctly as a github gem * 1 bug fix * Iconv utf8 fix - Kai Kai ### 2.1.0 / 2008-07-30 (Dr. Gibbons – Birthday expert and Murderface expert) * 1 major enhancement: * opens up TMail for improved query method patterned code in MMS2R * 2 minor enhancements: * UK O2 support mediamessaging.o2.co.uk - Jeremy Wilkins * Write non text files with binary bit set on Windows - David Alm * source hosted on github: git clone git://github.com/monde/mms2r.git ### 2.0.5 / 2008-07-17 (Dr. Ralphus Galkensmelter - Psychological death expert) * Deal with Apple Mail multipart/appledouble - jesse dp ### 2.0.4 / 2008-04-28 (Mr. Selatcia - elder member of The Tribunal) * updated mms.vodacom4me.co.za Vodacom South Africa - Vijay Yellapragada * 1nbox.net / Idea cellular 1nbox.net - Vijay Yellapragada * mms.3ireland.ie / 3 Ireland - Vijay Yellapragada * mms.alltel.com / Alltel (reverted message.alltel.com) - Vijay Yellapragada * mms.mobileiam.ma / Maroc Telecom - Vijay Yellapragada * mms.mtn.co.za / MTM South Africa - Vijay Yellapragada * rci.rogers.com / Rogers of Canada - Vijay Yellapragada * mmsreply.t-mobile.co.uk / T-Mobile UK - Vijay Yellapragada * waw.plspictures.com / PLSPICTURES.COM mms hosting service ### 2.0.3 / 2008-04-15 (Enter Taxman - The 1040 MMS Form) * fix case when part is image/jpeg declared 'application/octet-stream' * trim dangling image/jpeg text from blackberry messages * file extensions added to filenames that are missing extensions in part headers * anonymize images in fixtures to reduce gem size * T-Mobile update - jesse dp * AT&T/T-Mobile Blackberrry update - Dave Myron ### 2.0.2 / 2008-02-22 (The Jomfru Brothers - proprietors of diefordethklok.com) * added support for mms.vodacom4me.co.za Vodacom South Africa - Jason Haruska * added support for bellsouth.net - Jason Haruska * added support for mms.mycricket.com * Improved Blackberry and iPhone suport - Jason Haruska * added :number key to configuration to provide rules for specifying alternative phone number location * return sender's phone number for mobile.indosat.net.id * return sender's phone number for mms.luxgsm.lu * return sender's phone number for mms.vodacom4me.co.za ### 2.0.1 / 2008-02-08 (Professor Jerry Gustav Munndig - Child control expert) * strip out common blackberry and iPhone signatures * handle carriers that use external mail services such as Yahoo! as the From address * Add support for mobile.indosat.net.id (and yahoo.co.id) - Jason Haruska * Add support for sms.sasktel.com - Jason Haruska ### 2.0.0 / 2008-01-23 (Skwisgaar Skwigelf - fastest guitarist alive) * added support for pxt.vodafone.net.nz PXT New Zealand * added support for mms.o2online.de O2 Germany * added support for orangemms.net Orange UK * added support for txt.att.net AT&T * added support for mms.luxgsm.lu LUXGSM S.A. * added support for mms.netcom.no NetCom (Norway) * added support for mms.three.co.uk Hutchison 3G UK Ltd * removed deprecated #get_number use #number * removed deprecated #get_subject use #subject * removed deprecated #get_body use #body * removed deprecated #get_media use #default_media * removed deprecated #get_text use #default_text * removed deprecated #get_attachment use #attachment * fixed error when Sprint content server responds 500 * better yaml configs * moved TMail dependency from Rails ActionMailer SVN to 'official' Gem * ::new greedily processes MMS unless otherwise specified as an initialize option :process => :lazy * logger moved to initialize option :logger => some_logger * testing using mocks and stubs instead of duck raped Net::HTTP * fixed typo in name of method #attachement to #attachment * fixed broken downloading of Sprint videos ### 1.1.12 / 2007-10-21 (Dr. Ronald von Moldenberg - Endorsement specialist) * fetch original images from Sprint content server (Layton Wedgeworth) * ignore Sprint messages when requested content has been purged from their content server ### 1.1.11 / 2007-10-20 (Dr. Armand Skagerakk Frederickshaven - Mythology expert) * minor fix for attachment_fu where it might call #path on the cgi temp file that is returned by get_attachment * renamed a_t_t_media.rb to att_media.rb to make it autotest happy * masthead.jpg misplaced in mms2r_t_mobile_media_ignore.yml (Layton Wedgeworth) * overridden SprintMedia#process failed to accept block (Layton Wedgeworth) * added method_deprecated to help mark methods that are going to be deprecated in preparation of 1.2.x release * #get_number marked deprecated, use #number instead * #get_subject marked deprecated, use #subject instead * #get_body marked deprecated, use #body instead * #get_text marked deprecated, use #default_text instead * #get_attachment marked deprecated, use #attachment instead * #get_media marked deprecated, use #default_media instead ### 1.1.10 / 2007-09-30 (Face Bones) * fixed a case for a nil match on From in the create method (Luke Francl) * added support for Alltel message.alltel.com (Ben Wood) ### 1.1.9 / 2007-09-08 (Rebecca Nightrod - controlling girlfriend of Nathan Explosion) * fixed broken support for act_as_attachment and attachment_fu ### 1.1.8 / 2007-09-08 (James Grishnack - Head of Behemoth Productions, producer of Blood Ocean) * Added support for Orange of France, Orange orange.fr (Julian Biard) * purge in the process block removed, purge must be called explicitly after processing to clean up extracted temporary media files. ### 1.1.7 / 2007-08-25 (Adam Nergal, friend of Skwisgaar, but not Pickles) * Added support for Orange of Poland, Orange mmsemail.orange.pl (Zbigniew Sobiecki) * Cleaned up documentation modifiers * Cleaned out non-Ruby code idioms ### 1.1.6 / 2007-08-11 (Mustakrakish, the Lake Troll part 2) * Redo of release mistake of 1.1.5 ### 1.1.5 / 2007-08-11 (Mustakrakish, the Lake Troll) * AT&T => mms.att.net not clearing out default "multimedia message" subject to nil (Will Jessup) * Ignore case on default subject for all carriers in corresponding conf/mms2r_XXX_media_subject.yml ### 1.1.4 / 2007-08-07 (Dr. Rockso) * AT&T => mms.att.net support (thanks Mike Chen and Dave Myron) * get_body returns nil when there is not user text (sorry Will!) ### 1.1.3 / 2007-07-10 (Charles Foster Ofdensen) * Helio support by Will Jessup * get_subject returns nil on default carrier subjects ### 1.1.2 / 2007-06-13 (Dethklok roadie #2) * placed versioned hpricot dependency in Hoe's extra_deps (an attempt to appease firebrigade gods or not cause Gem::RemoteInstallationCancelled whichever you prefer) ### 1.1.1 / 2007-06-11 (Dethklok roadie) * rescue rcov non-dependency in Rakefile to make firebrigade happy ### 1.1.0 / 2007-06-08 (Toki Wartooth) * get_body to return body text (Luke Francl) * get_subject returns "" for default subjects now * default subjects listed in yaml by carrier in conf directory * added granularity to Cingular, Sprint, and Verizon carrier services (Will Jessup) * refactored Sprint instance to process all media (Will Jessup + Mike) * optimized text transformations (Will Jessup) * properly handle ISO-8859-1 and UTF-8 text (Will Jessup) * autotest powers activate! (ZenTest autotest discovery enabled) * configuration file ignores, transforms, and subjects all store Regexp's * Put vendor Text::Format & TMail::Mail as an external subversion dependency to the 1.2 stable branch of Rails ActionMailer * added get_number method to return the phone number associated with this MMS * get_media and get_text attachment_fu helper return the largest piece of media of that type if the more than one exits in the media (Luke Francl) * added block support to process() method (Shane Vitarana) ### 1.0.7 / 2007-04-27 (Senator Stampingston) * patch submitted by Luke Francl * added a get_subject method that returns nil when any MMS has a default carrier subject * get_subject returns nil for '', 'Multimedia message', '(no subject)', 'You have new Picture Mail!' ### 1.0.6 / 2007-04-24 (Pickles the Drummer) * patch submitted by Luke Francl * added support for mms.dobson.net (Dobson aka Cellular One) (Luke) * DRY'd up unit tests (Luke) * added get_media instance method that returns first video or image as File (Luke) * File from get_media can be used by/with attachment_fu (Luke) * added get_text instance method that returns first non advertising text * File from get_text can be used by/with attachment_fu ### 1.0.5 / 2007-04-10 (William Murderface) * patch submitted by Luke Francl * made ignore_media? start its text check from the start of the file (Luke) * added new text transform for Verizon messages (Luke) * updated Nextel ignore conf (Luke) * added additional samples and tests for T-Mobile & Verizon (Luke) * cleaned up MMS2R::Media documentation * added Sprint broken image test for when media goes stale on their content server * fixed teardown typo in lots of plases * added tests for 4 three samples of unique variants of Sprint/Nextel text * 100% test coverage! ### 1.0.4 / 2007-04-09 (Metalocalypse) * fix teardown in test_mms2r_sprint.rb (shanesbrain.net) * clean up Net::HTTP in MMS2R::SprintMedia (shanesbrain.net) * added accessor MMS2R::Media.media_dir * fixed a nil issue with underlying tmp working dir * added exception handling around Net::HTTP in MMS2R::SprintMedia ### 1.0.3 / 2007-04-05 (Paper Cut) * Cleaned up packaging and errors in example found by Shane V. http://shanesbrain.net/ ### 1.0.2 / 2007-03-07 * Reorganized tests and fixtures * Added carriers: * Cingular => cingularme.com * Nextel => messaging.nextel.com * Verizon => vtext.com ### 1.0.1 / 2007-03-07 * Flubbed RubyForge release ... do not use this. ### 1.0.0 / 2007-03-06 * Birthday! * AT&T/Cingular => mmode.com * Cingular => mms.mycingular.com * Sprint => pm.sprint.com * Sprint => messaging.sprintpcs.com * T-Mobile => tmomail.net * Verizon => vzwpix.com diff --git a/Rakefile b/Rakefile index 005e57e..3456fa8 100644 --- a/Rakefile +++ b/Rakefile @@ -1,49 +1,44 @@ # -*- ruby -*- begin require 'hoe' rescue LoadError require 'rubygems' require 'hoe' end -begin - require 'rcov/rcovtask' -rescue LoadError -end - $LOAD_PATH.unshift File.join(File.dirname(__FILE__), "lib") require 'mms2r' require 'rake' Hoe.plugin :bundler Hoe.spec('mms2r') do |p| p.version = MMS2R::Media::VERSION p.rubyforge_name = 'mms2r' p.author = ['Mike Mondragon'] p.email = ['[email protected]'] p.summary = 'Extract user media from MMS (and not carrier cruft)' p.description = p.paragraphs_of('README.txt', 2..5).join("\n\n") p.url = p.paragraphs_of('README.txt', 1).first.strip p.changes = p.paragraphs_of('History.txt', 0..1).join("\n\n") p.readme_file = 'README.txt' p.history_file = 'History.txt' p.extra_deps << ['nokogiri', '>= 1.4.4'] p.extra_deps << ['mail', '>= 2.2.10'] p.extra_deps << ['uuidtools', '>= 2.1.1'] p.extra_deps << ['exifr', '>= 1.0.3'] p.clean_globs << 'coverage' end begin require 'rcov/rcovtask' Rcov::RcovTask.new do |rcov| rcov.pattern = 'test/**/test_*.rb' rcov.verbose = true rcov.rcov_opts << "--exclude rcov.rb" end rescue task :rcov => :check_dependencies end # vim: syntax=Ruby diff --git a/lib/mms2r.rb b/lib/mms2r.rb index 8691010..e649900 100644 --- a/lib/mms2r.rb +++ b/lib/mms2r.rb @@ -1,76 +1,76 @@ #-- # Copyright (c) 2007-2010 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ module MMS2R ## # A hash of MMS2R processors keyed by MMS carrier domain. CARRIERS = {} ## # Registers a class as a processor for a MMS domain. Should only be # used in special cases such as MMS2R::Media::Sprint for 'pm.sprint.com' def self.register(domain, processor_class) MMS2R::CARRIERS[domain] = processor_class end ## # A hash of file extensions for common mime-types EXT = { 'text/plain' => 'text', 'text/plain' => 'txt', 'text/html' => 'html', 'image/png' => 'png', 'image/gif' => 'gif', 'image/jpeg' => 'jpeg', 'image/jpeg' => 'jpg', 'video/quicktime' => 'mov', 'video/3gpp2' => '3g2' } class MMS2R::Media ## # MMS2R library version - VERSION = '3.5.0' + VERSION = '3.5.1' ## # Spoof User-Agent, primarily for the Sprint CDN USER_AGENT = "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C28 Safari/419.3" end # Simple convenience function to make it a one-liner: # MMS2R.parse raw_mail or MMS2R.parse File.load(raw_mail) # Combined w/ the method_missing delegation, this should behave as an enhanced Mail object, more or less. def self.parse raw_mail mail = Mail.new raw_mail MMS2R::Media.new(mail) end end %W{ yaml mail fileutils pathname tmpdir yaml digest/sha1 iconv exifr }.each do |g| begin require g rescue LoadError require 'rubygems' require g end end # HAX to not deal with Psych YAML parser in Ruby >= 1.9 #YAML::ENGINE.yamler= 'syck' if defined?(YAML::ENGINE) require File.join(File.dirname(__FILE__), 'ext/mail') require File.join(File.dirname(__FILE__), 'ext/object') require File.join(File.dirname(__FILE__), 'mms2r/media') require File.join(File.dirname(__FILE__), 'mms2r/media/sprint') MMS2R.register('pm.sprint.com', MMS2R::Media::Sprint) diff --git a/lib/mms2r/media/sprint.rb b/lib/mms2r/media/sprint.rb index 06250ea..217fbab 100644 --- a/lib/mms2r/media/sprint.rb +++ b/lib/mms2r/media/sprint.rb @@ -1,195 +1,196 @@ #-- # Copyright (c) 2007-2010 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ require 'net/http' require 'nokogiri' require 'cgi' module MMS2R class Media ## # Sprint version of MMS2R::Media # # Sprint is an annoying carrier because they don't actually transmit user # generated content (like images or videos) directly in the MMS message. # Instead, they hijack the media that is sent from the cellular subscriber # and place that content on a content server. In place of the media # the recipient receives a HTML message with unsolicited Sprint # advertising and links back to their content server. The recipient has # to click through Sprint more pages to view the content. # # The default subject on these messages from the # carrier is "You have new Picture Mail!" module Sprint ## # Override process() because Sprint doesn't attach media (images, video, # etc.) to its MMS. Media such as images and videos are hosted on a # Sprint content server. MMS2R::Media::Sprint has to pick apart an # HTML attachment to find the URL to the media on Sprint's content # server and download each piece of content. Any text message part of # the MMS if it exists is embedded in the html. def process unless @was_processed log("#{self.class} processing", :info) #sprint MMS are multipart parts = @mail.parts #find the payload html doc = nil parts.each do |p| next unless p.part_type? == 'text/html' d = Nokogiri(p.body.decoded) title = d.at('title').inner_html if title =~ /You have new Picture Mail!/ doc = d @is_video = (p.body.decoded =~ /type=&quot;VIDEO&quot;&gt;/m ? true : false) end end return if doc.nil? # it was a dud @is_video ||= false # break it down sprint_phone_number(doc) sprint_process_text(doc) sprint_process_media(doc) @was_processed = true end # when process acts upon a block if block_given? media.each do |k, v| yield(k, v) end end end private ## # Digs out where Sprint hides the phone number def sprint_phone_number(doc) c = doc.search("/html/head/comment()").last t = c.content.gsub(/\s+/m," ").strip #@number returned in parent's #number @number = / name=&quot;MDN&quot;&gt;(\d+)&lt;/.match(t)[1] end ## # Pulls out the user text form the MMS and adds the text to media hash def sprint_process_text(doc) # there is at least one <pre> with MMS text if text has been included by # the user. (note) we'll have to verify that if they attach multiple texts # to the MMS then Sprint stacks it up in multiple <pre>'s. The only <pre> # tag in the document is for text from the user. doc.search("/html/body//pre").each do |pre| type = 'text/plain' text = pre.inner_html.strip next if text.empty? type, text = transform_text(type, text) type, file = sprint_write_file(type, text.strip) add_file(type, file) unless type.nil? || file.nil? end end ## # Fetch all the media that is referred to in the doc def sprint_process_media(doc) srcs = Array.new # collect all the images in the document, even though # they are <img> tag some might actually refer to video. # To know the link refers to vide one must look at the # content type on the http GET response. imgs = doc.search("/html/body//img") imgs.each do |i| src = i.attributes['src'] next unless src src = src.text # we don't want to double fetch content and we only # want to fetch media from the content server, you get # a clue about that as there is a RECIPIENT in the URI path # of real content next unless /mmps\/RECIPIENT\//.match(src) next if srcs.detect{|s| s.eql?(src)} srcs << src end #we've got the payload now, go fetch them cnt = 0 srcs.each do |src| begin uri = URI.parse(CGI.unescapeHTML(src)) unless @is_video query={} uri.query.split('&').each{|a| p=a.split('='); query[p[0]] = p[1]} query.delete_if{|k, v| k == 'limitsize' or k == 'squareoutput' } uri.query = query.map{|k,v| "#{k}=#{v}"}.join("&") end # sprint is a ghetto, they expect to see &amp; for video request uri.query = uri.query.gsub(/&/, "&amp;") if @is_video connection = Net::HTTP.new(uri.host, uri.port) response, content = connection.get( uri.request_uri, { "User-Agent" => MMS2R::Media::USER_AGENT } ) rescue StandardError => err log("#{self.class} processing error, #{$!}", :error) next end # if the Sprint content server uses response code 500 when the content is purged # the content type will text/html and the body will be the message if response.content_type == 'text/html' && response.code == "500" log("Sprint content server returned response code 500", :error) next end # setup the file path and file base = /\/RECIPIENT\/([^\/]+)\//.match(src)[1] type = response.content_type file_name = "#{base}-#{cnt}.#{self.class.default_ext(type)}" file = File.join(msg_tmp_dir(),File.basename(file_name)) # write it and add it to the media hash type, file = sprint_write_file(type, content, file) add_file(type, file) unless type.nil? || file.nil? cnt = cnt + 1 end end ## # Creates a temporary file based on the type def sprint_temp_file(type) file_name = "#{Time.now.to_f}.#{self.class.default_ext(type)}" File.join(msg_tmp_dir(),File.basename(file_name)) end ## # Writes the content to a file and returns the type, file as a tuple. def sprint_write_file(type, content, file = nil) file = sprint_temp_file(type) if file.nil? log("#{self.class} writing file #{file}", :info) # force the encoding to be utf-8 - File.open(file,'w'){ |f| f.write(content.force_encoding("UTF-8")) } + content = content.force_encoding("UTF-8") if content.respond_to?(:force_encoding) + File.open(file,'w'){ |f| f.write(content) } return type, file end end end end diff --git a/test/test_helper.rb b/test/test_helper.rb index 3e0e1cc..a3ecc50 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,102 +1,102 @@ # do it like rake http://ozmm.org/posts/do_it_like_rake.html -%W{ test/unit set net/http net/https pp tempfile mocha }.each do |g| +%W{ test/unit set net/http net/https pp tempfile mocha rcov/rcovtask }.each do |g| begin require g rescue LoadError require 'rubygems' require g end end # NOTE when we upgrade to test-unit 2.x.x or greater we'll not need redgreen, # it's baked into test-unit begin require 'redgreen'; rescue LoadError; end require File.join(File.expand_path(File.dirname(__FILE__)), '..', 'lib', 'mms2r') module MMS2R module TestHelper def assert_file_size(file, size) assert_not_nil(file, "file was nil") assert(File::exist?(file), "file #{file} does not exist") assert(File::size(file) == size, "file #{file} is #{File::size(file)} bytes, not #{size} bytes") end def fixture(file) File.join(File.expand_path(File.dirname(__FILE__)), "fixtures", file) end def fixture_data(name) open(fixture(name)).read end def mail_fixture(file) fixture(file) end def mail(name) Mail.read(mail_fixture(name)) end def smart_phone_mock(make_text = 'Apple', model_text = 'iPhone', software_text = nil, jpeg = true) mail = stub('mail', :from => ['[email protected]'], :return_path => '<[email protected]>', :message_id => 'abcd0123', :multipart? => true, :header => {}) part = stub('part', :part_type? => "image/#{jpeg ? 'jpeg' : 'tiff'}", :body => Mail::Body.new('abc'), :multipart? => false, :filename => "foo.#{jpeg ? 'jpg' : 'tif'}" ) mail.stubs(:parts).returns([part]) exif = stub('exif', :make => make_text, :model => model_text, :software => software_text) if jpeg EXIFR::JPEG.expects(:new).at_least_once.returns(exif) else EXIFR::TIFF.expects(:new).at_least_once.returns(exif) end mail end end end class Hash def except(*keys) rejected = Set.new(respond_to?(:convert_key) ? keys.map { |key| convert_key(key) } : keys) reject { |key,| rejected.include?(key) } end def except!(*keys) replace(except(*keys)) end end # monkey patch Net::HTTP so un caged requests don't go over the wire module Net #:nodoc: class HTTP #:nodoc: alias :old_net_http_request :request alias :old_net_http_connect :connect def request(req, body = nil, &block) prot = use_ssl ? "https" : "http" uri_cls = use_ssl ? URI::HTTPS : URI::HTTP query = req.path.split('?',2) opts = {:host => self.address, :port => self.port, :path => query[0]} opts[:query] = query[1] if query[1] uri = uri_cls.build(opts) raise ArgumentError.new("#{req.method} method to #{uri} not being handled in testing") end def connect raise ArgumentError.new("connect not being handled in testing") end end end
monde/mms2r
2750c8d8d0beaf2e0d20cee130b1fc23d733eee1
Force encoding of temp file to be utf-8.
diff --git a/lib/mms2r/media/sprint.rb b/lib/mms2r/media/sprint.rb index 567386a..06250ea 100644 --- a/lib/mms2r/media/sprint.rb +++ b/lib/mms2r/media/sprint.rb @@ -1,194 +1,195 @@ #-- # Copyright (c) 2007-2010 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ require 'net/http' require 'nokogiri' require 'cgi' module MMS2R class Media ## # Sprint version of MMS2R::Media # # Sprint is an annoying carrier because they don't actually transmit user # generated content (like images or videos) directly in the MMS message. # Instead, they hijack the media that is sent from the cellular subscriber # and place that content on a content server. In place of the media # the recipient receives a HTML message with unsolicited Sprint # advertising and links back to their content server. The recipient has # to click through Sprint more pages to view the content. # # The default subject on these messages from the # carrier is "You have new Picture Mail!" module Sprint ## # Override process() because Sprint doesn't attach media (images, video, # etc.) to its MMS. Media such as images and videos are hosted on a # Sprint content server. MMS2R::Media::Sprint has to pick apart an # HTML attachment to find the URL to the media on Sprint's content # server and download each piece of content. Any text message part of # the MMS if it exists is embedded in the html. def process unless @was_processed log("#{self.class} processing", :info) #sprint MMS are multipart parts = @mail.parts #find the payload html doc = nil parts.each do |p| next unless p.part_type? == 'text/html' d = Nokogiri(p.body.decoded) title = d.at('title').inner_html if title =~ /You have new Picture Mail!/ doc = d @is_video = (p.body.decoded =~ /type=&quot;VIDEO&quot;&gt;/m ? true : false) end end return if doc.nil? # it was a dud @is_video ||= false # break it down sprint_phone_number(doc) sprint_process_text(doc) sprint_process_media(doc) @was_processed = true end # when process acts upon a block if block_given? media.each do |k, v| yield(k, v) end end end private ## # Digs out where Sprint hides the phone number def sprint_phone_number(doc) c = doc.search("/html/head/comment()").last t = c.content.gsub(/\s+/m," ").strip #@number returned in parent's #number @number = / name=&quot;MDN&quot;&gt;(\d+)&lt;/.match(t)[1] end ## # Pulls out the user text form the MMS and adds the text to media hash def sprint_process_text(doc) # there is at least one <pre> with MMS text if text has been included by # the user. (note) we'll have to verify that if they attach multiple texts # to the MMS then Sprint stacks it up in multiple <pre>'s. The only <pre> # tag in the document is for text from the user. doc.search("/html/body//pre").each do |pre| type = 'text/plain' text = pre.inner_html.strip next if text.empty? type, text = transform_text(type, text) type, file = sprint_write_file(type, text.strip) add_file(type, file) unless type.nil? || file.nil? end end ## # Fetch all the media that is referred to in the doc def sprint_process_media(doc) srcs = Array.new # collect all the images in the document, even though # they are <img> tag some might actually refer to video. # To know the link refers to vide one must look at the # content type on the http GET response. imgs = doc.search("/html/body//img") imgs.each do |i| src = i.attributes['src'] next unless src src = src.text # we don't want to double fetch content and we only # want to fetch media from the content server, you get # a clue about that as there is a RECIPIENT in the URI path # of real content next unless /mmps\/RECIPIENT\//.match(src) next if srcs.detect{|s| s.eql?(src)} srcs << src end #we've got the payload now, go fetch them cnt = 0 srcs.each do |src| begin uri = URI.parse(CGI.unescapeHTML(src)) unless @is_video query={} uri.query.split('&').each{|a| p=a.split('='); query[p[0]] = p[1]} query.delete_if{|k, v| k == 'limitsize' or k == 'squareoutput' } uri.query = query.map{|k,v| "#{k}=#{v}"}.join("&") end # sprint is a ghetto, they expect to see &amp; for video request uri.query = uri.query.gsub(/&/, "&amp;") if @is_video connection = Net::HTTP.new(uri.host, uri.port) response, content = connection.get( uri.request_uri, { "User-Agent" => MMS2R::Media::USER_AGENT } ) rescue StandardError => err log("#{self.class} processing error, #{$!}", :error) next end # if the Sprint content server uses response code 500 when the content is purged # the content type will text/html and the body will be the message if response.content_type == 'text/html' && response.code == "500" log("Sprint content server returned response code 500", :error) next end # setup the file path and file base = /\/RECIPIENT\/([^\/]+)\//.match(src)[1] type = response.content_type file_name = "#{base}-#{cnt}.#{self.class.default_ext(type)}" file = File.join(msg_tmp_dir(),File.basename(file_name)) # write it and add it to the media hash type, file = sprint_write_file(type, content, file) add_file(type, file) unless type.nil? || file.nil? cnt = cnt + 1 end end ## # Creates a temporary file based on the type def sprint_temp_file(type) file_name = "#{Time.now.to_f}.#{self.class.default_ext(type)}" File.join(msg_tmp_dir(),File.basename(file_name)) end ## # Writes the content to a file and returns the type, file as a tuple. def sprint_write_file(type, content, file = nil) file = sprint_temp_file(type) if file.nil? log("#{self.class} writing file #{file}", :info) - File.open(file,'w'){ |f| f.write(content) } + # force the encoding to be utf-8 + File.open(file,'w'){ |f| f.write(content.force_encoding("UTF-8")) } return type, file end end end end
monde/mms2r
87922706d4d4b6bd237b5e763a3e42740ef8950d
Bug fix for fetching content from Sprint's CDN in Ruby 1.9.X runtimes. Version bump.
diff --git a/History.txt b/History.txt index e147de0..66fe0b4 100644 --- a/History.txt +++ b/History.txt @@ -1,388 +1,396 @@ +### 3.5.0 / 2011-12-01 (Dr. Milminiman Lamilim Swimwambli - Marriage expert) + +* 1 major bug fix + * In Ruby 1.9.X MMS2R::Media::Sprint was not fetching content from Sprint's + CDN correctly because the implementation of Net::HTTP in 1.9.X passes a + User-Agent header of "Ruby" to which Sprint responds with a fake 500 - + with help from James McGrath + ### 3.4.1 / 2011-11-06 (Fatty Ding-Dongs, Dethklok foster child) * 2 major enhancements * Additional means to detect android, iphone, motorola, nokia, palm handsets * Additional known SMS/MMS domains mm.att.net, labwig.net, cdma.sasktel.com ### 3.4.0 / 2011-10-31 (Serveta Skwigelf, Skwisgaar's hot mom) * 2 major enhancements * regexp's in yaml configs are store as a ruby regexp and not a string that is evaled. * character encoding capability with 1.8 rubies and 1.9 rubies. ### 3.3.1 / 2011-01-01 (Reverend Aslaug Wartooth (deceased), Toki's dad) * 2 minor enhancements * new method #default_html returns the default html attachment * #body will return the default plain text, or default stripped html text ### 3.3.0 / 2010-12-31 (Charles Foster Offdensen - CFO, dethklok) * 1 major enhancement * MMS2R::Media::Sprint is now a module that is extended in for processing Sprint content rather than being child class of MMS2R::Media Extension is the strategy to use for overwriting template methods now * 1 minor enhancement * process new Sprint subject - Jason Hooper * new SaskTel mms/sms domain alias sasktel.com * new Virgin Mobile mms/sms domain alias yrmobl.com ### 3.2.0 / 2010-08-17 (Antonio "Tony" DiMarco Thunderbottom - bassist) * 3 minor enhancements * updated readme with latest sites known to use mms2r * bundler assimilated * loading rubygems only if it's required, like rake ### 3.1.0 / 2010-07-09 (Dick "Magic Ears" Knubbler - music producer) * 8 minor enhancements * Detects additional Bell/AT&T domain sbcglobal.net as a handset * Detects additional Virgin mobile domains pixmbl.com vmobl.com as a handset * Expanded mobile phone detection for handset makers by : Casio, Google Nexus One, LG Electronics, Motorola, Pantech, Qualcom, Samsung, Sprint, UTStarCom * EXIF Reader (exifr) is integral to MMS2R and is now a required gem * upgrade Mail to 2.2.5 * depend on latest gems * corrected example - Jason Hooper * added As Seen On The Internet to README that lists sites known to be using MMS2R in some fashion ### 3.0.1 / 2010-03-28 (Lavona Succuboso - leader of "Succuboso Explosion") * 1 minor enhancement * support for U.S. Cellular ### 3.0.0 / 2010-02-24 (General Crozier - Chairman of the Joint Chiefs of Staff) * 1 new feature * dependence upon Mail gem rather than TMail gem ### 2.4.1 / 2010-02-07 (Vater Orlaag - political and spiritual specialist) * 3 minor enhancements * make sure filename is free of new lines - laurynas * recognize HTC HERO200 as a smart phone * recognize HTC Eris as a smart phone ### 2.4.0 / 2009-12-20 (Dr. Nanemiltred Philtendrieden - specialist on celebrity death) * 1 new feature * replace Hpricot with Nokogiri for html parsing of Sprint data * 3 minor enhancements * smartphone identities stored in conf/mms2r_media.yml * identify Motorola Droid as a smartphone * identify T-Mobile Dash as a smartphone * use uuidtools for naming temp directories - kbaum ### 2.3.0 / 2009-08-30 (Snakes 'n' Barrels Greatest Hits) * 5 new features * detect smartphone status/type based on model metadata from jpeg and tiff exif data using exifr gem, access exif data with MMS2R::Media#exif * make MMS2R Rails gem packaging friendly with an init.rb - Scott Taylor, smtlaissezfaire * delegate missing methods to mms2r's tmail object so that mms2r behaves as if it were a tmail object - Sai Emrys, saizai * default_media can return an attachment of application content type - Brendan Lim, brendanlim * MMS2R.parse(raw_mail) convenience class method that parses and returns an mms2r from a mail file - saizai * 4 minor enhancements * make examples more 'mail' specific to enforce the fact that an mms is a multipart email - saizai * update for text in vzwpix.com default carrier message * detecting smartphone (blackberries and iphones for now) is more versatile from reading mail headers * expanded filtering of carrier advertising text in mms from smartphones ### 2.2.0 / 2009-01-04 (Rikki Kixx - owner of a franchise of rehab centers) * 3 new features * MMS2R::Media#is_mobile? best guess if the sender was a mobile device * MMS2R::Media#device_type? best guess of the mobile device type. Simple heuristics thus far for :blackberry :iphone :handset :unknown could be expanded for exif probing or additinal shifting of mail header * from array in conf/from.yml to provide granularity to determine carrier domain (caused by tmo.blackberry.net) * 4 minor enhancements * support for Virgin Canada messaging service vmobile.ca * support for text service messaging.sprintpcs.com * additional BlackBerry coverage from T-Mobile tmo.blackberry.net provider * legacy support for mobile.mycingular.com, pics.cingularme.com * 3 bug fixes * iPhone default subject - jesse dp http://rubyforge.org/tracker/?func=detail&atid=11789&aid=22951&group_id=3065 * add sprintpcs.com to pm.sprint.com aliases * fix OS X long filename issues - Matt Conway ### 2.1.3 / 2008-11-06 (Dr. Ramonolith Chesterfield - Military pharmaceutical psychotropic drug manufacturing expert * 1 minor enhancement * added mms.ae support ### 2.1.2 / 2008-10-21 (Toki's mom, Anja Wartooth) * 2 minor enhancments * Sprint subject update - jesse dp * Virgin Mobile support vmpix.com ### 2.1.1 / 2008-09-24 (Lavona Succuboso, Nathan Explosion uber-groupie) * 4 minor enhancments * Bell Canada support txt.bell.ca - Matt Conway / Snap My Life - http://github.com/wr0ngway, http://github.com/sml * Unicel support unicel.com - Michael DelGaudio * info2go.com support / Unicel * TELUS Corporation support mms.telusmobility.com, msg.telus.com * add test to check that gem builds correctly as a github gem * 1 bug fix * Iconv utf8 fix - Kai Kai ### 2.1.0 / 2008-07-30 (Dr. Gibbons – Birthday expert and Murderface expert) * 1 major enhancement: * opens up TMail for improved query method patterned code in MMS2R * 2 minor enhancements: * UK O2 support mediamessaging.o2.co.uk - Jeremy Wilkins * Write non text files with binary bit set on Windows - David Alm * source hosted on github: git clone git://github.com/monde/mms2r.git ### 2.0.5 / 2008-07-17 (Dr. Ralphus Galkensmelter - Psychological death expert) * Deal with Apple Mail multipart/appledouble - jesse dp ### 2.0.4 / 2008-04-28 (Mr. Selatcia - elder member of The Tribunal) * updated mms.vodacom4me.co.za Vodacom South Africa - Vijay Yellapragada * 1nbox.net / Idea cellular 1nbox.net - Vijay Yellapragada * mms.3ireland.ie / 3 Ireland - Vijay Yellapragada * mms.alltel.com / Alltel (reverted message.alltel.com) - Vijay Yellapragada * mms.mobileiam.ma / Maroc Telecom - Vijay Yellapragada * mms.mtn.co.za / MTM South Africa - Vijay Yellapragada * rci.rogers.com / Rogers of Canada - Vijay Yellapragada * mmsreply.t-mobile.co.uk / T-Mobile UK - Vijay Yellapragada * waw.plspictures.com / PLSPICTURES.COM mms hosting service ### 2.0.3 / 2008-04-15 (Enter Taxman - The 1040 MMS Form) * fix case when part is image/jpeg declared 'application/octet-stream' * trim dangling image/jpeg text from blackberry messages * file extensions added to filenames that are missing extensions in part headers * anonymize images in fixtures to reduce gem size * T-Mobile update - jesse dp * AT&T/T-Mobile Blackberrry update - Dave Myron ### 2.0.2 / 2008-02-22 (The Jomfru Brothers - proprietors of diefordethklok.com) * added support for mms.vodacom4me.co.za Vodacom South Africa - Jason Haruska * added support for bellsouth.net - Jason Haruska * added support for mms.mycricket.com * Improved Blackberry and iPhone suport - Jason Haruska * added :number key to configuration to provide rules for specifying alternative phone number location * return sender's phone number for mobile.indosat.net.id * return sender's phone number for mms.luxgsm.lu * return sender's phone number for mms.vodacom4me.co.za ### 2.0.1 / 2008-02-08 (Professor Jerry Gustav Munndig - Child control expert) * strip out common blackberry and iPhone signatures * handle carriers that use external mail services such as Yahoo! as the From address * Add support for mobile.indosat.net.id (and yahoo.co.id) - Jason Haruska * Add support for sms.sasktel.com - Jason Haruska ### 2.0.0 / 2008-01-23 (Skwisgaar Skwigelf - fastest guitarist alive) * added support for pxt.vodafone.net.nz PXT New Zealand * added support for mms.o2online.de O2 Germany * added support for orangemms.net Orange UK * added support for txt.att.net AT&T * added support for mms.luxgsm.lu LUXGSM S.A. * added support for mms.netcom.no NetCom (Norway) * added support for mms.three.co.uk Hutchison 3G UK Ltd * removed deprecated #get_number use #number * removed deprecated #get_subject use #subject * removed deprecated #get_body use #body * removed deprecated #get_media use #default_media * removed deprecated #get_text use #default_text * removed deprecated #get_attachment use #attachment * fixed error when Sprint content server responds 500 * better yaml configs * moved TMail dependency from Rails ActionMailer SVN to 'official' Gem * ::new greedily processes MMS unless otherwise specified as an initialize option :process => :lazy * logger moved to initialize option :logger => some_logger * testing using mocks and stubs instead of duck raped Net::HTTP * fixed typo in name of method #attachement to #attachment * fixed broken downloading of Sprint videos ### 1.1.12 / 2007-10-21 (Dr. Ronald von Moldenberg - Endorsement specialist) * fetch original images from Sprint content server (Layton Wedgeworth) * ignore Sprint messages when requested content has been purged from their content server ### 1.1.11 / 2007-10-20 (Dr. Armand Skagerakk Frederickshaven - Mythology expert) * minor fix for attachment_fu where it might call #path on the cgi temp file that is returned by get_attachment * renamed a_t_t_media.rb to att_media.rb to make it autotest happy * masthead.jpg misplaced in mms2r_t_mobile_media_ignore.yml (Layton Wedgeworth) * overridden SprintMedia#process failed to accept block (Layton Wedgeworth) * added method_deprecated to help mark methods that are going to be deprecated in preparation of 1.2.x release * #get_number marked deprecated, use #number instead * #get_subject marked deprecated, use #subject instead * #get_body marked deprecated, use #body instead * #get_text marked deprecated, use #default_text instead * #get_attachment marked deprecated, use #attachment instead * #get_media marked deprecated, use #default_media instead ### 1.1.10 / 2007-09-30 (Face Bones) * fixed a case for a nil match on From in the create method (Luke Francl) * added support for Alltel message.alltel.com (Ben Wood) ### 1.1.9 / 2007-09-08 (Rebecca Nightrod - controlling girlfriend of Nathan Explosion) * fixed broken support for act_as_attachment and attachment_fu ### 1.1.8 / 2007-09-08 (James Grishnack - Head of Behemoth Productions, producer of Blood Ocean) * Added support for Orange of France, Orange orange.fr (Julian Biard) * purge in the process block removed, purge must be called explicitly after processing to clean up extracted temporary media files. ### 1.1.7 / 2007-08-25 (Adam Nergal, friend of Skwisgaar, but not Pickles) * Added support for Orange of Poland, Orange mmsemail.orange.pl (Zbigniew Sobiecki) * Cleaned up documentation modifiers * Cleaned out non-Ruby code idioms ### 1.1.6 / 2007-08-11 (Mustakrakish, the Lake Troll part 2) * Redo of release mistake of 1.1.5 ### 1.1.5 / 2007-08-11 (Mustakrakish, the Lake Troll) * AT&T => mms.att.net not clearing out default "multimedia message" subject to nil (Will Jessup) * Ignore case on default subject for all carriers in corresponding conf/mms2r_XXX_media_subject.yml ### 1.1.4 / 2007-08-07 (Dr. Rockso) * AT&T => mms.att.net support (thanks Mike Chen and Dave Myron) * get_body returns nil when there is not user text (sorry Will!) ### 1.1.3 / 2007-07-10 (Charles Foster Ofdensen) * Helio support by Will Jessup * get_subject returns nil on default carrier subjects ### 1.1.2 / 2007-06-13 (Dethklok roadie #2) * placed versioned hpricot dependency in Hoe's extra_deps (an attempt to appease firebrigade gods or not cause Gem::RemoteInstallationCancelled whichever you prefer) ### 1.1.1 / 2007-06-11 (Dethklok roadie) * rescue rcov non-dependency in Rakefile to make firebrigade happy ### 1.1.0 / 2007-06-08 (Toki Wartooth) * get_body to return body text (Luke Francl) * get_subject returns "" for default subjects now * default subjects listed in yaml by carrier in conf directory * added granularity to Cingular, Sprint, and Verizon carrier services (Will Jessup) * refactored Sprint instance to process all media (Will Jessup + Mike) * optimized text transformations (Will Jessup) * properly handle ISO-8859-1 and UTF-8 text (Will Jessup) * autotest powers activate! (ZenTest autotest discovery enabled) * configuration file ignores, transforms, and subjects all store Regexp's * Put vendor Text::Format & TMail::Mail as an external subversion dependency to the 1.2 stable branch of Rails ActionMailer * added get_number method to return the phone number associated with this MMS * get_media and get_text attachment_fu helper return the largest piece of media of that type if the more than one exits in the media (Luke Francl) * added block support to process() method (Shane Vitarana) ### 1.0.7 / 2007-04-27 (Senator Stampingston) * patch submitted by Luke Francl * added a get_subject method that returns nil when any MMS has a default carrier subject * get_subject returns nil for '', 'Multimedia message', '(no subject)', 'You have new Picture Mail!' ### 1.0.6 / 2007-04-24 (Pickles the Drummer) * patch submitted by Luke Francl * added support for mms.dobson.net (Dobson aka Cellular One) (Luke) * DRY'd up unit tests (Luke) * added get_media instance method that returns first video or image as File (Luke) * File from get_media can be used by/with attachment_fu (Luke) * added get_text instance method that returns first non advertising text * File from get_text can be used by/with attachment_fu ### 1.0.5 / 2007-04-10 (William Murderface) * patch submitted by Luke Francl * made ignore_media? start its text check from the start of the file (Luke) * added new text transform for Verizon messages (Luke) * updated Nextel ignore conf (Luke) * added additional samples and tests for T-Mobile & Verizon (Luke) * cleaned up MMS2R::Media documentation * added Sprint broken image test for when media goes stale on their content server * fixed teardown typo in lots of plases * added tests for 4 three samples of unique variants of Sprint/Nextel text * 100% test coverage! ### 1.0.4 / 2007-04-09 (Metalocalypse) * fix teardown in test_mms2r_sprint.rb (shanesbrain.net) * clean up Net::HTTP in MMS2R::SprintMedia (shanesbrain.net) * added accessor MMS2R::Media.media_dir * fixed a nil issue with underlying tmp working dir * added exception handling around Net::HTTP in MMS2R::SprintMedia ### 1.0.3 / 2007-04-05 (Paper Cut) * Cleaned up packaging and errors in example found by Shane V. http://shanesbrain.net/ ### 1.0.2 / 2007-03-07 * Reorganized tests and fixtures * Added carriers: * Cingular => cingularme.com * Nextel => messaging.nextel.com * Verizon => vtext.com ### 1.0.1 / 2007-03-07 * Flubbed RubyForge release ... do not use this. ### 1.0.0 / 2007-03-06 * Birthday! * AT&T/Cingular => mmode.com * Cingular => mms.mycingular.com * Sprint => pm.sprint.com * Sprint => messaging.sprintpcs.com * T-Mobile => tmomail.net * Verizon => vzwpix.com diff --git a/lib/mms2r.rb b/lib/mms2r.rb index e781447..8691010 100644 --- a/lib/mms2r.rb +++ b/lib/mms2r.rb @@ -1,72 +1,76 @@ #-- # Copyright (c) 2007-2010 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ module MMS2R ## # A hash of MMS2R processors keyed by MMS carrier domain. CARRIERS = {} ## # Registers a class as a processor for a MMS domain. Should only be # used in special cases such as MMS2R::Media::Sprint for 'pm.sprint.com' def self.register(domain, processor_class) MMS2R::CARRIERS[domain] = processor_class end ## # A hash of file extensions for common mime-types EXT = { 'text/plain' => 'text', 'text/plain' => 'txt', 'text/html' => 'html', 'image/png' => 'png', 'image/gif' => 'gif', 'image/jpeg' => 'jpeg', 'image/jpeg' => 'jpg', 'video/quicktime' => 'mov', 'video/3gpp2' => '3g2' } class MMS2R::Media ## # MMS2R library version - VERSION = '3.4.1' + VERSION = '3.5.0' + ## + # Spoof User-Agent, primarily for the Sprint CDN + + USER_AGENT = "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C28 Safari/419.3" end # Simple convenience function to make it a one-liner: # MMS2R.parse raw_mail or MMS2R.parse File.load(raw_mail) # Combined w/ the method_missing delegation, this should behave as an enhanced Mail object, more or less. def self.parse raw_mail mail = Mail.new raw_mail MMS2R::Media.new(mail) end end %W{ yaml mail fileutils pathname tmpdir yaml digest/sha1 iconv exifr }.each do |g| begin require g rescue LoadError require 'rubygems' require g end end # HAX to not deal with Psych YAML parser in Ruby >= 1.9 #YAML::ENGINE.yamler= 'syck' if defined?(YAML::ENGINE) require File.join(File.dirname(__FILE__), 'ext/mail') require File.join(File.dirname(__FILE__), 'ext/object') require File.join(File.dirname(__FILE__), 'mms2r/media') require File.join(File.dirname(__FILE__), 'mms2r/media/sprint') MMS2R.register('pm.sprint.com', MMS2R::Media::Sprint) diff --git a/lib/mms2r/media/sprint.rb b/lib/mms2r/media/sprint.rb index 01852b9..567386a 100644 --- a/lib/mms2r/media/sprint.rb +++ b/lib/mms2r/media/sprint.rb @@ -1,190 +1,194 @@ #-- # Copyright (c) 2007-2010 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ require 'net/http' require 'nokogiri' require 'cgi' module MMS2R class Media ## # Sprint version of MMS2R::Media # # Sprint is an annoying carrier because they don't actually transmit user # generated content (like images or videos) directly in the MMS message. # Instead, they hijack the media that is sent from the cellular subscriber # and place that content on a content server. In place of the media # the recipient receives a HTML message with unsolicited Sprint # advertising and links back to their content server. The recipient has # to click through Sprint more pages to view the content. # # The default subject on these messages from the # carrier is "You have new Picture Mail!" module Sprint ## # Override process() because Sprint doesn't attach media (images, video, # etc.) to its MMS. Media such as images and videos are hosted on a # Sprint content server. MMS2R::Media::Sprint has to pick apart an # HTML attachment to find the URL to the media on Sprint's content # server and download each piece of content. Any text message part of # the MMS if it exists is embedded in the html. def process unless @was_processed log("#{self.class} processing", :info) #sprint MMS are multipart parts = @mail.parts #find the payload html doc = nil parts.each do |p| next unless p.part_type? == 'text/html' d = Nokogiri(p.body.decoded) title = d.at('title').inner_html if title =~ /You have new Picture Mail!/ doc = d @is_video = (p.body.decoded =~ /type=&quot;VIDEO&quot;&gt;/m ? true : false) end end return if doc.nil? # it was a dud @is_video ||= false # break it down sprint_phone_number(doc) sprint_process_text(doc) sprint_process_media(doc) @was_processed = true end # when process acts upon a block if block_given? media.each do |k, v| yield(k, v) end end end private ## # Digs out where Sprint hides the phone number def sprint_phone_number(doc) c = doc.search("/html/head/comment()").last t = c.content.gsub(/\s+/m," ").strip #@number returned in parent's #number @number = / name=&quot;MDN&quot;&gt;(\d+)&lt;/.match(t)[1] end ## # Pulls out the user text form the MMS and adds the text to media hash def sprint_process_text(doc) # there is at least one <pre> with MMS text if text has been included by # the user. (note) we'll have to verify that if they attach multiple texts # to the MMS then Sprint stacks it up in multiple <pre>'s. The only <pre> # tag in the document is for text from the user. doc.search("/html/body//pre").each do |pre| type = 'text/plain' text = pre.inner_html.strip next if text.empty? type, text = transform_text(type, text) type, file = sprint_write_file(type, text.strip) add_file(type, file) unless type.nil? || file.nil? end end ## # Fetch all the media that is referred to in the doc def sprint_process_media(doc) srcs = Array.new # collect all the images in the document, even though # they are <img> tag some might actually refer to video. # To know the link refers to vide one must look at the # content type on the http GET response. imgs = doc.search("/html/body//img") imgs.each do |i| src = i.attributes['src'] next unless src src = src.text # we don't want to double fetch content and we only # want to fetch media from the content server, you get # a clue about that as there is a RECIPIENT in the URI path # of real content next unless /mmps\/RECIPIENT\//.match(src) next if srcs.detect{|s| s.eql?(src)} srcs << src end #we've got the payload now, go fetch them cnt = 0 srcs.each do |src| begin - url = URI.parse(CGI.unescapeHTML(src)) + uri = URI.parse(CGI.unescapeHTML(src)) unless @is_video query={} - url.query.split('&').each{|a| p=a.split('='); query[p[0]] = p[1]} + uri.query.split('&').each{|a| p=a.split('='); query[p[0]] = p[1]} query.delete_if{|k, v| k == 'limitsize' or k == 'squareoutput' } - url.query = query.map{|k,v| "#{k}=#{v}"}.join("&") + uri.query = query.map{|k,v| "#{k}=#{v}"}.join("&") end # sprint is a ghetto, they expect to see &amp; for video request - url.query = url.query.gsub(/&/, "&amp;") if @is_video + uri.query = uri.query.gsub(/&/, "&amp;") if @is_video - res = Net::HTTP.get_response(url) + connection = Net::HTTP.new(uri.host, uri.port) + response, content = connection.get( + uri.request_uri, + { "User-Agent" => MMS2R::Media::USER_AGENT } + ) rescue StandardError => err log("#{self.class} processing error, #{$!}", :error) next end # if the Sprint content server uses response code 500 when the content is purged # the content type will text/html and the body will be the message - if res.content_type == 'text/html' && res.code == "500" + if response.content_type == 'text/html' && response.code == "500" log("Sprint content server returned response code 500", :error) next end # setup the file path and file base = /\/RECIPIENT\/([^\/]+)\//.match(src)[1] - type = res.content_type + type = response.content_type file_name = "#{base}-#{cnt}.#{self.class.default_ext(type)}" file = File.join(msg_tmp_dir(),File.basename(file_name)) # write it and add it to the media hash - type, file = sprint_write_file(type, res.body, file) + type, file = sprint_write_file(type, content, file) add_file(type, file) unless type.nil? || file.nil? cnt = cnt + 1 end end ## # Creates a temporary file based on the type def sprint_temp_file(type) file_name = "#{Time.now.to_f}.#{self.class.default_ext(type)}" File.join(msg_tmp_dir(),File.basename(file_name)) end ## # Writes the content to a file and returns the type, file as a tuple. def sprint_write_file(type, content, file = nil) file = sprint_temp_file(type) if file.nil? log("#{self.class} writing file #{file}", :info) File.open(file,'w'){ |f| f.write(content) } return type, file end end end end diff --git a/test/test_mms2r_media.rb b/test/test_mms2r_media.rb index cea744f..f14c737 100644 --- a/test/test_mms2r_media.rb +++ b/test/test_mms2r_media.rb @@ -1,557 +1,561 @@ # encoding: UTF-8 require "test_helper" class TestMms2rMedia < Test::Unit::TestCase include MMS2R::TestHelper def use_temp_dirs MMS2R::Media.tmp_dir = @tmpdir MMS2R::Media.conf_dir = @confdir end def setup @tmpdir = File.join(Dir.tmpdir, "#{Time.now.to_i}-t") FileUtils.mkdir_p(@tmpdir) @confdir = File.join(Dir.tmpdir, "#{Time.now.to_i}-c") FileUtils.mkdir_p(@confdir) @oldtmpdir = MMS2R::Media.tmp_dir @oldconfdir = MMS2R::Media.conf_dir end def teardown FileUtils.rm_rf(@tmpdir) FileUtils.rm_rf(@confdir) MMS2R::Media.tmp_dir = @oldtmpdir MMS2R::Media.conf_dir = @oldconfdir end def stub_mail(vals = {}) attrs = { :from => '[email protected]', :to => '[email protected]', :subject => 'This is a test email', :body => 'a', }.merge(vals) Mail.new do from attrs[:from] to attrs[:to] subject attrs[:subject] body attrs[:body] end end + def test_faux_user_agent + assert_equal "Mozilla/5.0 (iPhone; U; CPU like Mac OS X; en) AppleWebKit/420+ (KHTML, like Gecko) Version/3.0 Mobile/1C28 Safari/419.3", MMS2R::Media::USER_AGENT + end + def test_class_parse mms = mail('generic.mail') assert_equal ['[email protected]'], mms.from end def temp_text_file(text) tf = Tempfile.new("test" + rand.to_s) tf.puts(text) tf.close tf.path end def test_tmp_dir use_temp_dirs() MMS2R::Media.tmp_dir = @tmpdir assert_equal @tmpdir, MMS2R::Media.tmp_dir end def test_conf_dir use_temp_dirs() MMS2R::Media.conf_dir = @confdir assert_equal @confdir, MMS2R::Media.conf_dir end def test_safe_message_id mid1_b="1234abcd" mid1_a="1234abcd" mid2_b="<01234567.0123456789012.JavaMail.fooba@foo-bars999>" mid2_a="012345670123456789012JavaMailfoobafoo-bars999" assert_equal mid1_a, MMS2R::Media.safe_message_id(mid1_b) assert_equal mid2_a, MMS2R::Media.safe_message_id(mid2_b) end def test_default_ext assert_equal nil, MMS2R::Media.default_ext(nil) assert_equal 'text', MMS2R::Media.default_ext('text') assert_equal 'txt', MMS2R::Media.default_ext('text/plain') assert_equal 'test', MMS2R::Media.default_ext('example/test') end def test_base_initialize_config_tries_to_open_default_config_yaml f = File.join(MMS2R::Media.conf_dir, 'mms2r_media.yml') YAML.expects(:load_file).once.with(f).returns({}) config = MMS2R::Media.initialize_config(nil) end def test_base_initialize_config config = MMS2R::Media.initialize_config(nil) # test defaults shipped in mms2r_media.yml assert_not_nil config assert_equal true, config['ignore'].is_a?(Hash) assert_equal true, config['transform'].is_a?(Hash) assert_equal true, config['number'].is_a?(Array) end def test_instance_initialize_config mms = MMS2R::Media.new stub_mail config = mms.initialize_config(nil) # test defaults shipped in mms2r_media.yml assert_not_nil config assert_equal true, config['ignore'].is_a?(Hash) assert_equal true, config['transform'].is_a?(Hash) assert_equal true, config['number'].is_a?(Array) end def test_initialize_config_contatenation c = {'ignore' => {'text/plain' => [/A TEST/]}, 'transform' => {'text/plain' => [/FOO/, '']}, 'number' => ['from', /^([^\s]+)\s.*/, '\1'] } config = MMS2R::Media.initialize_config(c) assert_not_nil config['ignore']['text/plain'].detect{|v| v == /A TEST/} assert_not_nil config['transform']['text/plain'].detect{|v| v == /FOO/} assert_not_nil config['number'].first == 'from' end def test_aliased_new_returns_default_processor_instance mms = MMS2R::Media.new stub_mail assert_not_nil mms assert_equal true, mms.respond_to?(:process) assert_equal MMS2R::Media, mms.class end def test_lazy_process_option mms = MMS2R::Media.new stub_mail, :process => :lazy mms.expects(:process).never end def test_logger_option logger = mock() logger.expects(:info).at_least_once mms = MMS2R::Media.new stub_mail, :logger => logger end def test_default_processor_initialize_tries_to_open_config_for_carrier mms_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'mms2r_media.yml')) aliases_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'aliases.yml')) from_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'from.yml')) example_yaml = File.expand_path(File.join(MMS2R::Media.conf_dir, 'example.com.yml')) YAML.expects(:load_file).at_least_once.with(mms_yaml).returns({}) YAML.expects(:load_file).at_least_once.with(aliases_yaml).returns({}) YAML.expects(:load_file).at_least_once.with(from_yaml).returns([]) YAML.expects(:load_file).never.with(example_yaml) mms = MMS2R::Media.new stub_mail end def test_mms_phone_number mail = stub_mail mail.stubs(:from).returns(['[email protected]']) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number end def test_mms_phone_number_from_config mail = stub_mail(:from => '"+2068675309" <[email protected]>') mms = MMS2R::Media.new(mail) mms.expects(:config).once.returns({'number' => ['from', /^([^\s]+)\s.*/, '\1']}) assert_equal '+2068675309', mms.number end def test_mms_phone_number_with_errors mail = stub_mail mail.stubs(:from).returns(nil) mms = MMS2R::Media.new(mail) assert_nothing_raised do assert_equal '', mms.number end end def test_transform_text_plain mail = stub_mail mail.stubs(:from).returns(nil) mms = MMS2R::Media.new(mail) type = 'test/type' text = 'hello' # no match in the config result = [type, text] assert_equal result, mms.transform_text(type, text) # testing the default config assert_equal ['text/plain', ''], mms.transform_text('text/plain', "Sent via BlackBerry from T-Mobile") assert_equal ['text/plain', ''], mms.transform_text('text/plain', "Sent from my Verizon Wireless BlackBerry") assert_equal ['text/plain', ''], mms.transform_text('text/plain', 'Sent from my iPhone') assert_equal ['text/plain', ''], mms.transform_text('text/plain', 'Sent from your iPhone.') assert_equal ['text/plain', ''], mms.transform_text('text/plain', " \n\nimage/jpeg") # has a bad regexp mms.expects(:config).at_least_once.returns({'transform' => {type => [['(hello)', 'world']]}}) assert_equal result, mms.transform_text(type, text) # matches in config mms.expects(:config).at_least_once.returns({'transform' => {type => [[/(hello)/, 'world']]}}) assert_equal [type, 'world'], mms.transform_text(type, text) mms.expects(:config).at_least_once.returns({'transform' => {type => [[/^Ignore this part, (.+)/, '\1']]}}) assert_equal [type, text], mms.transform_text(type, "Ignore this part, " + text) # chaining transforms mms.expects(:config).at_least_once.returns({'transform' => {type => [[/(hello)/, 'world'], [/(world)/, 'mars']]}}) assert_equal [type, 'mars'], mms.transform_text(type, text) # has a Iconv problem mms.expects(:config).at_least_once.returns({'transform' => {type => [['(hello)', 'world']]}}) assert_equal result, mms.transform_text(type, text) end def test_transform_text_to_utf8 mail = mail('iconv-fr-text-01.mail') mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_equal 1, mms.media['text/plain'].size assert_equal 1, mms.media['text/html'].size file = mms.media['text/plain'][0] assert_not_nil file assert_equal true, File::exist?(file) text_lines = IO.readlines("#{file}") text = text_lines.join # ASCII-8BIT -> D'ici un mois G\xC3\xA9orgie # UTF-8 -> D'ici un mois Géorgie if RUBY_VERSION < "1.9" assert_equal("D'ici un mois Géorgie body", text_lines.first.strip) assert_equal("sample email message Fwd: sub D'ici un mois Géorgie", mms.subject) else #assert_equal("D'ici un mois Géorgie body", text_lines.first.strip) assert_equal("D'ici un mois G\xE9orgie body", text_lines.first.strip) assert_equal("sample email message Fwd: sub D'ici un mois Géorgie", mms.subject) end mms.purge end def test_subject s = 'hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) assert_equal s, mms.subject # second time through shouldn't process the subject again mail.expects(:subject).never assert_equal s, mms.subject end def test_subject_with_bad_mail_subject mail = stub_mail mail.stubs(:subject).returns(nil) mms = MMS2R::Media.new(mail) assert_equal '', mms.subject end def test_subject_with_subject_ignored s = 'hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) mms.stubs(:config).returns({'ignore' => {'text/plain' => [s]}}) assert_equal '', mms.subject end def test_subject_with_subject_transformed s = 'Default Subject: hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) mms.stubs(:config).returns( { 'ignore' => {}, 'transform' => {'text/plain' => [[/Default Subject: (.+)/, '\1']]}}) assert_equal 'hello world', mms.subject end def test_attachment_should_return_nil_if_files_for_type_are_not_found mms = MMS2R::Media.new stub_mail mms.stubs(:media).returns({}) assert_nil mms.send(:attachment, ['text']) end def test_attachment_should_return_nil_if_empty_files_are_found mms = MMS2R::Media.new stub_mail mms.stubs(:media).returns({'text/plain' => [Tempfile.new('test')]}) assert_nil mms.send(:attachment, ['text']) end def test_type_from_filename mms = MMS2R::Media.new stub_mail assert_equal 'image/jpeg', mms.send(:type_from_filename, "example.jpg") end def test_type_from_filename_should_be_nil mms = MMS2R::Media.new stub_mail assert_nil mms.send(:type_from_filename, "example.example") end def test_attachment_should_return_duck_typed_file mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") size = File.size(temp_text_file("hello world")) temp_small = temp_text_file("hello") mms.stubs(:media).returns({'text/plain' => [temp_small, temp_big]}) duck_file = mms.send(:attachment, ['text']) assert_not_nil duck_file assert_equal true, File::exist?(duck_file) assert_equal true, File::exist?(temp_big) assert_equal temp_big, duck_file.local_path assert_equal File.basename(temp_big), duck_file.original_filename assert_equal size, duck_file.size assert_equal 'text/plain', duck_file.content_type end def test_empty_body mms = MMS2R::Media.new stub_mail mms.stubs(:default_text).returns(nil) assert_equal "", mms.body end def test_body mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") mms.stubs(:default_text).returns(File.new(temp_big)) body = mms.body assert_equal "hello world", body end def test_body_when_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") mms.stubs(:default_html).returns(File.new(temp_big)) assert_equal "hello world teapot", mms.body end def test_default_text mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'text/plain' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_text.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_text.local_path end def test_default_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") temp_small = temp_text_file("<html><head><title>hello</title></head><body>world<body></html>") mms.stubs(:media).returns({'text/html' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_html.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_html.local_path end def test_default_media mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'image/jpeg' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_media.local_path end def test_default_media_treats_image_and_video_equally mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big_image = temp_text_file("hello world") temp_small_image = temp_text_file("hello") temp_big_video = temp_text_file("hello world again") temp_small_video = temp_text_file("hello again") mms.stubs(:media).returns({'image/jpeg' => [temp_small_image, temp_big_image], 'video/mpeg' => [temp_small_video, temp_big_video], }) assert_equal temp_big_video, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big_video, mms.default_media.local_path end #def test_default_media_treats_gif_and_jpg_equally # #it doesn't matter that these are text files, we just need say they are images # temp_big = temp_text_file("hello world") # temp_small = temp_text_file("hello") # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/jpeg' => [temp_big], 'image/gif' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/gif' => [temp_big], 'image/jpg' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path #end def test_purge mms = MMS2R::Media.new stub_mail mms.purge assert_equal false, File.exist?(mms.media_dir) end def test_ignore_media_by_filename_equality name = 'foo.txt' type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [name]}}) # type is not in the ingore part = stub(:body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and filename are in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal true, mms.ignore_media?(type, part) # type but not file name are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_filename name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'foo.txt', mms.filename?(part) end def test_long_filename name = 'x' * 300 + '.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'x' * 251 + '.txt', mms.filename?(part) end def test_filename_when_file_extension_missing_part name = 'foo' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.txt', mms.filename?(part) name = 'foo.janky' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.janky.txt', mms.filename?(part) end def test_ignore_media_by_filename_regexp name = 'foo.txt' regexp = /foo\.txt/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [regexp, 'nil.txt']}}) # type is not in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the filename are in the ingore part = stub(:filename => name) assert_equal true, mms.ignore_media?(type, part) # type but not regexp for filename are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_by_regexp_on_file_content name = 'foo.txt' content = "aaaaaaahello worldbbbbbbbbb" regexp = /.*Hello World.*/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => ['nil.txt', regexp]}}) part = stub(:filename => name, :body => Mail::Body.new(content)) # type is not in the ingore assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the content are in the ingore assert_equal true, mms.ignore_media?(type, part) # type but not regexp for content are in the ignore part = stub(:filename => name, :body => Mail::Body.new('no teapots')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_when_file_content_is_empty mms = MMS2R::Media.new stub_mail # there is no conf but the part's body is empty part = stub(:filename => 'foo.txt', :body => Mail::Body.new) assert_equal true, mms.ignore_media?('text/test', part) # there is no conf but the part's body is white space part = stub(:filename => 'foo.txt', :body => Mail::Body.new("\t\n\t\n ")) assert_equal true, mms.ignore_media?('text/test', part) end def test_add_file mail = stub_mail mail.stubs(:from).returns(['[email protected]']) mms = MMS2R::Media.new(mail) mms.stubs(:media).returns({}) assert_nil mms.media['text/html'] mms.add_file('text/html', '/tmp/foo.html') assert_equal ['/tmp/foo.html'], mms.media['text/html'] mms.add_file('text/html', '/tmp/bar.html') assert_equal ['/tmp/foo.html', '/tmp/bar.html'], mms.media['text/html'] end def test_temp_file name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal name, File.basename(mms.temp_file(part)) end def test_process_media_for_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', 'hello world']) result = mms.process_media(part) assert_equal 'text/plain', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_with_empty_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', '']) diff --git a/test/test_pm_sprint_com.rb b/test/test_pm_sprint_com.rb index 2c90698..0526638 100644 --- a/test/test_pm_sprint_com.rb +++ b/test/test_pm_sprint_com.rb @@ -1,224 +1,257 @@ require "test_helper" class TestPmSprintCom < Test::Unit::TestCase include MMS2R::TestHelper def mock_sprint_image(message_id) - uri = URI.parse('http://pictures.sprintpcs.com//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90') - res = mock() - body = mock() - res.expects(:content_type).at_least_once.returns('image/jpeg') - res.expects(:body).once.returns(body) - res.expects(:code).never - Net::HTTP.expects(:get_response).once.returns res + response = mock('response') + body = mock('body') + connection = mock('connection') + response.expects(:content_type).twice.returns('image/jpeg') + response.expects(:code).never + Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection + connection.expects(:get).with( + # 1.9.2 + # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90&ext=.jpg&iconifyVideo=true&wm=1' + # 1.8.7 + # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&outquality=90&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU' + kind_of(String), + { "User-Agent" => MMS2R::Media::USER_AGENT } + ).once.returns([response, body]) end def mock_sprint_purged_image(message_id) - uri = URI.parse('http://pictures.sprintpcs.com//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90') - res = mock() - body = mock() - res.expects(:content_type).once.returns('text/html') - res.expects(:code).once.returns('500') - res.expects(:body).never - Net::HTTP.expects(:get_response).once.returns res + response = mock('response') + body = mock('body') + connection = mock('connection') + response.expects(:content_type).once.returns('text/html') + response.expects(:code).once.returns('500') + Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection + connection.expects(:get).with( + # 1.9.2 + # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?inviteToken=PE5rJ5PdYzzwk7V7zoXU&outquality=90&ext=.jpg&iconifyVideo=true&wm=1' + # 1.8.7 + # '//mmps/RECIPIENT/001_2066c7013e7ca833_1/2?wm=1&ext=.jpg&outquality=90&iconifyVideo=true&inviteToken=PE5rJ5PdYzzwk7V7zoXU' + kind_of(String), + { "User-Agent" => MMS2R::Media::USER_AGENT } + ).once.returns([response, body]) end def test_mms_should_have_text mail = mail('sprint-text-01.mail') mms = MMS2R::Media.new(mail) assert_equal "2068765309", mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_equal 1, mms.media['text/plain'].size file = mms.media['text/plain'].first assert_equal true, File.exist?(file) assert_match(/\.txt$/, File.basename(file)) assert_equal "Tea Pot", IO.read(file) mms.purge end def test_mms_should_have_a_phone_number mail = mail('sprint-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier mms.purge end def test_should_have_simple_video mail = mail('sprint-video-01.mail') - uri = URI.parse( - 'http://pictures.sprintpcs.com//mmps/RECIPIENT/000_259e41e851be9b1d_1/2?inviteToken=lEvrJnPVY5UfOYmahQcx&amp;iconifyVideo=true&amp;wm=1&amp;limitsize=125,125&amp;outquality=90&amp;squareoutput=255,255,255&amp;ext=.jpg&amp;iconifyVideo=true&amp;wm=1') - res = mock() - body = mock() - res.expects(:content_type).at_least_once.returns('video/quicktime') - res.expects(:body).once.returns(body) - res.expects(:code).never - Net::HTTP.expects(:get_response).once.returns res + response = mock('response') + body = mock('body') + connection = mock('connection') + response.expects(:content_type).twice.returns('video/quicktime') + response.expects(:code).never + Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection + connection.expects(:get).with( + kind_of(String), + { "User-Agent" => MMS2R::Media::USER_AGENT } + ).once.returns([response, body]) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_not_nil mms.media['video/quicktime'] assert_equal 1, mms.media['video/quicktime'].size assert_equal "000_259e41e851be9b1d_1-0.mov", File.basename(mms.media['video/quicktime'][0]) mms.purge end def test_should_have_simple_image mail = mail('sprint-image-01.mail') mock_sprint_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_not_nil mms.media['image/jpeg'][0] assert_match(/001_2066c7013e7ca833_1-0.jpg$/, mms.media['image/jpeg'][0]) mms.purge end def test_collect_image_using_block mail = mail('sprint-image-01.mail') mock_sprint_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size file_array = nil mms.process do |k, v| file_array = v if (k == 'image/jpeg') assert_equal 1, file_array.size file = file_array.first assert_not_nil file = file_array.first assert_equal "001_2066c7013e7ca833_1-0.jpg", File.basename(file) end mms.purge end def test_process_internals_should_only_be_executed_once mail = mail('sprint-image-01.mail') mock_sprint_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size # second time through shouldn't go into the was_processed block mms.mail.expects(:parts).never mms.process{|k, v| } mms.purge end def test_should_have_two_images mail = mail('sprint-two-images-01.mail') - uri1 = URI.parse('http://pictures.sprintpcs.com/mmps/RECIPIENT/001_104058d23d79fb6a_1/2?wm=1&ext=.jpg&iconifyVideo=true&inviteToken=5E1rJSPk5hYDkUnY7op0&outquality=90') - res1 = mock() - body1 = mock() - res1.expects(:content_type).at_least_once.returns('image/jpeg') - res1.expects(:body).once.returns(body1) - res1.expects(:code).never - Net::HTTP.expects(:get_response).returns res1 - - uri2 = URI.parse('http://pictures.sprintpcs.com/mmps/RECIPIENT/001_104058d23d79fb6a_1/3?wm=1&ext=.jpg&iconifyVideo=true&inviteToken=5E1rJSPk5hYDkUnY7op0&outquality=90') - - res2 = mock() - body2 = mock() - res2.expects(:content_type).at_least_once.returns('image/jpeg') - res2.expects(:body).once.returns(body2) - res2.expects(:code).never - Net::HTTP.expects(:get_response).returns res2 + response = mock('response') + body = mock('body') + connection = mock('connection') + response.expects(:content_type).times(4).returns('image/jpeg') + response.expects(:code).never + Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).twice.returns connection + connection.expects(:get).with( + kind_of(String), + { "User-Agent" => MMS2R::Media::USER_AGENT } + ).twice.returns([response, body]) + + # response1 = mock('response1') + # body1 = mock('body1') + # connection1 = mock('connection1') + # response1.expects(:content_type).at_least_once.returns('image/jpeg') + # response1.expects(:code).never + # Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection1 + # connection1.expects(:get).with( + # kind_of(String), + # { "User-Agent" => MMS2R::Media::USER_AGENT } + # ).once.returns([response1, body1]) + + # response2 = mock('response2') + # body2 = mock('body2') + # connection2 = mock('connection2') + # response2.expects(:content_type).at_least_once.returns('image/jpeg') + # response2.expects(:code).never + # Net::HTTP.expects(:new).with('pictures.sprintpcs.com', 80).once.returns connection2 + # connection2.expects(:get).with( + # kind_of(String), + # { "User-Agent" => MMS2R::Media::USER_AGENT } + # ).once.returns([response2, body2]) + mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 1, mms.media.size assert_nil mms.media['text/plain'] assert_nil mms.media['text/html'] assert_equal 2, mms.media['image/jpeg'].size assert_not_nil mms.media['image/jpeg'][0] assert_not_nil mms.media['image/jpeg'][1] assert_match(/001_104058d23d79fb6a_1-0.jpg$/, mms.media['image/jpeg'][0]) assert_match(/001_104058d23d79fb6a_1-1.jpg$/, mms.media['image/jpeg'][1]) mms.purge end def test_image_should_be_missing # this test is questionable mail = mail('sprint-broken-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 0, mms.media.size mms.purge end def test_image_should_be_purged_from_content_server mail = mail('sprint-image-01.mail') mock_sprint_purged_image(mail.message_id) mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal 0, mms.media.size mms.purge end def test_body_should_return_empty_when_there_is_no_user_text mail = mail('sprint-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal "", mms.body end def test_sprint_write_file mail = mock(:message_id => 'a') mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') mms = MMS2R::Media.new(mail, :process => :lazy) type = 'text/plain' content = 'foo' file = Tempfile.new('sprint') file.close type, file = mms.send(:sprint_write_file, type, content, file.path) assert_equal 'text/plain', type assert_equal content, IO.read(file) end def test_subject mail = mail('sprint-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal "", mms.subject end def test_new_subject mail = mail('sprint-new-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal '2068675309', mms.number assert_equal "pm.sprint.com", mms.carrier assert_equal "", mms.subject end end
monde/mms2r
7db749786be822954df2ced134f95711054df7d9
Don't ignore case, photo.JPG and photo.PNG are case sensitive names emitted from an iphone.
diff --git a/conf/mms2r_media.yml b/conf/mms2r_media.yml index 1b035d1..6d0ec63 100644 --- a/conf/mms2r_media.yml +++ b/conf/mms2r_media.yml @@ -1,76 +1,76 @@ --- ignore: text/plain: - !ruby/regexp /^\(no subject\)$/i - !ruby/regexp /\ASent via BlackBerry (from|by) .*$/im - !ruby/regexp /\ASent from my Verizon Wireless BlackBerry$/im - !ruby/regexp /\ASent from (my|your) iPhone.?$/im - !ruby/regexp /\ASent on the Sprint.* Now Network.*$/im multipart/mixed: - !ruby/regexp "/^Attachment: /i" transform: text/plain: - - !ruby/regexp /\A(.*?)Sent via BlackBerry (from|by) .*$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from my Verizon Wireless BlackBerry$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from (my|your) iPhone.?$/im - "\\1" - - !ruby/regexp /\A(.*?)\s+image\/jpeg$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent on the Sprint.* Now Network.*$/im - "\\1" device_types: boundary: :motorola: !ruby/regexp /Motorola-A-Mail/i headers: x-mailer: :iphone: !ruby/regexp /iPhone Mail/i :blackberry: !ruby/regexp /Palm webOS/i mime-version: :iphone: !ruby/regexp /iPhone Mail/i x-rim-org-msg-ref-id: :blackberry: !ruby/regexp /.+/ user-agent: :iphone: !ruby/regexp /iPhone/i # TODO do something about the assortment of camera models that have # been seen: # 1.3 Megapixel, 2.0 Megapixel, BlackBerry, CU920, G'z One TYPE-S, # Hermes, iPhone, LG8700, LSI_S5K4AAFA, Micron MT9M113 1.3MP YUV, # Motorola Phone, Omni_vision-9650, Pre, # Seoul Electronics & Telecom SIM120B 1.3M, SGH-T729, SGH-T819, # SPH-M540, SPH-M800, SYSTEMLSI S5K4BAFB 2.0 MP, VX-9700 # # NOTE: These model strings are stored in the exif model header of an image file # created and sent by the device, the regex is used by mms2r to detect the # model string makes: :android: !ruby/regexp /Android/i :apple: !ruby/regexp /^(Apple|Hipstamatic)$/i :casio: !ruby/regexp /^CASIO$/i :dash: !ruby/regexp /T-Mobile Dash/i :google: !ruby/regexp /^google$/i :htc: !ruby/regexp /^HTC/i :lge: !ruby/regexp /^(LG|CX87BL05)/i :motorola: !ruby/regexp /^Motorola/i :nokia: !ruby/regexp /^Nokia/i :pantech: !ruby/regexp /^PANTECH$/i :palm: !ruby/regexp /Palm/i :qualcomm: !ruby/regexp /^MSM6/i :research_in_motion: !ruby/regexp /^(RIM|Research In Motion)$/i :samsung: !ruby/regexp /^(SAMSUNG|ES.M800|M6550B-SAM-4480)/i :seoul_electronics: !ruby/regexp /^ISUS0/i :sprint: !ruby/regexp /^Sprint$/i :utstarcom: !ruby/regexp /^T1A_UC1.88$/i models: :blackberry: !ruby/regexp /BlackBerry/i :centro: !ruby/regexp /^Palm Centro$/i :dash: !ruby/regexp /T-Mobile Dash/i :droid: !ruby/regexp /Droid/i :htc: !ruby/regexp /HTC|Eris|HERO200/i :iphone: !ruby/regexp /iPhone/i software: :blackberry: !ruby/regexp /^Rim Exif/i filenames: - :iphone: !ruby/regexp /^photo\.(JPG|PNG)$/i + :iphone: !ruby/regexp /^photo\.(JPG|PNG)$/ :video: !ruby/regexp /\.3gp$/
monde/mms2r
6deacd0dd082560e3d48b4ece871a8b122ba3ace
Prep for 3.4.1 Fatty Ding-Dongs release.
diff --git a/History.txt b/History.txt index 6d183ea..e147de0 100644 --- a/History.txt +++ b/History.txt @@ -1,382 +1,388 @@ +### 3.4.1 / 2011-11-06 (Fatty Ding-Dongs, Dethklok foster child) + +* 2 major enhancements + * Additional means to detect android, iphone, motorola, nokia, palm handsets + * Additional known SMS/MMS domains mm.att.net, labwig.net, cdma.sasktel.com + ### 3.4.0 / 2011-10-31 (Serveta Skwigelf, Skwisgaar's hot mom) * 2 major enhancements * regexp's in yaml configs are store as a ruby regexp and not a string that is evaled. * character encoding capability with 1.8 rubies and 1.9 rubies. ### 3.3.1 / 2011-01-01 (Reverend Aslaug Wartooth (deceased), Toki's dad) * 2 minor enhancements * new method #default_html returns the default html attachment * #body will return the default plain text, or default stripped html text ### 3.3.0 / 2010-12-31 (Charles Foster Offdensen - CFO, dethklok) * 1 major enhancement * MMS2R::Media::Sprint is now a module that is extended in for processing Sprint content rather than being child class of MMS2R::Media Extension is the strategy to use for overwriting template methods now * 1 minor enhancement * process new Sprint subject - Jason Hooper * new SaskTel mms/sms domain alias sasktel.com * new Virgin Mobile mms/sms domain alias yrmobl.com ### 3.2.0 / 2010-08-17 (Antonio "Tony" DiMarco Thunderbottom - bassist) * 3 minor enhancements * updated readme with latest sites known to use mms2r * bundler assimilated * loading rubygems only if it's required, like rake ### 3.1.0 / 2010-07-09 (Dick "Magic Ears" Knubbler - music producer) * 8 minor enhancements * Detects additional Bell/AT&T domain sbcglobal.net as a handset * Detects additional Virgin mobile domains pixmbl.com vmobl.com as a handset * Expanded mobile phone detection for handset makers by : Casio, Google Nexus One, LG Electronics, Motorola, Pantech, Qualcom, Samsung, Sprint, UTStarCom * EXIF Reader (exifr) is integral to MMS2R and is now a required gem * upgrade Mail to 2.2.5 * depend on latest gems * corrected example - Jason Hooper * added As Seen On The Internet to README that lists sites known to be using MMS2R in some fashion ### 3.0.1 / 2010-03-28 (Lavona Succuboso - leader of "Succuboso Explosion") * 1 minor enhancement * support for U.S. Cellular ### 3.0.0 / 2010-02-24 (General Crozier - Chairman of the Joint Chiefs of Staff) * 1 new feature * dependence upon Mail gem rather than TMail gem ### 2.4.1 / 2010-02-07 (Vater Orlaag - political and spiritual specialist) * 3 minor enhancements * make sure filename is free of new lines - laurynas * recognize HTC HERO200 as a smart phone * recognize HTC Eris as a smart phone ### 2.4.0 / 2009-12-20 (Dr. Nanemiltred Philtendrieden - specialist on celebrity death) * 1 new feature * replace Hpricot with Nokogiri for html parsing of Sprint data * 3 minor enhancements * smartphone identities stored in conf/mms2r_media.yml * identify Motorola Droid as a smartphone * identify T-Mobile Dash as a smartphone * use uuidtools for naming temp directories - kbaum ### 2.3.0 / 2009-08-30 (Snakes 'n' Barrels Greatest Hits) * 5 new features * detect smartphone status/type based on model metadata from jpeg and tiff exif data using exifr gem, access exif data with MMS2R::Media#exif * make MMS2R Rails gem packaging friendly with an init.rb - Scott Taylor, smtlaissezfaire * delegate missing methods to mms2r's tmail object so that mms2r behaves as if it were a tmail object - Sai Emrys, saizai * default_media can return an attachment of application content type - Brendan Lim, brendanlim * MMS2R.parse(raw_mail) convenience class method that parses and returns an mms2r from a mail file - saizai * 4 minor enhancements * make examples more 'mail' specific to enforce the fact that an mms is a multipart email - saizai * update for text in vzwpix.com default carrier message * detecting smartphone (blackberries and iphones for now) is more versatile from reading mail headers * expanded filtering of carrier advertising text in mms from smartphones ### 2.2.0 / 2009-01-04 (Rikki Kixx - owner of a franchise of rehab centers) * 3 new features * MMS2R::Media#is_mobile? best guess if the sender was a mobile device * MMS2R::Media#device_type? best guess of the mobile device type. Simple heuristics thus far for :blackberry :iphone :handset :unknown could be expanded for exif probing or additinal shifting of mail header * from array in conf/from.yml to provide granularity to determine carrier domain (caused by tmo.blackberry.net) * 4 minor enhancements * support for Virgin Canada messaging service vmobile.ca * support for text service messaging.sprintpcs.com * additional BlackBerry coverage from T-Mobile tmo.blackberry.net provider * legacy support for mobile.mycingular.com, pics.cingularme.com * 3 bug fixes * iPhone default subject - jesse dp http://rubyforge.org/tracker/?func=detail&atid=11789&aid=22951&group_id=3065 * add sprintpcs.com to pm.sprint.com aliases * fix OS X long filename issues - Matt Conway ### 2.1.3 / 2008-11-06 (Dr. Ramonolith Chesterfield - Military pharmaceutical psychotropic drug manufacturing expert * 1 minor enhancement * added mms.ae support ### 2.1.2 / 2008-10-21 (Toki's mom, Anja Wartooth) * 2 minor enhancments * Sprint subject update - jesse dp * Virgin Mobile support vmpix.com ### 2.1.1 / 2008-09-24 (Lavona Succuboso, Nathan Explosion uber-groupie) * 4 minor enhancments * Bell Canada support txt.bell.ca - Matt Conway / Snap My Life - http://github.com/wr0ngway, http://github.com/sml * Unicel support unicel.com - Michael DelGaudio * info2go.com support / Unicel * TELUS Corporation support mms.telusmobility.com, msg.telus.com * add test to check that gem builds correctly as a github gem * 1 bug fix * Iconv utf8 fix - Kai Kai ### 2.1.0 / 2008-07-30 (Dr. Gibbons – Birthday expert and Murderface expert) * 1 major enhancement: * opens up TMail for improved query method patterned code in MMS2R * 2 minor enhancements: * UK O2 support mediamessaging.o2.co.uk - Jeremy Wilkins * Write non text files with binary bit set on Windows - David Alm * source hosted on github: git clone git://github.com/monde/mms2r.git ### 2.0.5 / 2008-07-17 (Dr. Ralphus Galkensmelter - Psychological death expert) * Deal with Apple Mail multipart/appledouble - jesse dp ### 2.0.4 / 2008-04-28 (Mr. Selatcia - elder member of The Tribunal) * updated mms.vodacom4me.co.za Vodacom South Africa - Vijay Yellapragada * 1nbox.net / Idea cellular 1nbox.net - Vijay Yellapragada * mms.3ireland.ie / 3 Ireland - Vijay Yellapragada * mms.alltel.com / Alltel (reverted message.alltel.com) - Vijay Yellapragada * mms.mobileiam.ma / Maroc Telecom - Vijay Yellapragada * mms.mtn.co.za / MTM South Africa - Vijay Yellapragada * rci.rogers.com / Rogers of Canada - Vijay Yellapragada * mmsreply.t-mobile.co.uk / T-Mobile UK - Vijay Yellapragada * waw.plspictures.com / PLSPICTURES.COM mms hosting service ### 2.0.3 / 2008-04-15 (Enter Taxman - The 1040 MMS Form) * fix case when part is image/jpeg declared 'application/octet-stream' * trim dangling image/jpeg text from blackberry messages * file extensions added to filenames that are missing extensions in part headers * anonymize images in fixtures to reduce gem size * T-Mobile update - jesse dp * AT&T/T-Mobile Blackberrry update - Dave Myron ### 2.0.2 / 2008-02-22 (The Jomfru Brothers - proprietors of diefordethklok.com) * added support for mms.vodacom4me.co.za Vodacom South Africa - Jason Haruska * added support for bellsouth.net - Jason Haruska * added support for mms.mycricket.com * Improved Blackberry and iPhone suport - Jason Haruska * added :number key to configuration to provide rules for specifying alternative phone number location * return sender's phone number for mobile.indosat.net.id * return sender's phone number for mms.luxgsm.lu * return sender's phone number for mms.vodacom4me.co.za ### 2.0.1 / 2008-02-08 (Professor Jerry Gustav Munndig - Child control expert) * strip out common blackberry and iPhone signatures * handle carriers that use external mail services such as Yahoo! as the From address * Add support for mobile.indosat.net.id (and yahoo.co.id) - Jason Haruska * Add support for sms.sasktel.com - Jason Haruska ### 2.0.0 / 2008-01-23 (Skwisgaar Skwigelf - fastest guitarist alive) * added support for pxt.vodafone.net.nz PXT New Zealand * added support for mms.o2online.de O2 Germany * added support for orangemms.net Orange UK * added support for txt.att.net AT&T * added support for mms.luxgsm.lu LUXGSM S.A. * added support for mms.netcom.no NetCom (Norway) * added support for mms.three.co.uk Hutchison 3G UK Ltd * removed deprecated #get_number use #number * removed deprecated #get_subject use #subject * removed deprecated #get_body use #body * removed deprecated #get_media use #default_media * removed deprecated #get_text use #default_text * removed deprecated #get_attachment use #attachment * fixed error when Sprint content server responds 500 * better yaml configs * moved TMail dependency from Rails ActionMailer SVN to 'official' Gem * ::new greedily processes MMS unless otherwise specified as an initialize option :process => :lazy * logger moved to initialize option :logger => some_logger * testing using mocks and stubs instead of duck raped Net::HTTP * fixed typo in name of method #attachement to #attachment * fixed broken downloading of Sprint videos ### 1.1.12 / 2007-10-21 (Dr. Ronald von Moldenberg - Endorsement specialist) * fetch original images from Sprint content server (Layton Wedgeworth) * ignore Sprint messages when requested content has been purged from their content server ### 1.1.11 / 2007-10-20 (Dr. Armand Skagerakk Frederickshaven - Mythology expert) * minor fix for attachment_fu where it might call #path on the cgi temp file that is returned by get_attachment * renamed a_t_t_media.rb to att_media.rb to make it autotest happy * masthead.jpg misplaced in mms2r_t_mobile_media_ignore.yml (Layton Wedgeworth) * overridden SprintMedia#process failed to accept block (Layton Wedgeworth) * added method_deprecated to help mark methods that are going to be deprecated in preparation of 1.2.x release * #get_number marked deprecated, use #number instead * #get_subject marked deprecated, use #subject instead * #get_body marked deprecated, use #body instead * #get_text marked deprecated, use #default_text instead * #get_attachment marked deprecated, use #attachment instead * #get_media marked deprecated, use #default_media instead ### 1.1.10 / 2007-09-30 (Face Bones) * fixed a case for a nil match on From in the create method (Luke Francl) * added support for Alltel message.alltel.com (Ben Wood) ### 1.1.9 / 2007-09-08 (Rebecca Nightrod - controlling girlfriend of Nathan Explosion) * fixed broken support for act_as_attachment and attachment_fu ### 1.1.8 / 2007-09-08 (James Grishnack - Head of Behemoth Productions, producer of Blood Ocean) * Added support for Orange of France, Orange orange.fr (Julian Biard) * purge in the process block removed, purge must be called explicitly after processing to clean up extracted temporary media files. ### 1.1.7 / 2007-08-25 (Adam Nergal, friend of Skwisgaar, but not Pickles) * Added support for Orange of Poland, Orange mmsemail.orange.pl (Zbigniew Sobiecki) * Cleaned up documentation modifiers * Cleaned out non-Ruby code idioms ### 1.1.6 / 2007-08-11 (Mustakrakish, the Lake Troll part 2) * Redo of release mistake of 1.1.5 ### 1.1.5 / 2007-08-11 (Mustakrakish, the Lake Troll) * AT&T => mms.att.net not clearing out default "multimedia message" subject to nil (Will Jessup) * Ignore case on default subject for all carriers in corresponding conf/mms2r_XXX_media_subject.yml ### 1.1.4 / 2007-08-07 (Dr. Rockso) * AT&T => mms.att.net support (thanks Mike Chen and Dave Myron) * get_body returns nil when there is not user text (sorry Will!) ### 1.1.3 / 2007-07-10 (Charles Foster Ofdensen) * Helio support by Will Jessup * get_subject returns nil on default carrier subjects ### 1.1.2 / 2007-06-13 (Dethklok roadie #2) * placed versioned hpricot dependency in Hoe's extra_deps (an attempt to appease firebrigade gods or not cause Gem::RemoteInstallationCancelled whichever you prefer) ### 1.1.1 / 2007-06-11 (Dethklok roadie) * rescue rcov non-dependency in Rakefile to make firebrigade happy ### 1.1.0 / 2007-06-08 (Toki Wartooth) * get_body to return body text (Luke Francl) * get_subject returns "" for default subjects now * default subjects listed in yaml by carrier in conf directory * added granularity to Cingular, Sprint, and Verizon carrier services (Will Jessup) * refactored Sprint instance to process all media (Will Jessup + Mike) * optimized text transformations (Will Jessup) * properly handle ISO-8859-1 and UTF-8 text (Will Jessup) * autotest powers activate! (ZenTest autotest discovery enabled) * configuration file ignores, transforms, and subjects all store Regexp's * Put vendor Text::Format & TMail::Mail as an external subversion dependency to the 1.2 stable branch of Rails ActionMailer * added get_number method to return the phone number associated with this MMS * get_media and get_text attachment_fu helper return the largest piece of media of that type if the more than one exits in the media (Luke Francl) * added block support to process() method (Shane Vitarana) ### 1.0.7 / 2007-04-27 (Senator Stampingston) * patch submitted by Luke Francl * added a get_subject method that returns nil when any MMS has a default carrier subject * get_subject returns nil for '', 'Multimedia message', '(no subject)', 'You have new Picture Mail!' ### 1.0.6 / 2007-04-24 (Pickles the Drummer) * patch submitted by Luke Francl * added support for mms.dobson.net (Dobson aka Cellular One) (Luke) * DRY'd up unit tests (Luke) * added get_media instance method that returns first video or image as File (Luke) * File from get_media can be used by/with attachment_fu (Luke) * added get_text instance method that returns first non advertising text * File from get_text can be used by/with attachment_fu ### 1.0.5 / 2007-04-10 (William Murderface) * patch submitted by Luke Francl * made ignore_media? start its text check from the start of the file (Luke) * added new text transform for Verizon messages (Luke) * updated Nextel ignore conf (Luke) * added additional samples and tests for T-Mobile & Verizon (Luke) * cleaned up MMS2R::Media documentation * added Sprint broken image test for when media goes stale on their content server * fixed teardown typo in lots of plases * added tests for 4 three samples of unique variants of Sprint/Nextel text * 100% test coverage! ### 1.0.4 / 2007-04-09 (Metalocalypse) * fix teardown in test_mms2r_sprint.rb (shanesbrain.net) * clean up Net::HTTP in MMS2R::SprintMedia (shanesbrain.net) * added accessor MMS2R::Media.media_dir * fixed a nil issue with underlying tmp working dir * added exception handling around Net::HTTP in MMS2R::SprintMedia ### 1.0.3 / 2007-04-05 (Paper Cut) * Cleaned up packaging and errors in example found by Shane V. http://shanesbrain.net/ ### 1.0.2 / 2007-03-07 * Reorganized tests and fixtures * Added carriers: * Cingular => cingularme.com * Nextel => messaging.nextel.com * Verizon => vtext.com ### 1.0.1 / 2007-03-07 * Flubbed RubyForge release ... do not use this. ### 1.0.0 / 2007-03-06 * Birthday! * AT&T/Cingular => mmode.com * Cingular => mms.mycingular.com * Sprint => pm.sprint.com * Sprint => messaging.sprintpcs.com * T-Mobile => tmomail.net * Verizon => vzwpix.com diff --git a/Manifest.txt b/Manifest.txt index f3445d0..334b4f2 100644 --- a/Manifest.txt +++ b/Manifest.txt @@ -1,181 +1,184 @@ +.gitignore Gemfile Gemfile.lock History.txt Manifest.txt README.TMail.txt README.txt Rakefile conf/1nbox.net.yml conf/aliases.yml conf/bellsouth.net.yml conf/from.yml conf/mediamessaging.o2.co.uk.yml conf/messaging.nextel.com.yml conf/mms.3ireland.ie.yml conf/mms.ae.yml conf/mms.alltel.com.yml conf/mms.att.net.yml conf/mms.dobson.net.yml conf/mms.luxgsm.lu.yml conf/mms.mobileiam.ma.yml conf/mms.mtn.co.za.yml conf/mms.mycricket.com.yml conf/mms.myhelio.com.yml conf/mms.netcom.no.yml conf/mms.o2online.de.yml conf/mms.three.co.uk.yml -conf/mms.uscc.net.mail +conf/mms.uscc.net.yml conf/mms.vodacom4me.co.za.yml conf/mms2r_media.yml conf/mobile.indosat.net.id.yml conf/msg.telus.com.yml conf/orangemms.net.yml conf/pm.sprint.com.yml conf/pxt.vodafone.net.nz.yml conf/rci.rogers.com.yml conf/sms.sasktel.com.yml conf/tmomail.net.yml conf/txt.bell.ca.yml conf/unicel.com.yml conf/vmpix.com.yml conf/vzwpix.com.yml conf/waw.plspictures.com.yml dev_tools/anonymizer.rb dev_tools/debug_sprint_nokogiri_parsing.rb init.rb lib/ext/mail.rb lib/ext/object.rb lib/mms2r.rb lib/mms2r/media.rb lib/mms2r/media/sprint.rb mms2r.gemspec test/fixtures/1nbox-2images-01.mail test/fixtures/1nbox-2images-02.mail test/fixtures/1nbox-2images-03.mail test/fixtures/1nbox-2images-04.mail test/fixtures/3ireland-mms-01.mail test/fixtures/ad_new.txt test/fixtures/alltel-image-01.mail test/fixtures/alltel-mms-01.mail test/fixtures/alltel-mms-03.mail test/fixtures/apple-double-image-01.mail test/fixtures/att-blackberry-02.mail test/fixtures/att-blackberry.mail test/fixtures/att-image-01.mail test/fixtures/att-image-02.mail test/fixtures/att-iphone-01.mail test/fixtures/att-iphone-02.mail test/fixtures/att-iphone-03.mail test/fixtures/att-text-01.mail test/fixtures/bell-canada-image-01.mail test/fixtures/cingularme-text-01.mail test/fixtures/cingularme-text-02.mail test/fixtures/dici_un_mois_georgie.txt test/fixtures/dobson-image-01.mail test/fixtures/dot.jpg test/fixtures/generic.mail test/fixtures/handsets.yml test/fixtures/helio-image-01.mail test/fixtures/helio-message-01.mail test/fixtures/iconv-fr-text-01.mail test/fixtures/indosat-image-01.mail test/fixtures/indosat-image-02.mail test/fixtures/info2go-image-01.mail test/fixtures/iphone-image-01.mail +test/fixtures/iphone-image-02.mail test/fixtures/luxgsm-image-01.mail test/fixtures/maroctelecom-france-mms-01.mail test/fixtures/mediamessaging_o2_co_uk-image-01.mail test/fixtures/mmode-image-01.mail test/fixtures/mms.ae-image-01.mail test/fixtures/mms.mycricket.com-pic-and-text.mail test/fixtures/mms.mycricket.com-pic.mail test/fixtures/mmsreply.t-mobile.co.uk-text-image-01.mail test/fixtures/mobile.mycingular.com-text-01.mail test/fixtures/mtn-southafrica-mms.mail test/fixtures/mycingular-image-01.mail test/fixtures/netcom-image-01.mail test/fixtures/nextel-image-01.mail test/fixtures/nextel-image-02.mail test/fixtures/nextel-image-03.mail test/fixtures/nextel-image-04.mail test/fixtures/o2-de-image-01.mail test/fixtures/orange-uk-image-01.mail test/fixtures/orangefrance-text-and-image.mail test/fixtures/orangepoland-text-01.mail test/fixtures/orangepoland-text-02.mail test/fixtures/pics.cingularme.com-image-01.mail test/fixtures/pxt-image-01.mail test/fixtures/rogers-canada-mms-01.mail test/fixtures/sasktel-image-01.mail +test/fixtures/sprint-blackberry-01.mail test/fixtures/sprint-broken-image-01.mail test/fixtures/sprint-image-01.mail test/fixtures/sprint-new-image-01.mail test/fixtures/sprint-pcs-text-01.mail test/fixtures/sprint-purged-image-01.mail test/fixtures/sprint-text-01.mail test/fixtures/sprint-two-images-01.mail test/fixtures/sprint-video-01.mail test/fixtures/sprint.mov test/fixtures/suncom-blackberry.mail test/fixtures/telus-image-01.mail test/fixtures/three-uk-image-01.mail test/fixtures/tmo.blackberry.net-image-01.mail test/fixtures/tmobile-blackberry-02.mail test/fixtures/tmobile-blackberry.mail test/fixtures/tmobile-image-01.mail test/fixtures/tmobile-image-02.mail test/fixtures/unicel-image-01.mail test/fixtures/us-cellular-image-01.mail test/fixtures/verizon-blackberry.mail test/fixtures/verizon-image-01.mail test/fixtures/verizon-image-02.mail test/fixtures/verizon-image-03.mail test/fixtures/verizon-text-01.mail test/fixtures/verizon-video-01.mail test/fixtures/virgin-mobile-image-01.mail test/fixtures/virgin.ca-text-01.mail test/fixtures/vodacom4me-co-za-01.mail test/fixtures/vodacom4me-co-za-02.mail test/fixtures/vodacom4me-southafrica-mms-01.mail test/fixtures/vodacom4me-southafrica-mms-04.mail test/fixtures/vtext-text-01.mail test/fixtures/vzwpix.com-image-01.mail test/fixtures/waw.plspictures.com-image-01.mail -test/hax.rb test/test_1nbox_net.rb test/test_bell_canada.rb test/test_bellsouth_net.rb test/test_helper.rb test/test_mediamessaging_o2_co_uk.rb test/test_messaging_nextel_com.rb test/test_messaging_sprintpcs_com.rb test/test_mms2r_media.rb test/test_mms_3ireland_ie.rb test/test_mms_ae.rb test/test_mms_alltel_com.rb test/test_mms_att_net.rb test/test_mms_dobson_net.rb test/test_mms_luxgsm_lu.rb test/test_mms_mobileiam_ma.rb test/test_mms_mtn_co_za.rb test/test_mms_mycricket_com.rb test/test_mms_myhelio_com.rb test/test_mms_netcom_no.rb test/test_mms_o2online_de.rb test/test_mms_three_co_uk.rb test/test_mms_uscc_net.rb test/test_mms_vodacom4me_co_za.rb test/test_mobile_indosat_net_id.rb test/test_msg_telus_com.rb test/test_orangemms_net.rb test/test_pm_sprint_com.rb test/test_pxt_vodafone_net_nz.rb test/test_rci_rogers_com.rb test/test_sms_sasktel_com.rb +test/test_sprint.rb test/test_tmomail_net.rb test/test_unicel_com.rb test/test_vmpix_com.rb test/test_vzwpix_com.rb test/test_waw_plspictures_com.rb vendor/plugins/mms2r/lib/autotest/discover.rb vendor/plugins/mms2r/lib/autotest/mms2r.rb diff --git a/lib/mms2r.rb b/lib/mms2r.rb index d80ee40..e781447 100644 --- a/lib/mms2r.rb +++ b/lib/mms2r.rb @@ -1,72 +1,72 @@ #-- # Copyright (c) 2007-2010 by Mike Mondragon ([email protected]) # # Please see the LICENSE file for licensing information. #++ module MMS2R ## # A hash of MMS2R processors keyed by MMS carrier domain. CARRIERS = {} ## # Registers a class as a processor for a MMS domain. Should only be # used in special cases such as MMS2R::Media::Sprint for 'pm.sprint.com' def self.register(domain, processor_class) MMS2R::CARRIERS[domain] = processor_class end ## # A hash of file extensions for common mime-types EXT = { 'text/plain' => 'text', 'text/plain' => 'txt', 'text/html' => 'html', 'image/png' => 'png', 'image/gif' => 'gif', 'image/jpeg' => 'jpeg', 'image/jpeg' => 'jpg', 'video/quicktime' => 'mov', 'video/3gpp2' => '3g2' } class MMS2R::Media ## # MMS2R library version - VERSION = '3.4.0' + VERSION = '3.4.1' end # Simple convenience function to make it a one-liner: # MMS2R.parse raw_mail or MMS2R.parse File.load(raw_mail) # Combined w/ the method_missing delegation, this should behave as an enhanced Mail object, more or less. def self.parse raw_mail mail = Mail.new raw_mail MMS2R::Media.new(mail) end end %W{ yaml mail fileutils pathname tmpdir yaml digest/sha1 iconv exifr }.each do |g| begin require g rescue LoadError require 'rubygems' require g end end # HAX to not deal with Psych YAML parser in Ruby >= 1.9 #YAML::ENGINE.yamler= 'syck' if defined?(YAML::ENGINE) require File.join(File.dirname(__FILE__), 'ext/mail') require File.join(File.dirname(__FILE__), 'ext/object') require File.join(File.dirname(__FILE__), 'mms2r/media') require File.join(File.dirname(__FILE__), 'mms2r/media/sprint') MMS2R.register('pm.sprint.com', MMS2R::Media::Sprint)
monde/mms2r
68d90d13f0e7b343c9bba7157be7e6b51449ca7c
Detect palm handsets.
diff --git a/conf/mms2r_media.yml b/conf/mms2r_media.yml index 526606a..1b035d1 100644 --- a/conf/mms2r_media.yml +++ b/conf/mms2r_media.yml @@ -1,74 +1,76 @@ --- ignore: text/plain: - !ruby/regexp /^\(no subject\)$/i - !ruby/regexp /\ASent via BlackBerry (from|by) .*$/im - !ruby/regexp /\ASent from my Verizon Wireless BlackBerry$/im - !ruby/regexp /\ASent from (my|your) iPhone.?$/im - !ruby/regexp /\ASent on the Sprint.* Now Network.*$/im multipart/mixed: - !ruby/regexp "/^Attachment: /i" transform: text/plain: - - !ruby/regexp /\A(.*?)Sent via BlackBerry (from|by) .*$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from my Verizon Wireless BlackBerry$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from (my|your) iPhone.?$/im - "\\1" - - !ruby/regexp /\A(.*?)\s+image\/jpeg$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent on the Sprint.* Now Network.*$/im - "\\1" device_types: boundary: :motorola: !ruby/regexp /Motorola-A-Mail/i headers: x-mailer: :iphone: !ruby/regexp /iPhone Mail/i :blackberry: !ruby/regexp /Palm webOS/i mime-version: :iphone: !ruby/regexp /iPhone Mail/i x-rim-org-msg-ref-id: :blackberry: !ruby/regexp /.+/ user-agent: :iphone: !ruby/regexp /iPhone/i # TODO do something about the assortment of camera models that have # been seen: # 1.3 Megapixel, 2.0 Megapixel, BlackBerry, CU920, G'z One TYPE-S, # Hermes, iPhone, LG8700, LSI_S5K4AAFA, Micron MT9M113 1.3MP YUV, # Motorola Phone, Omni_vision-9650, Pre, # Seoul Electronics & Telecom SIM120B 1.3M, SGH-T729, SGH-T819, # SPH-M540, SPH-M800, SYSTEMLSI S5K4BAFB 2.0 MP, VX-9700 # # NOTE: These model strings are stored in the exif model header of an image file # created and sent by the device, the regex is used by mms2r to detect the # model string makes: :android: !ruby/regexp /Android/i :apple: !ruby/regexp /^(Apple|Hipstamatic)$/i :casio: !ruby/regexp /^CASIO$/i :dash: !ruby/regexp /T-Mobile Dash/i :google: !ruby/regexp /^google$/i :htc: !ruby/regexp /^HTC/i :lge: !ruby/regexp /^(LG|CX87BL05)/i :motorola: !ruby/regexp /^Motorola/i :nokia: !ruby/regexp /^Nokia/i :pantech: !ruby/regexp /^PANTECH$/i + :palm: !ruby/regexp /Palm/i :qualcomm: !ruby/regexp /^MSM6/i :research_in_motion: !ruby/regexp /^(RIM|Research In Motion)$/i :samsung: !ruby/regexp /^(SAMSUNG|ES.M800|M6550B-SAM-4480)/i :seoul_electronics: !ruby/regexp /^ISUS0/i :sprint: !ruby/regexp /^Sprint$/i :utstarcom: !ruby/regexp /^T1A_UC1.88$/i models: :blackberry: !ruby/regexp /BlackBerry/i + :centro: !ruby/regexp /^Palm Centro$/i :dash: !ruby/regexp /T-Mobile Dash/i :droid: !ruby/regexp /Droid/i :htc: !ruby/regexp /HTC|Eris|HERO200/i :iphone: !ruby/regexp /iPhone/i software: :blackberry: !ruby/regexp /^Rim Exif/i filenames: :iphone: !ruby/regexp /^photo\.(JPG|PNG)$/i :video: !ruby/regexp /\.3gp$/ diff --git a/lib/mms2r/media.rb b/lib/mms2r/media.rb index f6c08bd..472ceb4 100644 --- a/lib/mms2r/media.rb +++ b/lib/mms2r/media.rb @@ -40,797 +40,798 @@ # mms = MMS2R::Media.new(mail) # picture = Picture.new # picture is an attachemnt_fu model # picture.title = mms.subject # picture.uploaded_data = mms.default_media # picture.save! # mms.purge # end # # == More Examples # # See the README.txt file for more examples # # == Built In Configuration # # A custom configuration can be created for processing the MMS from carriers # that are not currently known by MMS2R. In the conf/ directory create a # YAML file named by combining the domain name of the MMS sender plus a .yml # extension. For instance the configuration of senders from AT&T's cellular # service with a Sender pattern of [email protected] have a configuration # named conf/mms.att.net.yml # # The YAML configuration contains a Hash with instructions for determining what # is content generated by the user and what is content inserted by the carrier. # # The root hash itself has two hashes under the keys 'ignore' and 'transform', # and an array under the 'number' key. # Each hash is itself keyed by mime-type. The value pointed to by the mime-type # key is an array. The ignore arrays are first inspected as regular expressions # else are used as a equality for a string filename. Ignores # work by filename # for the multi-part of the MMS that is being inspected. The array pointed to # by the 'number' key represents an alternate mail header where the sender's # number can be found with a regular expression and replacement value for a # gsub. # # The transform arrays are themselves an array of two element arrays. The elements # are regexp parameters for gsub. # # Ignore instructions are honored first then transform instructions. In the sample, # masthead.jpg is ignored as a regular expression, and spacer.gif is ignored as a # filename comparison. The transform has a match and a replacement, see the gsub # documentation for more information about match and replace. # # -- # ignore: # image/jpeg: # - /^masthead.jpg$/i # image/gif: # - spacer.gif # text/plain: # - /\AThis message was sent using PIX-FLIX Messaging service from .*/m # transform: # text/plain: # - - /\A(.+?)\s+This message was sent using PIX-FLIX Messaging .*/m # - "\1" # number: # - from # - /^([^\s]+)\s.*/ # - "\1" # # Carriers often provide their services under many different domain names. # The conf/aliases.yml is a YAML file with a hash that maps alternative or # legacy carrier names to the most common name of their service. For example # in terms of MMS2R txt.att.net is an alias for mms.att.net. Therefore when # an MMS with a Sender of txt.att.net is processed MMS2R will use the # mms.att.net configuration to process the message. module MMS2R class MMS2R::Media # Pass off everything we don't do to the Mail object # TODO: refactor to explicit addition a la http://blog.jayfields.com/2008/02/ruby-replace-methodmissing-with-dynamic.html def method_missing method, *args, &block mail.send method, *args, &block end ## # Mail object that the media files were derived from. attr_reader :mail ## # media returns the hash of media. The media hash is keyed by mime-type # such as 'text/plain' and the value mapped to the key is an array of # media that are of that type. attr_reader :media ## # Carrier is the domain name of the carrier. If the carrier is not known # the carrier will be set to 'mms2r.media' attr_reader :carrier ## # Base working dir where media for a unique mms message are dropped attr_reader :media_dir ## # Determine if return-path or from is going to be used to desiginate the # origin carrier. If the domain in the From header is listed in # conf/from.yaml then that is the carrier domain. Else if there is a # Return-Path header its address's domain is the carrier doamin, else # use From header's address domain. def self.domain(mail) return_path = case when mail.return_path mail.return_path ? mail.return_path.split('@').last : '' else '' end from_domain = case when mail.from && mail.from.first mail.from.first.split('@').last else '' end f = File.expand_path(File.join(self.conf_dir(), "from.yml")) from = YAML::load_file(f) ret = case when from.include?(from_domain) from_domain when return_path.present? return_path else from_domain end ret end ## # Initialize a new MMS2R::Media comprised of a mail. # # Specify options to initialize with: # :logger => some_logger for logging # :process => :lazy, for non-greedy processing upon initialization # # #process will have to be called explicitly if the lazy process option # is chosen. def initialize(mail, opts={}) @mail = mail @logger = opts[:logger] log("#{self.class} created", :info) @carrier = self.class.domain(mail) @dir_count = 0 sha = Digest::SHA1.hexdigest("#{@carrier}-#{Time.now.to_i}-#{rand}") @media_dir = File.expand_path( File.join(self.tmp_dir(), "#{self.safe_message_id(@mail.message_id)}_#{sha}")) @media = {} @was_processed = false @number = nil @subject = nil @body = nil @exif = nil @default_media = nil @default_text = nil @default_html = nil f = File.expand_path(File.join(self.conf_dir(), "aliases.yml")) @aliases = YAML::load_file(f) conf = "#{@aliases[@carrier] || @carrier}.yml" f = File.expand_path(File.join(self.conf_dir(), conf)) c = File.exist?(f) ? YAML::load_file(f) : {} @config = self.class.initialize_config(c) processor_module = MMS2R::CARRIERS[@carrier] extend processor_module if processor_module lazy = (opts[:process] == :lazy) rescue false self.process() unless lazy end ## # Get the phone number associated with this MMS if it exists. The value # returned is simplistic, it is just the user name of the from address # before the @ symbol. Validation of the number is left to you. Most # carriers are using the real phone number as the username. def number unless @number params = config['number'] if params && params.any? && (header = mail.header[params[0]]) @number = header.to_s.gsub(params[1], params[2]) end if @number.nil? || @number.blank? @number = mail.from.first.split(/@|\//).first rescue "" end end @number end ## # Return the Subject for this message, returns "" for default carrier # subject such as 'Multimedia message' for ATT&T carrier. def subject unless @subject subject = mail.subject.strip rescue "" ignores = config['ignore']['text/plain'] if ignores && ignores.detect{|s| s == subject} @subject = "" else @subject = transform_text('text/plain', subject).last end end @subject end # Convenience method that returns a string including all the text of the # default text/plain file found. If the plain text is blank then it returns # stripped down version of the title and body of default text/html. Returns # empty string if no body text is found. def body text_file = default_text @body = text_file ? IO.readlines(text_file.path).join.strip : "" if @body.blank? && html_file = default_html html = Nokogiri::HTML(IO.read(html_file.path)) @body = (html.xpath("//head/title").map(&:text) + html.xpath("//body/*").map(&:text)).join(" ") end @body end # Returns a File with the most likely candidate for the user-submitted # media. Given that most MMS messages only have one file attached, this # method will try to return that file. Singleton methods are added to # the File object so it can be used in place of a CGI upload (local_path, # original_filename, size, and content_type) such as in conjunction with # AttachementFu. The largest file found in terms of bytes is returned. # # Returns nil if there are not any video or image Files found. def default_media @default_media ||= attachment(['video', 'image', 'application', 'text']) end # Returns a File with the most likely candidate that is text, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_text @default_text ||= attachment(['text/plain']) end # Returns a File with the most likely candidate that is html, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_html @default_html ||= attachment(['text/html']) end ## # process is a template method and collects all the media in a MMS. # Override helper methods to this template to clean out advertising and/or # ignore media that are advertising. This method should not be overridden # unless there is an extreme special case in processing the media of a MMS # (like Sprint) # # Helper methods for the process template: # * ignore_media? -- true if the media contained in a part should be ignored. # * process_media -- retrieves media to temporary file, returns path to file. # * transform_text -- called by process_media, strips out advertising. # * temp_file -- creates a temporary filepath based on information from the part. # # Block support: # Call process() with a block to automatically iterate through media. # For example, to process and receive only media of video type: # mms.process do |media_type, file| # results << file if media_type =~ /video/ # end # # note: purge must be explicitly called to remove the media files # mms2r extracts from an mms message. def process() # :yields: media_type, file unless @was_processed log("#{self.class} processing", :info) parts = mail.multipart? ? mail.parts : [mail] # Double check for multipart/related, if it exists replace it with its # children parts. Do this twice as multipart/alternative can have # children and we want to fold everything down for i in 1..2 flat = [] parts.each do |p| if p.multipart? p.parts.each {|mp| flat << mp } else flat << p end end parts = flat.dup end # get to work parts.each do |p| t = p.part_type? unless ignore_media?(t,p) t,f = process_media(p) add_file(t,f) unless t.nil? || f.nil? end end @was_processed = true end # when process acts upon a block if block_given? media.each do |k, v| yield(k, v) end end end ## # Helper for process template method to determine if media contained in a # part should be ignored. Producers should override this method to return # true for media such as images that are advertising, carrier logos, etc. # See the ignore section in the discussion of the built-in configuration. def ignore_media?(type, part) ignores = config['ignore'][type] || [] ignore = ignores.detect{ |test| filename?(part) == test} ignore ||= ignores.detect{ |test| filename?(part) =~ test if test.is_a?(Regexp) } ignore ||= ignores.detect{ |test| part.body.decoded.strip =~ test if test.is_a?(Regexp) } ignore ||= (part.body.decoded.strip.size == 0 ? true : nil) ignore.nil? ? false : true end ## # Helper for process template method to decode the part based on its type # and write its content to a temporary file. Returns path to temporary # file that holds the content. Parts with a main type of text will have # their contents transformed with a call to transform_text # # Producers should only override this method if the parts of the MMS need # special treatment besides what is expected for a normal mime part (like # Sprint). # # Returns a tuple of content type, file path def process_media(part) # Mail body auto-magically decodes quoted # printable for text/html type. file = temp_file(part) if part.part_type? =~ /^text\// || part.part_type? == 'application/smil' type, content = transform_text_part(part) mode = 'wb' else if part.part_type? == 'application/octet-stream' type = type_from_filename(filename?(part)) else type = part.part_type? end content = part.body.decoded mode = 'wb' # open with binary bit for Windows for non text end return type, nil if content.nil? || content.empty? log("#{self.class} writing file #{file}", :info) File.open(file, mode){ |f| f.write(content) } return type, file end ## # Helper for process_media template method to transform text. # See the transform section in the discussion of the built-in # configuration. def transform_text(type, text, original_encoding = 'ISO-8859-1') return type, text if !config['transform'] || !(transforms = config['transform'][type]) if RUBY_VERSION < "1.9" #convert to UTF-8 begin c = Iconv.new('UTF-8', original_encoding ) utf_t = c.iconv(text) rescue Exception => e utf_t = text end else utf_t = text.encoding == "ASCII-8BIT" ? text.force_encoding("ISO-8859-1").encode("UTF-8") : text end transforms.each do |transform| next unless transform.size == 2 p = transform.first r = transform.last utf_t = utf_t.gsub(p, r) rescue utf_t end return type, utf_t end ## # Helper for process_media template method to transform text. def transform_text_part(part) type = part.part_type? text = part.body.decoded.strip transform_text(type, text) end ## # Helper for process template method to name a temporary filepath based on # information in the part. This version attempts to honor the name of the # media as labeled in the part header and creates a unique temporary # directory for writing the file so filename collision does not occur. # Consumers of this method expect the directory structure to the file # exists, if the method is overridden it is mandatory that this behavior is # retained. def temp_file(part) file_name = filename?(part) File.expand_path(File.join(msg_tmp_dir(),File.basename(file_name))) end ## # Purges the unique MMS2R::Media.media_dir directory created # for this producer and all of the media that it contains. def purge() log("#{self.class} purging #{@media_dir} and all its contents", :info) FileUtils.rm_rf(@media_dir) end ## # Helper to add a file to the media hash. def add_file(type, file) media[type] = [] unless media[type] media[type] << file end ## # Helper to temp_file to create a unique temporary directory that is a # child of tmp_dir This version is based on the message_id of the mail. def msg_tmp_dir() @dir_count += 1 dir = File.expand_path(File.join(@media_dir, "#{@dir_count}")) FileUtils.mkdir_p(dir) dir end ## # returns a filename declared for a part, or a default if its not defined def filename?(part) name = part.filename if (name.nil? || name.empty?) if part.content_id && (matched = /^<(.+)>$/.match(part.content_id)) name = matched[1] else name = "#{Time.now.to_f}.#{self.default_ext(part.part_type?)}" end end # FIXME FWIW, janky look for dot extension 1 to 4 chars long name = (name =~ /\..{1,4}$/ ? name : "#{name}.#{self.default_ext(part.part_type?)}").strip # handle excessively large filenames if name.size > 255 ext = File.extname(name) base = File.basename(name, ext) name = "#{base[0, 255 - ext.size]}#{ext}" end name end def aliases @aliases end ## # Best guess of the mobile device type. Simple heuristics thus far by # inspecting mail headers and jpeg/tiff exif metadata, and file name. # Known smart phone types thus far are # # * :blackberry # * :dash # * :droid # * :htc # * :iphone # * :lge # * :motorola # * :nokia + # * :palm # * :pantech # * :samsung # # If the message is from a carrier known to MMS2R, and not a smart phone # its type is returned as :handset # Otherwise device type is :unknown def device_type? file = attachment(['image']) if file original = file.original_filename @exif = case original when /\.je?pg$/i EXIFR::JPEG.new(file) when /\.tiff?$/i EXIFR::TIFF.new(file) end if @exif models = config['device_types']['models'] rescue {} models.each do |type, regex| return type if @exif.model =~ regex end makes = config['device_types']['makes'] rescue {} makes.each do |type, regex| return type if @exif.make =~ regex end software = config['device_types']['software'] rescue {} software.each do |type, regex| return type if @exif.software =~ regex end end end headers = config['device_types']['headers'] rescue {} headers.keys.each do |header| if mail.header[header.downcase] # headers[header] refers to a hash of smart phone types with regex values # that if they match, the header signals the type should be returned headers[header].each do |type, regex| return type if mail.header[header.downcase].decoded =~ regex field = mail.header.fields.detect { |field| field.name.downcase == header.downcase } return type if field && field.to_s =~ regex end end end file = attachment(['image']) if file original_filename = file.original_filename filenames = config['device_types']['filenames'] rescue {} filenames.each do |type, regex| return type if original_filename =~ regex end end file = attachment(['video']) if file original_filename = file.original_filename filenames = config['device_types']['filenames'] rescue {} filenames.each do |type, regex| return type if original_filename =~ regex end end boundary = mail.boundary boundaries = config['device_types']['boundary'] rescue {} boundaries.each do |type, regex| return type if boundary =~ regex end return :handset if File.exist?( File.expand_path( File.join(self.conf_dir, "#{self.aliases[self.carrier] || self.carrier}.yml") ) ) :unknown end ## # exif object on default image from exifr gem def exif device_type? unless @exif @exif end ## # The source of the MMS was some sort of mobile or smart phone def is_mobile? self.device_type? != :unknown end ## # Get the temporary directory where media files are written to. def self.tmp_dir @@tmp_dir ||= File.expand_path(File.join(Dir.tmpdir, (ENV['USER'].nil? ? '':ENV['USER']), 'mms2r')) end ## # Set the temporary directory where media files are written to. def self.tmp_dir=(d) @@tmp_dir=d end ## # Get the directory where conf files are stored. def self.conf_dir @@conf_dir ||= File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'conf')) end ## # Set the directory where conf files are stored. def self.conf_dir=(d) @@conf_dir=d end ## # Helper to create a safe directory path element based on the mail message # id. def self.safe_message_id(mid) mid.nil? ? "#{Time.now.to_i}" : mid.gsub(/\$|<|>|@|\./, "") end ## # Returns a default file extension based on a content type def self.default_ext(content_type) if MMS2R::EXT[content_type] MMS2R::EXT[content_type] elsif content_type content_type.split('/').last end end ## # Joins the generic mms2r configuration with the carrier specific # configuration. def self.initialize_config(c) f = File.expand_path(File.join(self.conf_dir(), "mms2r_media.yml")) conf = YAML::load_file(f) conf['ignore'] ||= {} unless conf['ignore'] conf['transform'] = {} unless conf['transform'] conf['number'] = [] unless conf['number'] return conf unless c kinds = ['ignore', 'transform'] kinds.each do |kind| if c[kind] c[kind].each do |type,array| conf[kind][type] = [] unless conf[kind][type] conf[kind][type] += array end end end conf['number'] = c['number'] if c['number'] conf end def log(message, level = :info) @logger.send(level, message) unless @logger.nil? end ## # convenience accessor for self.class.conf_dir def conf_dir self.class.conf_dir end ## # convenience accessor for self.class.conf_dir def tmp_dir self.class.tmp_dir end ## # convenience accessor for self.class.default_ext def default_ext(type) self.class.default_ext(type) end ## # convenience accessor for self.class.safe_message_id def safe_message_id(message_id) self.class.safe_message_id(message_id) end ## # convenience accessor for self.class.initialize_confg def initialize_config(config) self.class.initialize_config(config) end private ## # accessor for the config def config @config end ## # guess content type from filename def type_from_filename(filename) ext = filename.split('.').last ent = MMS2R::EXT.detect{|k,v| v == ext} ent.nil? ? nil : ent.first end ## # used by #default_media and #text to return the biggest attachment type # listed in the types array def attachment(types) # get all the files that are of the major types passed in files = [] types.each do |type| media.keys.find_all{|k| type.include?("/") ? k == type : k.index(type) == 0 }.each do |key| files += media[key] end end return nil if files.empty? # set temp holders file = nil # explicitly declare the file and size size = 0 mime_type = nil #get the largest file files.each do |path| if File.size(path) > size size = File.size(path) file = File.new(path) media.each do |type,_files| mime_type = type if _files.detect{ |_path| _path == path } end end end return nil if file.nil? # These singleton methods implement the interface necessary to be used # as a drop-in replacement for files uploaded with CGI.rb. # This helps if you want to use the files with, for example, # attachment_fu. def file.local_path self.path end def file.original_filename File.basename(self.path) end def file.size File.size(self.path) end # this one is kind of confusing because it needs a closure. class << file self end.send(:define_method, :content_type) { mime_type } file end end end
monde/mms2r
6b75ca8f59b2df8801ac671febc4118cdfc39914
Detect nokia handsets.
diff --git a/conf/mms2r_media.yml b/conf/mms2r_media.yml index 8202cec..526606a 100644 --- a/conf/mms2r_media.yml +++ b/conf/mms2r_media.yml @@ -1,73 +1,74 @@ --- ignore: text/plain: - !ruby/regexp /^\(no subject\)$/i - !ruby/regexp /\ASent via BlackBerry (from|by) .*$/im - !ruby/regexp /\ASent from my Verizon Wireless BlackBerry$/im - !ruby/regexp /\ASent from (my|your) iPhone.?$/im - !ruby/regexp /\ASent on the Sprint.* Now Network.*$/im multipart/mixed: - !ruby/regexp "/^Attachment: /i" transform: text/plain: - - !ruby/regexp /\A(.*?)Sent via BlackBerry (from|by) .*$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from my Verizon Wireless BlackBerry$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from (my|your) iPhone.?$/im - "\\1" - - !ruby/regexp /\A(.*?)\s+image\/jpeg$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent on the Sprint.* Now Network.*$/im - "\\1" device_types: boundary: :motorola: !ruby/regexp /Motorola-A-Mail/i headers: x-mailer: :iphone: !ruby/regexp /iPhone Mail/i :blackberry: !ruby/regexp /Palm webOS/i mime-version: :iphone: !ruby/regexp /iPhone Mail/i x-rim-org-msg-ref-id: :blackberry: !ruby/regexp /.+/ user-agent: :iphone: !ruby/regexp /iPhone/i # TODO do something about the assortment of camera models that have # been seen: # 1.3 Megapixel, 2.0 Megapixel, BlackBerry, CU920, G'z One TYPE-S, # Hermes, iPhone, LG8700, LSI_S5K4AAFA, Micron MT9M113 1.3MP YUV, # Motorola Phone, Omni_vision-9650, Pre, # Seoul Electronics & Telecom SIM120B 1.3M, SGH-T729, SGH-T819, # SPH-M540, SPH-M800, SYSTEMLSI S5K4BAFB 2.0 MP, VX-9700 # # NOTE: These model strings are stored in the exif model header of an image file # created and sent by the device, the regex is used by mms2r to detect the # model string makes: :android: !ruby/regexp /Android/i :apple: !ruby/regexp /^(Apple|Hipstamatic)$/i :casio: !ruby/regexp /^CASIO$/i :dash: !ruby/regexp /T-Mobile Dash/i :google: !ruby/regexp /^google$/i :htc: !ruby/regexp /^HTC/i :lge: !ruby/regexp /^(LG|CX87BL05)/i :motorola: !ruby/regexp /^Motorola/i + :nokia: !ruby/regexp /^Nokia/i :pantech: !ruby/regexp /^PANTECH$/i :qualcomm: !ruby/regexp /^MSM6/i :research_in_motion: !ruby/regexp /^(RIM|Research In Motion)$/i :samsung: !ruby/regexp /^(SAMSUNG|ES.M800|M6550B-SAM-4480)/i :seoul_electronics: !ruby/regexp /^ISUS0/i :sprint: !ruby/regexp /^Sprint$/i :utstarcom: !ruby/regexp /^T1A_UC1.88$/i models: :blackberry: !ruby/regexp /BlackBerry/i :dash: !ruby/regexp /T-Mobile Dash/i :droid: !ruby/regexp /Droid/i :htc: !ruby/regexp /HTC|Eris|HERO200/i :iphone: !ruby/regexp /iPhone/i software: :blackberry: !ruby/regexp /^Rim Exif/i filenames: :iphone: !ruby/regexp /^photo\.(JPG|PNG)$/i :video: !ruby/regexp /\.3gp$/ diff --git a/lib/mms2r/media.rb b/lib/mms2r/media.rb index d89038a..f6c08bd 100644 --- a/lib/mms2r/media.rb +++ b/lib/mms2r/media.rb @@ -39,797 +39,798 @@ # def receive(mail) # mms = MMS2R::Media.new(mail) # picture = Picture.new # picture is an attachemnt_fu model # picture.title = mms.subject # picture.uploaded_data = mms.default_media # picture.save! # mms.purge # end # # == More Examples # # See the README.txt file for more examples # # == Built In Configuration # # A custom configuration can be created for processing the MMS from carriers # that are not currently known by MMS2R. In the conf/ directory create a # YAML file named by combining the domain name of the MMS sender plus a .yml # extension. For instance the configuration of senders from AT&T's cellular # service with a Sender pattern of [email protected] have a configuration # named conf/mms.att.net.yml # # The YAML configuration contains a Hash with instructions for determining what # is content generated by the user and what is content inserted by the carrier. # # The root hash itself has two hashes under the keys 'ignore' and 'transform', # and an array under the 'number' key. # Each hash is itself keyed by mime-type. The value pointed to by the mime-type # key is an array. The ignore arrays are first inspected as regular expressions # else are used as a equality for a string filename. Ignores # work by filename # for the multi-part of the MMS that is being inspected. The array pointed to # by the 'number' key represents an alternate mail header where the sender's # number can be found with a regular expression and replacement value for a # gsub. # # The transform arrays are themselves an array of two element arrays. The elements # are regexp parameters for gsub. # # Ignore instructions are honored first then transform instructions. In the sample, # masthead.jpg is ignored as a regular expression, and spacer.gif is ignored as a # filename comparison. The transform has a match and a replacement, see the gsub # documentation for more information about match and replace. # # -- # ignore: # image/jpeg: # - /^masthead.jpg$/i # image/gif: # - spacer.gif # text/plain: # - /\AThis message was sent using PIX-FLIX Messaging service from .*/m # transform: # text/plain: # - - /\A(.+?)\s+This message was sent using PIX-FLIX Messaging .*/m # - "\1" # number: # - from # - /^([^\s]+)\s.*/ # - "\1" # # Carriers often provide their services under many different domain names. # The conf/aliases.yml is a YAML file with a hash that maps alternative or # legacy carrier names to the most common name of their service. For example # in terms of MMS2R txt.att.net is an alias for mms.att.net. Therefore when # an MMS with a Sender of txt.att.net is processed MMS2R will use the # mms.att.net configuration to process the message. module MMS2R class MMS2R::Media # Pass off everything we don't do to the Mail object # TODO: refactor to explicit addition a la http://blog.jayfields.com/2008/02/ruby-replace-methodmissing-with-dynamic.html def method_missing method, *args, &block mail.send method, *args, &block end ## # Mail object that the media files were derived from. attr_reader :mail ## # media returns the hash of media. The media hash is keyed by mime-type # such as 'text/plain' and the value mapped to the key is an array of # media that are of that type. attr_reader :media ## # Carrier is the domain name of the carrier. If the carrier is not known # the carrier will be set to 'mms2r.media' attr_reader :carrier ## # Base working dir where media for a unique mms message are dropped attr_reader :media_dir ## # Determine if return-path or from is going to be used to desiginate the # origin carrier. If the domain in the From header is listed in # conf/from.yaml then that is the carrier domain. Else if there is a # Return-Path header its address's domain is the carrier doamin, else # use From header's address domain. def self.domain(mail) return_path = case when mail.return_path mail.return_path ? mail.return_path.split('@').last : '' else '' end from_domain = case when mail.from && mail.from.first mail.from.first.split('@').last else '' end f = File.expand_path(File.join(self.conf_dir(), "from.yml")) from = YAML::load_file(f) ret = case when from.include?(from_domain) from_domain when return_path.present? return_path else from_domain end ret end ## # Initialize a new MMS2R::Media comprised of a mail. # # Specify options to initialize with: # :logger => some_logger for logging # :process => :lazy, for non-greedy processing upon initialization # # #process will have to be called explicitly if the lazy process option # is chosen. def initialize(mail, opts={}) @mail = mail @logger = opts[:logger] log("#{self.class} created", :info) @carrier = self.class.domain(mail) @dir_count = 0 sha = Digest::SHA1.hexdigest("#{@carrier}-#{Time.now.to_i}-#{rand}") @media_dir = File.expand_path( File.join(self.tmp_dir(), "#{self.safe_message_id(@mail.message_id)}_#{sha}")) @media = {} @was_processed = false @number = nil @subject = nil @body = nil @exif = nil @default_media = nil @default_text = nil @default_html = nil f = File.expand_path(File.join(self.conf_dir(), "aliases.yml")) @aliases = YAML::load_file(f) conf = "#{@aliases[@carrier] || @carrier}.yml" f = File.expand_path(File.join(self.conf_dir(), conf)) c = File.exist?(f) ? YAML::load_file(f) : {} @config = self.class.initialize_config(c) processor_module = MMS2R::CARRIERS[@carrier] extend processor_module if processor_module lazy = (opts[:process] == :lazy) rescue false self.process() unless lazy end ## # Get the phone number associated with this MMS if it exists. The value # returned is simplistic, it is just the user name of the from address # before the @ symbol. Validation of the number is left to you. Most # carriers are using the real phone number as the username. def number unless @number params = config['number'] if params && params.any? && (header = mail.header[params[0]]) @number = header.to_s.gsub(params[1], params[2]) end if @number.nil? || @number.blank? @number = mail.from.first.split(/@|\//).first rescue "" end end @number end ## # Return the Subject for this message, returns "" for default carrier # subject such as 'Multimedia message' for ATT&T carrier. def subject unless @subject subject = mail.subject.strip rescue "" ignores = config['ignore']['text/plain'] if ignores && ignores.detect{|s| s == subject} @subject = "" else @subject = transform_text('text/plain', subject).last end end @subject end # Convenience method that returns a string including all the text of the # default text/plain file found. If the plain text is blank then it returns # stripped down version of the title and body of default text/html. Returns # empty string if no body text is found. def body text_file = default_text @body = text_file ? IO.readlines(text_file.path).join.strip : "" if @body.blank? && html_file = default_html html = Nokogiri::HTML(IO.read(html_file.path)) @body = (html.xpath("//head/title").map(&:text) + html.xpath("//body/*").map(&:text)).join(" ") end @body end # Returns a File with the most likely candidate for the user-submitted # media. Given that most MMS messages only have one file attached, this # method will try to return that file. Singleton methods are added to # the File object so it can be used in place of a CGI upload (local_path, # original_filename, size, and content_type) such as in conjunction with # AttachementFu. The largest file found in terms of bytes is returned. # # Returns nil if there are not any video or image Files found. def default_media @default_media ||= attachment(['video', 'image', 'application', 'text']) end # Returns a File with the most likely candidate that is text, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_text @default_text ||= attachment(['text/plain']) end # Returns a File with the most likely candidate that is html, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_html @default_html ||= attachment(['text/html']) end ## # process is a template method and collects all the media in a MMS. # Override helper methods to this template to clean out advertising and/or # ignore media that are advertising. This method should not be overridden # unless there is an extreme special case in processing the media of a MMS # (like Sprint) # # Helper methods for the process template: # * ignore_media? -- true if the media contained in a part should be ignored. # * process_media -- retrieves media to temporary file, returns path to file. # * transform_text -- called by process_media, strips out advertising. # * temp_file -- creates a temporary filepath based on information from the part. # # Block support: # Call process() with a block to automatically iterate through media. # For example, to process and receive only media of video type: # mms.process do |media_type, file| # results << file if media_type =~ /video/ # end # # note: purge must be explicitly called to remove the media files # mms2r extracts from an mms message. def process() # :yields: media_type, file unless @was_processed log("#{self.class} processing", :info) parts = mail.multipart? ? mail.parts : [mail] # Double check for multipart/related, if it exists replace it with its # children parts. Do this twice as multipart/alternative can have # children and we want to fold everything down for i in 1..2 flat = [] parts.each do |p| if p.multipart? p.parts.each {|mp| flat << mp } else flat << p end end parts = flat.dup end # get to work parts.each do |p| t = p.part_type? unless ignore_media?(t,p) t,f = process_media(p) add_file(t,f) unless t.nil? || f.nil? end end @was_processed = true end # when process acts upon a block if block_given? media.each do |k, v| yield(k, v) end end end ## # Helper for process template method to determine if media contained in a # part should be ignored. Producers should override this method to return # true for media such as images that are advertising, carrier logos, etc. # See the ignore section in the discussion of the built-in configuration. def ignore_media?(type, part) ignores = config['ignore'][type] || [] ignore = ignores.detect{ |test| filename?(part) == test} ignore ||= ignores.detect{ |test| filename?(part) =~ test if test.is_a?(Regexp) } ignore ||= ignores.detect{ |test| part.body.decoded.strip =~ test if test.is_a?(Regexp) } ignore ||= (part.body.decoded.strip.size == 0 ? true : nil) ignore.nil? ? false : true end ## # Helper for process template method to decode the part based on its type # and write its content to a temporary file. Returns path to temporary # file that holds the content. Parts with a main type of text will have # their contents transformed with a call to transform_text # # Producers should only override this method if the parts of the MMS need # special treatment besides what is expected for a normal mime part (like # Sprint). # # Returns a tuple of content type, file path def process_media(part) # Mail body auto-magically decodes quoted # printable for text/html type. file = temp_file(part) if part.part_type? =~ /^text\// || part.part_type? == 'application/smil' type, content = transform_text_part(part) mode = 'wb' else if part.part_type? == 'application/octet-stream' type = type_from_filename(filename?(part)) else type = part.part_type? end content = part.body.decoded mode = 'wb' # open with binary bit for Windows for non text end return type, nil if content.nil? || content.empty? log("#{self.class} writing file #{file}", :info) File.open(file, mode){ |f| f.write(content) } return type, file end ## # Helper for process_media template method to transform text. # See the transform section in the discussion of the built-in # configuration. def transform_text(type, text, original_encoding = 'ISO-8859-1') return type, text if !config['transform'] || !(transforms = config['transform'][type]) if RUBY_VERSION < "1.9" #convert to UTF-8 begin c = Iconv.new('UTF-8', original_encoding ) utf_t = c.iconv(text) rescue Exception => e utf_t = text end else utf_t = text.encoding == "ASCII-8BIT" ? text.force_encoding("ISO-8859-1").encode("UTF-8") : text end transforms.each do |transform| next unless transform.size == 2 p = transform.first r = transform.last utf_t = utf_t.gsub(p, r) rescue utf_t end return type, utf_t end ## # Helper for process_media template method to transform text. def transform_text_part(part) type = part.part_type? text = part.body.decoded.strip transform_text(type, text) end ## # Helper for process template method to name a temporary filepath based on # information in the part. This version attempts to honor the name of the # media as labeled in the part header and creates a unique temporary # directory for writing the file so filename collision does not occur. # Consumers of this method expect the directory structure to the file # exists, if the method is overridden it is mandatory that this behavior is # retained. def temp_file(part) file_name = filename?(part) File.expand_path(File.join(msg_tmp_dir(),File.basename(file_name))) end ## # Purges the unique MMS2R::Media.media_dir directory created # for this producer and all of the media that it contains. def purge() log("#{self.class} purging #{@media_dir} and all its contents", :info) FileUtils.rm_rf(@media_dir) end ## # Helper to add a file to the media hash. def add_file(type, file) media[type] = [] unless media[type] media[type] << file end ## # Helper to temp_file to create a unique temporary directory that is a # child of tmp_dir This version is based on the message_id of the mail. def msg_tmp_dir() @dir_count += 1 dir = File.expand_path(File.join(@media_dir, "#{@dir_count}")) FileUtils.mkdir_p(dir) dir end ## # returns a filename declared for a part, or a default if its not defined def filename?(part) name = part.filename if (name.nil? || name.empty?) if part.content_id && (matched = /^<(.+)>$/.match(part.content_id)) name = matched[1] else name = "#{Time.now.to_f}.#{self.default_ext(part.part_type?)}" end end # FIXME FWIW, janky look for dot extension 1 to 4 chars long name = (name =~ /\..{1,4}$/ ? name : "#{name}.#{self.default_ext(part.part_type?)}").strip # handle excessively large filenames if name.size > 255 ext = File.extname(name) base = File.basename(name, ext) name = "#{base[0, 255 - ext.size]}#{ext}" end name end def aliases @aliases end ## # Best guess of the mobile device type. Simple heuristics thus far by # inspecting mail headers and jpeg/tiff exif metadata, and file name. # Known smart phone types thus far are # # * :blackberry # * :dash # * :droid # * :htc # * :iphone # * :lge # * :motorola + # * :nokia # * :pantech # * :samsung # # If the message is from a carrier known to MMS2R, and not a smart phone # its type is returned as :handset # Otherwise device type is :unknown def device_type? file = attachment(['image']) if file original = file.original_filename @exif = case original when /\.je?pg$/i EXIFR::JPEG.new(file) when /\.tiff?$/i EXIFR::TIFF.new(file) end if @exif models = config['device_types']['models'] rescue {} models.each do |type, regex| return type if @exif.model =~ regex end makes = config['device_types']['makes'] rescue {} makes.each do |type, regex| return type if @exif.make =~ regex end software = config['device_types']['software'] rescue {} software.each do |type, regex| return type if @exif.software =~ regex end end end headers = config['device_types']['headers'] rescue {} headers.keys.each do |header| if mail.header[header.downcase] # headers[header] refers to a hash of smart phone types with regex values # that if they match, the header signals the type should be returned headers[header].each do |type, regex| return type if mail.header[header.downcase].decoded =~ regex field = mail.header.fields.detect { |field| field.name.downcase == header.downcase } return type if field && field.to_s =~ regex end end end file = attachment(['image']) if file original_filename = file.original_filename filenames = config['device_types']['filenames'] rescue {} filenames.each do |type, regex| return type if original_filename =~ regex end end file = attachment(['video']) if file original_filename = file.original_filename filenames = config['device_types']['filenames'] rescue {} filenames.each do |type, regex| return type if original_filename =~ regex end end boundary = mail.boundary boundaries = config['device_types']['boundary'] rescue {} boundaries.each do |type, regex| return type if boundary =~ regex end return :handset if File.exist?( File.expand_path( File.join(self.conf_dir, "#{self.aliases[self.carrier] || self.carrier}.yml") ) ) :unknown end ## # exif object on default image from exifr gem def exif device_type? unless @exif @exif end ## # The source of the MMS was some sort of mobile or smart phone def is_mobile? self.device_type? != :unknown end ## # Get the temporary directory where media files are written to. def self.tmp_dir @@tmp_dir ||= File.expand_path(File.join(Dir.tmpdir, (ENV['USER'].nil? ? '':ENV['USER']), 'mms2r')) end ## # Set the temporary directory where media files are written to. def self.tmp_dir=(d) @@tmp_dir=d end ## # Get the directory where conf files are stored. def self.conf_dir @@conf_dir ||= File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'conf')) end ## # Set the directory where conf files are stored. def self.conf_dir=(d) @@conf_dir=d end ## # Helper to create a safe directory path element based on the mail message # id. def self.safe_message_id(mid) mid.nil? ? "#{Time.now.to_i}" : mid.gsub(/\$|<|>|@|\./, "") end ## # Returns a default file extension based on a content type def self.default_ext(content_type) if MMS2R::EXT[content_type] MMS2R::EXT[content_type] elsif content_type content_type.split('/').last end end ## # Joins the generic mms2r configuration with the carrier specific # configuration. def self.initialize_config(c) f = File.expand_path(File.join(self.conf_dir(), "mms2r_media.yml")) conf = YAML::load_file(f) conf['ignore'] ||= {} unless conf['ignore'] conf['transform'] = {} unless conf['transform'] conf['number'] = [] unless conf['number'] return conf unless c kinds = ['ignore', 'transform'] kinds.each do |kind| if c[kind] c[kind].each do |type,array| conf[kind][type] = [] unless conf[kind][type] conf[kind][type] += array end end end conf['number'] = c['number'] if c['number'] conf end def log(message, level = :info) @logger.send(level, message) unless @logger.nil? end ## # convenience accessor for self.class.conf_dir def conf_dir self.class.conf_dir end ## # convenience accessor for self.class.conf_dir def tmp_dir self.class.tmp_dir end ## # convenience accessor for self.class.default_ext def default_ext(type) self.class.default_ext(type) end ## # convenience accessor for self.class.safe_message_id def safe_message_id(message_id) self.class.safe_message_id(message_id) end ## # convenience accessor for self.class.initialize_confg def initialize_config(config) self.class.initialize_config(config) end private ## # accessor for the config def config @config end ## # guess content type from filename def type_from_filename(filename) ext = filename.split('.').last ent = MMS2R::EXT.detect{|k,v| v == ext} ent.nil? ? nil : ent.first end ## # used by #default_media and #text to return the biggest attachment type # listed in the types array def attachment(types) # get all the files that are of the major types passed in files = [] types.each do |type| media.keys.find_all{|k| type.include?("/") ? k == type : k.index(type) == 0 }.each do |key| files += media[key] end end return nil if files.empty? # set temp holders file = nil # explicitly declare the file and size size = 0 mime_type = nil #get the largest file files.each do |path| if File.size(path) > size size = File.size(path) file = File.new(path) media.each do |type,_files| mime_type = type if _files.detect{ |_path| _path == path } end end end return nil if file.nil? # These singleton methods implement the interface necessary to be used # as a drop-in replacement for files uploaded with CGI.rb. # This helps if you want to use the files with, for example, # attachment_fu. def file.local_path self.path end def file.original_filename File.basename(self.path) end def file.size File.size(self.path) end # this one is kind of confusing because it needs a closure. class << file self end.send(:define_method, :content_type) { mime_type } file end end end
monde/mms2r
b4b376d8c8bcdc76495e76902b07c2e603293e46
Detect motorola handsets by the inspecting the naming pattern of it mail parts boundary.
diff --git a/conf/mms2r_media.yml b/conf/mms2r_media.yml index 539897f..8202cec 100644 --- a/conf/mms2r_media.yml +++ b/conf/mms2r_media.yml @@ -1,71 +1,73 @@ --- ignore: text/plain: - !ruby/regexp /^\(no subject\)$/i - !ruby/regexp /\ASent via BlackBerry (from|by) .*$/im - !ruby/regexp /\ASent from my Verizon Wireless BlackBerry$/im - !ruby/regexp /\ASent from (my|your) iPhone.?$/im - !ruby/regexp /\ASent on the Sprint.* Now Network.*$/im multipart/mixed: - !ruby/regexp "/^Attachment: /i" transform: text/plain: - - !ruby/regexp /\A(.*?)Sent via BlackBerry (from|by) .*$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from my Verizon Wireless BlackBerry$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from (my|your) iPhone.?$/im - "\\1" - - !ruby/regexp /\A(.*?)\s+image\/jpeg$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent on the Sprint.* Now Network.*$/im - "\\1" device_types: + boundary: + :motorola: !ruby/regexp /Motorola-A-Mail/i headers: x-mailer: :iphone: !ruby/regexp /iPhone Mail/i :blackberry: !ruby/regexp /Palm webOS/i mime-version: :iphone: !ruby/regexp /iPhone Mail/i x-rim-org-msg-ref-id: :blackberry: !ruby/regexp /.+/ user-agent: :iphone: !ruby/regexp /iPhone/i # TODO do something about the assortment of camera models that have # been seen: # 1.3 Megapixel, 2.0 Megapixel, BlackBerry, CU920, G'z One TYPE-S, # Hermes, iPhone, LG8700, LSI_S5K4AAFA, Micron MT9M113 1.3MP YUV, # Motorola Phone, Omni_vision-9650, Pre, # Seoul Electronics & Telecom SIM120B 1.3M, SGH-T729, SGH-T819, # SPH-M540, SPH-M800, SYSTEMLSI S5K4BAFB 2.0 MP, VX-9700 # # NOTE: These model strings are stored in the exif model header of an image file # created and sent by the device, the regex is used by mms2r to detect the # model string makes: :android: !ruby/regexp /Android/i :apple: !ruby/regexp /^(Apple|Hipstamatic)$/i :casio: !ruby/regexp /^CASIO$/i :dash: !ruby/regexp /T-Mobile Dash/i :google: !ruby/regexp /^google$/i :htc: !ruby/regexp /^HTC/i :lge: !ruby/regexp /^(LG|CX87BL05)/i :motorola: !ruby/regexp /^Motorola/i :pantech: !ruby/regexp /^PANTECH$/i :qualcomm: !ruby/regexp /^MSM6/i :research_in_motion: !ruby/regexp /^(RIM|Research In Motion)$/i :samsung: !ruby/regexp /^(SAMSUNG|ES.M800|M6550B-SAM-4480)/i :seoul_electronics: !ruby/regexp /^ISUS0/i :sprint: !ruby/regexp /^Sprint$/i :utstarcom: !ruby/regexp /^T1A_UC1.88$/i models: :blackberry: !ruby/regexp /BlackBerry/i :dash: !ruby/regexp /T-Mobile Dash/i :droid: !ruby/regexp /Droid/i :htc: !ruby/regexp /HTC|Eris|HERO200/i :iphone: !ruby/regexp /iPhone/i software: :blackberry: !ruby/regexp /^Rim Exif/i filenames: :iphone: !ruby/regexp /^photo\.(JPG|PNG)$/i :video: !ruby/regexp /\.3gp$/ diff --git a/lib/mms2r/media.rb b/lib/mms2r/media.rb index f43533c..d89038a 100644 --- a/lib/mms2r/media.rb +++ b/lib/mms2r/media.rb @@ -104,726 +104,732 @@ # mms.att.net configuration to process the message. module MMS2R class MMS2R::Media # Pass off everything we don't do to the Mail object # TODO: refactor to explicit addition a la http://blog.jayfields.com/2008/02/ruby-replace-methodmissing-with-dynamic.html def method_missing method, *args, &block mail.send method, *args, &block end ## # Mail object that the media files were derived from. attr_reader :mail ## # media returns the hash of media. The media hash is keyed by mime-type # such as 'text/plain' and the value mapped to the key is an array of # media that are of that type. attr_reader :media ## # Carrier is the domain name of the carrier. If the carrier is not known # the carrier will be set to 'mms2r.media' attr_reader :carrier ## # Base working dir where media for a unique mms message are dropped attr_reader :media_dir ## # Determine if return-path or from is going to be used to desiginate the # origin carrier. If the domain in the From header is listed in # conf/from.yaml then that is the carrier domain. Else if there is a # Return-Path header its address's domain is the carrier doamin, else # use From header's address domain. def self.domain(mail) return_path = case when mail.return_path mail.return_path ? mail.return_path.split('@').last : '' else '' end from_domain = case when mail.from && mail.from.first mail.from.first.split('@').last else '' end f = File.expand_path(File.join(self.conf_dir(), "from.yml")) from = YAML::load_file(f) ret = case when from.include?(from_domain) from_domain when return_path.present? return_path else from_domain end ret end ## # Initialize a new MMS2R::Media comprised of a mail. # # Specify options to initialize with: # :logger => some_logger for logging # :process => :lazy, for non-greedy processing upon initialization # # #process will have to be called explicitly if the lazy process option # is chosen. def initialize(mail, opts={}) @mail = mail @logger = opts[:logger] log("#{self.class} created", :info) @carrier = self.class.domain(mail) @dir_count = 0 sha = Digest::SHA1.hexdigest("#{@carrier}-#{Time.now.to_i}-#{rand}") @media_dir = File.expand_path( File.join(self.tmp_dir(), "#{self.safe_message_id(@mail.message_id)}_#{sha}")) @media = {} @was_processed = false @number = nil @subject = nil @body = nil @exif = nil @default_media = nil @default_text = nil @default_html = nil f = File.expand_path(File.join(self.conf_dir(), "aliases.yml")) @aliases = YAML::load_file(f) conf = "#{@aliases[@carrier] || @carrier}.yml" f = File.expand_path(File.join(self.conf_dir(), conf)) c = File.exist?(f) ? YAML::load_file(f) : {} @config = self.class.initialize_config(c) processor_module = MMS2R::CARRIERS[@carrier] extend processor_module if processor_module lazy = (opts[:process] == :lazy) rescue false self.process() unless lazy end ## # Get the phone number associated with this MMS if it exists. The value # returned is simplistic, it is just the user name of the from address # before the @ symbol. Validation of the number is left to you. Most # carriers are using the real phone number as the username. def number unless @number params = config['number'] if params && params.any? && (header = mail.header[params[0]]) @number = header.to_s.gsub(params[1], params[2]) end if @number.nil? || @number.blank? @number = mail.from.first.split(/@|\//).first rescue "" end end @number end ## # Return the Subject for this message, returns "" for default carrier # subject such as 'Multimedia message' for ATT&T carrier. def subject unless @subject subject = mail.subject.strip rescue "" ignores = config['ignore']['text/plain'] if ignores && ignores.detect{|s| s == subject} @subject = "" else @subject = transform_text('text/plain', subject).last end end @subject end # Convenience method that returns a string including all the text of the # default text/plain file found. If the plain text is blank then it returns # stripped down version of the title and body of default text/html. Returns # empty string if no body text is found. def body text_file = default_text @body = text_file ? IO.readlines(text_file.path).join.strip : "" if @body.blank? && html_file = default_html html = Nokogiri::HTML(IO.read(html_file.path)) @body = (html.xpath("//head/title").map(&:text) + html.xpath("//body/*").map(&:text)).join(" ") end @body end # Returns a File with the most likely candidate for the user-submitted # media. Given that most MMS messages only have one file attached, this # method will try to return that file. Singleton methods are added to # the File object so it can be used in place of a CGI upload (local_path, # original_filename, size, and content_type) such as in conjunction with # AttachementFu. The largest file found in terms of bytes is returned. # # Returns nil if there are not any video or image Files found. def default_media @default_media ||= attachment(['video', 'image', 'application', 'text']) end # Returns a File with the most likely candidate that is text, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_text @default_text ||= attachment(['text/plain']) end # Returns a File with the most likely candidate that is html, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_html @default_html ||= attachment(['text/html']) end ## # process is a template method and collects all the media in a MMS. # Override helper methods to this template to clean out advertising and/or # ignore media that are advertising. This method should not be overridden # unless there is an extreme special case in processing the media of a MMS # (like Sprint) # # Helper methods for the process template: # * ignore_media? -- true if the media contained in a part should be ignored. # * process_media -- retrieves media to temporary file, returns path to file. # * transform_text -- called by process_media, strips out advertising. # * temp_file -- creates a temporary filepath based on information from the part. # # Block support: # Call process() with a block to automatically iterate through media. # For example, to process and receive only media of video type: # mms.process do |media_type, file| # results << file if media_type =~ /video/ # end # # note: purge must be explicitly called to remove the media files # mms2r extracts from an mms message. def process() # :yields: media_type, file unless @was_processed log("#{self.class} processing", :info) parts = mail.multipart? ? mail.parts : [mail] # Double check for multipart/related, if it exists replace it with its # children parts. Do this twice as multipart/alternative can have # children and we want to fold everything down for i in 1..2 flat = [] parts.each do |p| if p.multipart? p.parts.each {|mp| flat << mp } else flat << p end end parts = flat.dup end # get to work parts.each do |p| t = p.part_type? unless ignore_media?(t,p) t,f = process_media(p) add_file(t,f) unless t.nil? || f.nil? end end @was_processed = true end # when process acts upon a block if block_given? media.each do |k, v| yield(k, v) end end end ## # Helper for process template method to determine if media contained in a # part should be ignored. Producers should override this method to return # true for media such as images that are advertising, carrier logos, etc. # See the ignore section in the discussion of the built-in configuration. def ignore_media?(type, part) ignores = config['ignore'][type] || [] ignore = ignores.detect{ |test| filename?(part) == test} ignore ||= ignores.detect{ |test| filename?(part) =~ test if test.is_a?(Regexp) } ignore ||= ignores.detect{ |test| part.body.decoded.strip =~ test if test.is_a?(Regexp) } ignore ||= (part.body.decoded.strip.size == 0 ? true : nil) ignore.nil? ? false : true end ## # Helper for process template method to decode the part based on its type # and write its content to a temporary file. Returns path to temporary # file that holds the content. Parts with a main type of text will have # their contents transformed with a call to transform_text # # Producers should only override this method if the parts of the MMS need # special treatment besides what is expected for a normal mime part (like # Sprint). # # Returns a tuple of content type, file path def process_media(part) # Mail body auto-magically decodes quoted # printable for text/html type. file = temp_file(part) if part.part_type? =~ /^text\// || part.part_type? == 'application/smil' type, content = transform_text_part(part) mode = 'wb' else if part.part_type? == 'application/octet-stream' type = type_from_filename(filename?(part)) else type = part.part_type? end content = part.body.decoded mode = 'wb' # open with binary bit for Windows for non text end return type, nil if content.nil? || content.empty? log("#{self.class} writing file #{file}", :info) File.open(file, mode){ |f| f.write(content) } return type, file end ## # Helper for process_media template method to transform text. # See the transform section in the discussion of the built-in # configuration. def transform_text(type, text, original_encoding = 'ISO-8859-1') return type, text if !config['transform'] || !(transforms = config['transform'][type]) if RUBY_VERSION < "1.9" #convert to UTF-8 begin c = Iconv.new('UTF-8', original_encoding ) utf_t = c.iconv(text) rescue Exception => e utf_t = text end else utf_t = text.encoding == "ASCII-8BIT" ? text.force_encoding("ISO-8859-1").encode("UTF-8") : text end transforms.each do |transform| next unless transform.size == 2 p = transform.first r = transform.last utf_t = utf_t.gsub(p, r) rescue utf_t end return type, utf_t end ## # Helper for process_media template method to transform text. def transform_text_part(part) type = part.part_type? text = part.body.decoded.strip transform_text(type, text) end ## # Helper for process template method to name a temporary filepath based on # information in the part. This version attempts to honor the name of the # media as labeled in the part header and creates a unique temporary # directory for writing the file so filename collision does not occur. # Consumers of this method expect the directory structure to the file # exists, if the method is overridden it is mandatory that this behavior is # retained. def temp_file(part) file_name = filename?(part) File.expand_path(File.join(msg_tmp_dir(),File.basename(file_name))) end ## # Purges the unique MMS2R::Media.media_dir directory created # for this producer and all of the media that it contains. def purge() log("#{self.class} purging #{@media_dir} and all its contents", :info) FileUtils.rm_rf(@media_dir) end ## # Helper to add a file to the media hash. def add_file(type, file) media[type] = [] unless media[type] media[type] << file end ## # Helper to temp_file to create a unique temporary directory that is a # child of tmp_dir This version is based on the message_id of the mail. def msg_tmp_dir() @dir_count += 1 dir = File.expand_path(File.join(@media_dir, "#{@dir_count}")) FileUtils.mkdir_p(dir) dir end ## # returns a filename declared for a part, or a default if its not defined def filename?(part) name = part.filename if (name.nil? || name.empty?) if part.content_id && (matched = /^<(.+)>$/.match(part.content_id)) name = matched[1] else name = "#{Time.now.to_f}.#{self.default_ext(part.part_type?)}" end end # FIXME FWIW, janky look for dot extension 1 to 4 chars long name = (name =~ /\..{1,4}$/ ? name : "#{name}.#{self.default_ext(part.part_type?)}").strip # handle excessively large filenames if name.size > 255 ext = File.extname(name) base = File.basename(name, ext) name = "#{base[0, 255 - ext.size]}#{ext}" end name end def aliases @aliases end ## # Best guess of the mobile device type. Simple heuristics thus far by # inspecting mail headers and jpeg/tiff exif metadata, and file name. # Known smart phone types thus far are # # * :blackberry # * :dash # * :droid # * :htc # * :iphone # * :lge # * :motorola # * :pantech # * :samsung # # If the message is from a carrier known to MMS2R, and not a smart phone # its type is returned as :handset # Otherwise device type is :unknown def device_type? file = attachment(['image']) if file original = file.original_filename @exif = case original when /\.je?pg$/i EXIFR::JPEG.new(file) when /\.tiff?$/i EXIFR::TIFF.new(file) end if @exif models = config['device_types']['models'] rescue {} models.each do |type, regex| return type if @exif.model =~ regex end makes = config['device_types']['makes'] rescue {} makes.each do |type, regex| return type if @exif.make =~ regex end software = config['device_types']['software'] rescue {} software.each do |type, regex| return type if @exif.software =~ regex end end end headers = config['device_types']['headers'] rescue {} headers.keys.each do |header| if mail.header[header.downcase] # headers[header] refers to a hash of smart phone types with regex values # that if they match, the header signals the type should be returned headers[header].each do |type, regex| return type if mail.header[header.downcase].decoded =~ regex field = mail.header.fields.detect { |field| field.name.downcase == header.downcase } return type if field && field.to_s =~ regex end end end file = attachment(['image']) if file original_filename = file.original_filename filenames = config['device_types']['filenames'] rescue {} filenames.each do |type, regex| return type if original_filename =~ regex end end file = attachment(['video']) if file original_filename = file.original_filename filenames = config['device_types']['filenames'] rescue {} filenames.each do |type, regex| return type if original_filename =~ regex end end + boundary = mail.boundary + boundaries = config['device_types']['boundary'] rescue {} + boundaries.each do |type, regex| + return type if boundary =~ regex + end + return :handset if File.exist?( File.expand_path( File.join(self.conf_dir, "#{self.aliases[self.carrier] || self.carrier}.yml") ) ) :unknown end ## # exif object on default image from exifr gem def exif device_type? unless @exif @exif end ## # The source of the MMS was some sort of mobile or smart phone def is_mobile? self.device_type? != :unknown end ## # Get the temporary directory where media files are written to. def self.tmp_dir @@tmp_dir ||= File.expand_path(File.join(Dir.tmpdir, (ENV['USER'].nil? ? '':ENV['USER']), 'mms2r')) end ## # Set the temporary directory where media files are written to. def self.tmp_dir=(d) @@tmp_dir=d end ## # Get the directory where conf files are stored. def self.conf_dir @@conf_dir ||= File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'conf')) end ## # Set the directory where conf files are stored. def self.conf_dir=(d) @@conf_dir=d end ## # Helper to create a safe directory path element based on the mail message # id. def self.safe_message_id(mid) mid.nil? ? "#{Time.now.to_i}" : mid.gsub(/\$|<|>|@|\./, "") end ## # Returns a default file extension based on a content type def self.default_ext(content_type) if MMS2R::EXT[content_type] MMS2R::EXT[content_type] elsif content_type content_type.split('/').last end end ## # Joins the generic mms2r configuration with the carrier specific # configuration. def self.initialize_config(c) f = File.expand_path(File.join(self.conf_dir(), "mms2r_media.yml")) conf = YAML::load_file(f) conf['ignore'] ||= {} unless conf['ignore'] conf['transform'] = {} unless conf['transform'] conf['number'] = [] unless conf['number'] return conf unless c kinds = ['ignore', 'transform'] kinds.each do |kind| if c[kind] c[kind].each do |type,array| conf[kind][type] = [] unless conf[kind][type] conf[kind][type] += array end end end conf['number'] = c['number'] if c['number'] conf end def log(message, level = :info) @logger.send(level, message) unless @logger.nil? end ## # convenience accessor for self.class.conf_dir def conf_dir self.class.conf_dir end ## # convenience accessor for self.class.conf_dir def tmp_dir self.class.tmp_dir end ## # convenience accessor for self.class.default_ext def default_ext(type) self.class.default_ext(type) end ## # convenience accessor for self.class.safe_message_id def safe_message_id(message_id) self.class.safe_message_id(message_id) end ## # convenience accessor for self.class.initialize_confg def initialize_config(config) self.class.initialize_config(config) end private ## # accessor for the config def config @config end ## # guess content type from filename def type_from_filename(filename) ext = filename.split('.').last ent = MMS2R::EXT.detect{|k,v| v == ext} ent.nil? ? nil : ent.first end ## # used by #default_media and #text to return the biggest attachment type # listed in the types array def attachment(types) # get all the files that are of the major types passed in files = [] types.each do |type| media.keys.find_all{|k| type.include?("/") ? k == type : k.index(type) == 0 }.each do |key| files += media[key] end end return nil if files.empty? # set temp holders file = nil # explicitly declare the file and size size = 0 mime_type = nil #get the largest file files.each do |path| if File.size(path) > size size = File.size(path) file = File.new(path) media.each do |type,_files| mime_type = type if _files.detect{ |_path| _path == path } end end end return nil if file.nil? # These singleton methods implement the interface necessary to be used # as a drop-in replacement for files uploaded with CGI.rb. # This helps if you want to use the files with, for example, # attachment_fu. def file.local_path self.path end def file.original_filename File.basename(self.path) end def file.size File.size(self.path) end # this one is kind of confusing because it needs a closure. class << file self end.send(:define_method, :content_type) { mime_type } file end end end
monde/mms2r
bacbadf1f2a348d6853c4124cea4b99c195e22e3
Refine apple detection.
diff --git a/conf/mms2r_media.yml b/conf/mms2r_media.yml index 521d472..539897f 100644 --- a/conf/mms2r_media.yml +++ b/conf/mms2r_media.yml @@ -1,71 +1,71 @@ --- ignore: text/plain: - !ruby/regexp /^\(no subject\)$/i - !ruby/regexp /\ASent via BlackBerry (from|by) .*$/im - !ruby/regexp /\ASent from my Verizon Wireless BlackBerry$/im - !ruby/regexp /\ASent from (my|your) iPhone.?$/im - !ruby/regexp /\ASent on the Sprint.* Now Network.*$/im multipart/mixed: - !ruby/regexp "/^Attachment: /i" transform: text/plain: - - !ruby/regexp /\A(.*?)Sent via BlackBerry (from|by) .*$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from my Verizon Wireless BlackBerry$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from (my|your) iPhone.?$/im - "\\1" - - !ruby/regexp /\A(.*?)\s+image\/jpeg$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent on the Sprint.* Now Network.*$/im - "\\1" device_types: headers: x-mailer: :iphone: !ruby/regexp /iPhone Mail/i :blackberry: !ruby/regexp /Palm webOS/i mime-version: :iphone: !ruby/regexp /iPhone Mail/i x-rim-org-msg-ref-id: :blackberry: !ruby/regexp /.+/ user-agent: :iphone: !ruby/regexp /iPhone/i # TODO do something about the assortment of camera models that have # been seen: # 1.3 Megapixel, 2.0 Megapixel, BlackBerry, CU920, G'z One TYPE-S, # Hermes, iPhone, LG8700, LSI_S5K4AAFA, Micron MT9M113 1.3MP YUV, # Motorola Phone, Omni_vision-9650, Pre, # Seoul Electronics & Telecom SIM120B 1.3M, SGH-T729, SGH-T819, # SPH-M540, SPH-M800, SYSTEMLSI S5K4BAFB 2.0 MP, VX-9700 # # NOTE: These model strings are stored in the exif model header of an image file # created and sent by the device, the regex is used by mms2r to detect the # model string makes: :android: !ruby/regexp /Android/i :apple: !ruby/regexp /^(Apple|Hipstamatic)$/i :casio: !ruby/regexp /^CASIO$/i :dash: !ruby/regexp /T-Mobile Dash/i :google: !ruby/regexp /^google$/i :htc: !ruby/regexp /^HTC/i :lge: !ruby/regexp /^(LG|CX87BL05)/i :motorola: !ruby/regexp /^Motorola/i :pantech: !ruby/regexp /^PANTECH$/i :qualcomm: !ruby/regexp /^MSM6/i :research_in_motion: !ruby/regexp /^(RIM|Research In Motion)$/i :samsung: !ruby/regexp /^(SAMSUNG|ES.M800|M6550B-SAM-4480)/i :seoul_electronics: !ruby/regexp /^ISUS0/i :sprint: !ruby/regexp /^Sprint$/i :utstarcom: !ruby/regexp /^T1A_UC1.88$/i models: :blackberry: !ruby/regexp /BlackBerry/i :dash: !ruby/regexp /T-Mobile Dash/i :droid: !ruby/regexp /Droid/i :htc: !ruby/regexp /HTC|Eris|HERO200/i - :iphone: !ruby/regexp /iPhone|201/i + :iphone: !ruby/regexp /iPhone/i software: :blackberry: !ruby/regexp /^Rim Exif/i filenames: :iphone: !ruby/regexp /^photo\.(JPG|PNG)$/i :video: !ruby/regexp /\.3gp$/ diff --git a/test/test_mms2r_media.rb b/test/test_mms2r_media.rb index 99ac44e..cea744f 100644 --- a/test/test_mms2r_media.rb +++ b/test/test_mms2r_media.rb @@ -260,613 +260,613 @@ class TestMms2rMedia < Test::Unit::TestCase mms = MMS2R::Media.new(mail) assert_equal '', mms.subject end def test_subject_with_subject_ignored s = 'hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) mms.stubs(:config).returns({'ignore' => {'text/plain' => [s]}}) assert_equal '', mms.subject end def test_subject_with_subject_transformed s = 'Default Subject: hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) mms.stubs(:config).returns( { 'ignore' => {}, 'transform' => {'text/plain' => [[/Default Subject: (.+)/, '\1']]}}) assert_equal 'hello world', mms.subject end def test_attachment_should_return_nil_if_files_for_type_are_not_found mms = MMS2R::Media.new stub_mail mms.stubs(:media).returns({}) assert_nil mms.send(:attachment, ['text']) end def test_attachment_should_return_nil_if_empty_files_are_found mms = MMS2R::Media.new stub_mail mms.stubs(:media).returns({'text/plain' => [Tempfile.new('test')]}) assert_nil mms.send(:attachment, ['text']) end def test_type_from_filename mms = MMS2R::Media.new stub_mail assert_equal 'image/jpeg', mms.send(:type_from_filename, "example.jpg") end def test_type_from_filename_should_be_nil mms = MMS2R::Media.new stub_mail assert_nil mms.send(:type_from_filename, "example.example") end def test_attachment_should_return_duck_typed_file mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") size = File.size(temp_text_file("hello world")) temp_small = temp_text_file("hello") mms.stubs(:media).returns({'text/plain' => [temp_small, temp_big]}) duck_file = mms.send(:attachment, ['text']) assert_not_nil duck_file assert_equal true, File::exist?(duck_file) assert_equal true, File::exist?(temp_big) assert_equal temp_big, duck_file.local_path assert_equal File.basename(temp_big), duck_file.original_filename assert_equal size, duck_file.size assert_equal 'text/plain', duck_file.content_type end def test_empty_body mms = MMS2R::Media.new stub_mail mms.stubs(:default_text).returns(nil) assert_equal "", mms.body end def test_body mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") mms.stubs(:default_text).returns(File.new(temp_big)) body = mms.body assert_equal "hello world", body end def test_body_when_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") mms.stubs(:default_html).returns(File.new(temp_big)) assert_equal "hello world teapot", mms.body end def test_default_text mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'text/plain' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_text.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_text.local_path end def test_default_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") temp_small = temp_text_file("<html><head><title>hello</title></head><body>world<body></html>") mms.stubs(:media).returns({'text/html' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_html.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_html.local_path end def test_default_media mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'image/jpeg' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_media.local_path end def test_default_media_treats_image_and_video_equally mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big_image = temp_text_file("hello world") temp_small_image = temp_text_file("hello") temp_big_video = temp_text_file("hello world again") temp_small_video = temp_text_file("hello again") mms.stubs(:media).returns({'image/jpeg' => [temp_small_image, temp_big_image], 'video/mpeg' => [temp_small_video, temp_big_video], }) assert_equal temp_big_video, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big_video, mms.default_media.local_path end #def test_default_media_treats_gif_and_jpg_equally # #it doesn't matter that these are text files, we just need say they are images # temp_big = temp_text_file("hello world") # temp_small = temp_text_file("hello") # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/jpeg' => [temp_big], 'image/gif' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/gif' => [temp_big], 'image/jpg' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path #end def test_purge mms = MMS2R::Media.new stub_mail mms.purge assert_equal false, File.exist?(mms.media_dir) end def test_ignore_media_by_filename_equality name = 'foo.txt' type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [name]}}) # type is not in the ingore part = stub(:body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and filename are in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal true, mms.ignore_media?(type, part) # type but not file name are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_filename name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'foo.txt', mms.filename?(part) end def test_long_filename name = 'x' * 300 + '.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'x' * 251 + '.txt', mms.filename?(part) end def test_filename_when_file_extension_missing_part name = 'foo' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.txt', mms.filename?(part) name = 'foo.janky' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.janky.txt', mms.filename?(part) end def test_ignore_media_by_filename_regexp name = 'foo.txt' regexp = /foo\.txt/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [regexp, 'nil.txt']}}) # type is not in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the filename are in the ingore part = stub(:filename => name) assert_equal true, mms.ignore_media?(type, part) # type but not regexp for filename are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_by_regexp_on_file_content name = 'foo.txt' content = "aaaaaaahello worldbbbbbbbbb" regexp = /.*Hello World.*/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => ['nil.txt', regexp]}}) part = stub(:filename => name, :body => Mail::Body.new(content)) # type is not in the ingore assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the content are in the ingore assert_equal true, mms.ignore_media?(type, part) # type but not regexp for content are in the ignore part = stub(:filename => name, :body => Mail::Body.new('no teapots')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_when_file_content_is_empty mms = MMS2R::Media.new stub_mail # there is no conf but the part's body is empty part = stub(:filename => 'foo.txt', :body => Mail::Body.new) assert_equal true, mms.ignore_media?('text/test', part) # there is no conf but the part's body is white space part = stub(:filename => 'foo.txt', :body => Mail::Body.new("\t\n\t\n ")) assert_equal true, mms.ignore_media?('text/test', part) end def test_add_file mail = stub_mail mail.stubs(:from).returns(['[email protected]']) mms = MMS2R::Media.new(mail) mms.stubs(:media).returns({}) assert_nil mms.media['text/html'] mms.add_file('text/html', '/tmp/foo.html') assert_equal ['/tmp/foo.html'], mms.media['text/html'] mms.add_file('text/html', '/tmp/bar.html') assert_equal ['/tmp/foo.html', '/tmp/bar.html'], mms.media['text/html'] end def test_temp_file name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal name, File.basename(mms.temp_file(part)) end def test_process_media_for_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', 'hello world']) result = mms.process_media(part) assert_equal 'text/plain', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_with_empty_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', '']) assert_equal ['text/plain', nil], mms.process_media(part) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_application_smil name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['application/smil', nil]) part = stub(:filename => name, :content_type => 'application/smil', :part_type? => 'application/smil', :main_type => 'application') assert_equal ['application/smil', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['application/smil', 'hello world']) result = mms.process_media(part) assert_equal 'application/smil', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_application_octet_stream_when_image name = 'fake.jpg' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'application/octet-stream', :part_type? => 'application/octet-stream', :body => Mail::Body.new("data"), :main_type => 'application') result = mms.process_media(part) assert_equal 'image/jpeg', result.first assert_match(/fake\.jpg$/, result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_all_other_media name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :main_type => 'faux', :part_type? => 'faux/text', :body => Mail::Body.new(nil)) assert_equal ['faux/text', nil], mms.process_media(part) part = stub(:filename => name, :main_type => 'faux', :part_type? => 'faux/text', :body => Mail::Body.new('hello world')) result = mms.process_media(part) assert_equal 'faux/text', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process mms = MMS2R::Media.new stub_mail assert_equal 1, mms.media.size assert_not_nil mms.media['text/plain'] assert_equal 1, mms.media['text/plain'].size assert_equal true, File.exist?(mms.media['text/plain'].first) assert_equal 1, File.size(mms.media['text/plain'].first) mms.purge end def test_process_with_multipart_double_parts mail = mail('apple-double-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_not_nil mms.media['application/applefile'] assert_equal 1, mms.media['application/applefile'].size assert_not_nil mms.media['image/jpeg'] assert_equal 1, mms.media['image/jpeg'].size assert_match(/DSCN1715\.jpg$/, mms.media['image/jpeg'].first) assert_file_size mms.media['image/jpeg'].first, 337 mms.purge end def test_process_with_multipart_alternative_parts mail = stub_mail plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new('a'), :main_type => 'text') plain.stubs(:multipart?).at_least_once.returns(false) html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new('a'), :main_type => 'text') html.stubs(:multipart?).at_least_once.returns(false) multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) multi.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:parts).at_least_once.returns([multi]) # the multipart/alternative should get flattend to text and html mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_equal 2, mms.media.size assert_not_nil mms.media['text/plain'] assert_not_nil mms.media['text/html'] assert_equal 1, mms.media['text/plain'].size assert_equal 1, mms.media['text/html'].size assert_equal 'message.txt', File.basename(mms.media['text/plain'].first) assert_equal 'message.html', File.basename(mms.media['text/html'].first) assert_equal true, File.exist?(mms.media['text/plain'].first) assert_equal true, File.exist?(mms.media['text/html'].first) assert_equal 1, File.size(mms.media['text/plain'].first) assert_equal 1, File.size(mms.media['text/html'].first) mms.purge end def test_process_when_media_is_ignored mail = stub_mail plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new(''), :main_type => 'text') plain.stubs(:multipart?).at_least_once.returns(false) html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new(''), :main_type => 'text') html.stubs(:multipart?).at_least_once.returns(false) multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) multi.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:parts).at_least_once.returns([multi]) mms = MMS2R::Media.new(mail, :process => :lazy) mms.stubs(:config).returns({'ignore' => {'text/plain' => ['message.txt'], 'text/html' => ['message.html']}}) assert_nothing_raised { mms.process } # the multipart/alternative should get flattend to text and html and then # what's flattened is ignored assert_equal 0, mms.media.size mms.purge end def test_process_when_yielding_to_a_block mail = stub_mail plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new('a'), :main_type => 'text') plain.stubs(:multipart?).at_least_once.returns(false) html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new('b'), :main_type => 'text') html.stubs(:multipart?).at_least_once.returns(false) multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) multi.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:parts).at_least_once.returns([multi]) # the multipart/alternative should get flattend to text and html mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size mms.process do |type, files| assert_equal 1, files.size assert_equal true, type == 'text/plain' || type == 'text/html' assert_equal true, File.basename(files.first) == 'message.txt' || File.basename(files.first) == 'message.html' assert_equal true, File::exist?(files.first) end mms.purge end def test_domain_from_return_path mail = mock() mail.expects(:from).at_least_once.returns([]) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'null.example.com', domain end def test_domain_from_from mail = mock() mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'null.example.com', domain end def test_domain_from_from_yaml f = File.join(MMS2R::Media.conf_dir, 'from.yml') YAML.expects(:load_file).once.with(f).returns(['example.com']) mail = mock() mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'example.com', domain end def test_unknown_device_type mail = mail('generic.mail') mms = MMS2R::Media.new(mail) assert_equal :unknown, mms.device_type? assert_equal false, mms.is_mobile? end def test_iphone_device_type_by_header iphones = ['att-iphone-01.mail', 'iphone-image-01.mail'] iphones.each do |iphone| mail = mail(iphone) mms = MMS2R::Media.new(mail) assert_equal :iphone, mms.device_type?, "fixture #{iphone} was not a iphone" assert_equal true, mms.is_mobile? end end def test_exif mail = smart_phone_mock mms = MMS2R::Media.new(mail) assert_equal 'iPhone', mms.exif.model end def test_iphone_device_type_by_exif mail = smart_phone_mock mms = MMS2R::Media.new(mail) assert_equal :iphone, mms.device_type? assert_equal true, mms.is_mobile? end def test_faux_tiff_iphone_device_type_by_exif - mail = smart_phone_mock('Apple', 'iPhone', nil, nil, jpeg = false) + mail = smart_phone_mock('Apple', 'iPhone', nil, jpeg = false) mms = MMS2R::Media.new(mail) assert_equal :iphone, mms.device_type? assert_equal true, mms.is_mobile? end def test_iphone_device_type_by_filename_jpg mail = smart_phone_mock('Hipstamatic', '201') mms = MMS2R::Media.new(mail) assert_equal :apple, mms.device_type? assert_equal true, mms.is_mobile? end def test_iphone_device_type_by_filename_png mail = mail('iphone-image-02.mail') mms = MMS2R::Media.new(mail) assert_equal true, mms.is_mobile? assert_equal :iphone, mms.device_type? end def test_blackberry_device_type_by_exif_make_model mail = smart_phone_mock('Research In Motion', 'BlackBerry') mms = MMS2R::Media.new(mail) assert_equal :blackberry, mms.device_type? assert_equal true, mms.is_mobile? end def test_blackberry_device_type_by_exif_software mail = smart_phone_mock(nil, nil, "Rim Exif Version1.00a") mms = MMS2R::Media.new(mail) assert_equal :blackberry, mms.device_type? assert_equal true, mms.is_mobile? end def test_dash_device_type_by_exif mail = smart_phone_mock('T-Mobile Dash', 'T-Mobile Dash') mms = MMS2R::Media.new(mail) assert_equal :dash, mms.device_type? assert_equal true, mms.is_mobile? end def test_droid_device_type_by_exif mail = smart_phone_mock('Motorola', 'Droid') mms = MMS2R::Media.new(mail) assert_equal :droid, mms.device_type? assert_equal true, mms.is_mobile? end def test_htc_eris_device_type_by_exif mail = smart_phone_mock('HTC', 'Eris') mms = MMS2R::Media.new(mail) assert_equal :htc, mms.device_type? assert_equal true, mms.is_mobile? end def test_htc_hero_device_type_by_exif mail = smart_phone_mock('HTC', 'HERO200') mms = MMS2R::Media.new(mail) assert_equal :htc, mms.device_type? assert_equal true, mms.is_mobile? end def test_android_app_by_exif mail = smart_phone_mock('Retro Camera Android', "Xoloroid 2000") mms = MMS2R::Media.new(mail) assert_equal :android, mms.device_type? assert_equal true, mms.is_mobile? end def test_handsets_by_exif handsets = YAML.load_file(fixture('handsets.yml')) handsets.each do |handset| mail = smart_phone_mock(handset.first, handset.last) mms = MMS2R::Media.new(mail) assert_equal true, mms.is_mobile?, "mms with make #{mms.exif.make}, and model #{mms.exif.model}, should be considered a mobile device" end end def test_blackberry_device_type berries = ['att-blackberry.mail', 'suncom-blackberry.mail', 'tmobile-blackberry-02.mail', 'tmobile-blackberry.mail', 'tmo.blackberry.net-image-01.mail', 'verizon-blackberry.mail', 'verizon-blackberry.mail'] berries.each do |berry| mms = MMS2R::Media.new(mail(berry)) assert_equal :blackberry, mms.device_type?, "fixture #{berry} was not a blackberrry" assert_equal true, mms.is_mobile? end end def test_handset_device_type mail = mail('att-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal :handset, mms.device_type? assert_equal true, mms.is_mobile? end end
monde/mms2r
75e207498148edb5777f3d86d7854b3574c11052
Inspect the mail header fields more closely, looking for User-Agent field in headers.
diff --git a/conf/mms2r_media.yml b/conf/mms2r_media.yml index e4146ec..521d472 100644 --- a/conf/mms2r_media.yml +++ b/conf/mms2r_media.yml @@ -1,69 +1,71 @@ --- ignore: text/plain: - !ruby/regexp /^\(no subject\)$/i - !ruby/regexp /\ASent via BlackBerry (from|by) .*$/im - !ruby/regexp /\ASent from my Verizon Wireless BlackBerry$/im - !ruby/regexp /\ASent from (my|your) iPhone.?$/im - !ruby/regexp /\ASent on the Sprint.* Now Network.*$/im multipart/mixed: - !ruby/regexp "/^Attachment: /i" transform: text/plain: - - !ruby/regexp /\A(.*?)Sent via BlackBerry (from|by) .*$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from my Verizon Wireless BlackBerry$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from (my|your) iPhone.?$/im - "\\1" - - !ruby/regexp /\A(.*?)\s+image\/jpeg$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent on the Sprint.* Now Network.*$/im - "\\1" device_types: headers: x-mailer: :iphone: !ruby/regexp /iPhone Mail/i :blackberry: !ruby/regexp /Palm webOS/i mime-version: :iphone: !ruby/regexp /iPhone Mail/i x-rim-org-msg-ref-id: :blackberry: !ruby/regexp /.+/ + user-agent: + :iphone: !ruby/regexp /iPhone/i # TODO do something about the assortment of camera models that have # been seen: # 1.3 Megapixel, 2.0 Megapixel, BlackBerry, CU920, G'z One TYPE-S, # Hermes, iPhone, LG8700, LSI_S5K4AAFA, Micron MT9M113 1.3MP YUV, # Motorola Phone, Omni_vision-9650, Pre, # Seoul Electronics & Telecom SIM120B 1.3M, SGH-T729, SGH-T819, # SPH-M540, SPH-M800, SYSTEMLSI S5K4BAFB 2.0 MP, VX-9700 # # NOTE: These model strings are stored in the exif model header of an image file # created and sent by the device, the regex is used by mms2r to detect the # model string makes: :android: !ruby/regexp /Android/i :apple: !ruby/regexp /^(Apple|Hipstamatic)$/i :casio: !ruby/regexp /^CASIO$/i :dash: !ruby/regexp /T-Mobile Dash/i :google: !ruby/regexp /^google$/i :htc: !ruby/regexp /^HTC/i :lge: !ruby/regexp /^(LG|CX87BL05)/i :motorola: !ruby/regexp /^Motorola/i :pantech: !ruby/regexp /^PANTECH$/i :qualcomm: !ruby/regexp /^MSM6/i :research_in_motion: !ruby/regexp /^(RIM|Research In Motion)$/i :samsung: !ruby/regexp /^(SAMSUNG|ES.M800|M6550B-SAM-4480)/i :seoul_electronics: !ruby/regexp /^ISUS0/i :sprint: !ruby/regexp /^Sprint$/i :utstarcom: !ruby/regexp /^T1A_UC1.88$/i models: :blackberry: !ruby/regexp /BlackBerry/i :dash: !ruby/regexp /T-Mobile Dash/i :droid: !ruby/regexp /Droid/i :htc: !ruby/regexp /HTC|Eris|HERO200/i :iphone: !ruby/regexp /iPhone|201/i software: :blackberry: !ruby/regexp /^Rim Exif/i filenames: :iphone: !ruby/regexp /^photo\.(JPG|PNG)$/i :video: !ruby/regexp /\.3gp$/ diff --git a/lib/mms2r/media.rb b/lib/mms2r/media.rb index a61a051..f43533c 100644 --- a/lib/mms2r/media.rb +++ b/lib/mms2r/media.rb @@ -80,748 +80,750 @@ # documentation for more information about match and replace. # # -- # ignore: # image/jpeg: # - /^masthead.jpg$/i # image/gif: # - spacer.gif # text/plain: # - /\AThis message was sent using PIX-FLIX Messaging service from .*/m # transform: # text/plain: # - - /\A(.+?)\s+This message was sent using PIX-FLIX Messaging .*/m # - "\1" # number: # - from # - /^([^\s]+)\s.*/ # - "\1" # # Carriers often provide their services under many different domain names. # The conf/aliases.yml is a YAML file with a hash that maps alternative or # legacy carrier names to the most common name of their service. For example # in terms of MMS2R txt.att.net is an alias for mms.att.net. Therefore when # an MMS with a Sender of txt.att.net is processed MMS2R will use the # mms.att.net configuration to process the message. module MMS2R class MMS2R::Media # Pass off everything we don't do to the Mail object # TODO: refactor to explicit addition a la http://blog.jayfields.com/2008/02/ruby-replace-methodmissing-with-dynamic.html def method_missing method, *args, &block mail.send method, *args, &block end ## # Mail object that the media files were derived from. attr_reader :mail ## # media returns the hash of media. The media hash is keyed by mime-type # such as 'text/plain' and the value mapped to the key is an array of # media that are of that type. attr_reader :media ## # Carrier is the domain name of the carrier. If the carrier is not known # the carrier will be set to 'mms2r.media' attr_reader :carrier ## # Base working dir where media for a unique mms message are dropped attr_reader :media_dir ## # Determine if return-path or from is going to be used to desiginate the # origin carrier. If the domain in the From header is listed in # conf/from.yaml then that is the carrier domain. Else if there is a # Return-Path header its address's domain is the carrier doamin, else # use From header's address domain. def self.domain(mail) return_path = case when mail.return_path mail.return_path ? mail.return_path.split('@').last : '' else '' end from_domain = case when mail.from && mail.from.first mail.from.first.split('@').last else '' end f = File.expand_path(File.join(self.conf_dir(), "from.yml")) from = YAML::load_file(f) ret = case when from.include?(from_domain) from_domain when return_path.present? return_path else from_domain end ret end ## # Initialize a new MMS2R::Media comprised of a mail. # # Specify options to initialize with: # :logger => some_logger for logging # :process => :lazy, for non-greedy processing upon initialization # # #process will have to be called explicitly if the lazy process option # is chosen. def initialize(mail, opts={}) @mail = mail @logger = opts[:logger] log("#{self.class} created", :info) @carrier = self.class.domain(mail) @dir_count = 0 sha = Digest::SHA1.hexdigest("#{@carrier}-#{Time.now.to_i}-#{rand}") @media_dir = File.expand_path( File.join(self.tmp_dir(), "#{self.safe_message_id(@mail.message_id)}_#{sha}")) @media = {} @was_processed = false @number = nil @subject = nil @body = nil @exif = nil @default_media = nil @default_text = nil @default_html = nil f = File.expand_path(File.join(self.conf_dir(), "aliases.yml")) @aliases = YAML::load_file(f) conf = "#{@aliases[@carrier] || @carrier}.yml" f = File.expand_path(File.join(self.conf_dir(), conf)) c = File.exist?(f) ? YAML::load_file(f) : {} @config = self.class.initialize_config(c) processor_module = MMS2R::CARRIERS[@carrier] extend processor_module if processor_module lazy = (opts[:process] == :lazy) rescue false self.process() unless lazy end ## # Get the phone number associated with this MMS if it exists. The value # returned is simplistic, it is just the user name of the from address # before the @ symbol. Validation of the number is left to you. Most # carriers are using the real phone number as the username. def number unless @number params = config['number'] if params && params.any? && (header = mail.header[params[0]]) @number = header.to_s.gsub(params[1], params[2]) end if @number.nil? || @number.blank? @number = mail.from.first.split(/@|\//).first rescue "" end end @number end ## # Return the Subject for this message, returns "" for default carrier # subject such as 'Multimedia message' for ATT&T carrier. def subject unless @subject subject = mail.subject.strip rescue "" ignores = config['ignore']['text/plain'] if ignores && ignores.detect{|s| s == subject} @subject = "" else @subject = transform_text('text/plain', subject).last end end @subject end # Convenience method that returns a string including all the text of the # default text/plain file found. If the plain text is blank then it returns # stripped down version of the title and body of default text/html. Returns # empty string if no body text is found. def body text_file = default_text @body = text_file ? IO.readlines(text_file.path).join.strip : "" if @body.blank? && html_file = default_html html = Nokogiri::HTML(IO.read(html_file.path)) @body = (html.xpath("//head/title").map(&:text) + html.xpath("//body/*").map(&:text)).join(" ") end @body end # Returns a File with the most likely candidate for the user-submitted # media. Given that most MMS messages only have one file attached, this # method will try to return that file. Singleton methods are added to # the File object so it can be used in place of a CGI upload (local_path, # original_filename, size, and content_type) such as in conjunction with # AttachementFu. The largest file found in terms of bytes is returned. # # Returns nil if there are not any video or image Files found. def default_media @default_media ||= attachment(['video', 'image', 'application', 'text']) end # Returns a File with the most likely candidate that is text, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_text @default_text ||= attachment(['text/plain']) end # Returns a File with the most likely candidate that is html, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_html @default_html ||= attachment(['text/html']) end ## # process is a template method and collects all the media in a MMS. # Override helper methods to this template to clean out advertising and/or # ignore media that are advertising. This method should not be overridden # unless there is an extreme special case in processing the media of a MMS # (like Sprint) # # Helper methods for the process template: # * ignore_media? -- true if the media contained in a part should be ignored. # * process_media -- retrieves media to temporary file, returns path to file. # * transform_text -- called by process_media, strips out advertising. # * temp_file -- creates a temporary filepath based on information from the part. # # Block support: # Call process() with a block to automatically iterate through media. # For example, to process and receive only media of video type: # mms.process do |media_type, file| # results << file if media_type =~ /video/ # end # # note: purge must be explicitly called to remove the media files # mms2r extracts from an mms message. def process() # :yields: media_type, file unless @was_processed log("#{self.class} processing", :info) parts = mail.multipart? ? mail.parts : [mail] # Double check for multipart/related, if it exists replace it with its # children parts. Do this twice as multipart/alternative can have # children and we want to fold everything down for i in 1..2 flat = [] parts.each do |p| if p.multipart? p.parts.each {|mp| flat << mp } else flat << p end end parts = flat.dup end # get to work parts.each do |p| t = p.part_type? unless ignore_media?(t,p) t,f = process_media(p) add_file(t,f) unless t.nil? || f.nil? end end @was_processed = true end # when process acts upon a block if block_given? media.each do |k, v| yield(k, v) end end end ## # Helper for process template method to determine if media contained in a # part should be ignored. Producers should override this method to return # true for media such as images that are advertising, carrier logos, etc. # See the ignore section in the discussion of the built-in configuration. def ignore_media?(type, part) ignores = config['ignore'][type] || [] ignore = ignores.detect{ |test| filename?(part) == test} ignore ||= ignores.detect{ |test| filename?(part) =~ test if test.is_a?(Regexp) } ignore ||= ignores.detect{ |test| part.body.decoded.strip =~ test if test.is_a?(Regexp) } ignore ||= (part.body.decoded.strip.size == 0 ? true : nil) ignore.nil? ? false : true end ## # Helper for process template method to decode the part based on its type # and write its content to a temporary file. Returns path to temporary # file that holds the content. Parts with a main type of text will have # their contents transformed with a call to transform_text # # Producers should only override this method if the parts of the MMS need # special treatment besides what is expected for a normal mime part (like # Sprint). # # Returns a tuple of content type, file path def process_media(part) # Mail body auto-magically decodes quoted # printable for text/html type. file = temp_file(part) if part.part_type? =~ /^text\// || part.part_type? == 'application/smil' type, content = transform_text_part(part) mode = 'wb' else if part.part_type? == 'application/octet-stream' type = type_from_filename(filename?(part)) else type = part.part_type? end content = part.body.decoded mode = 'wb' # open with binary bit for Windows for non text end return type, nil if content.nil? || content.empty? log("#{self.class} writing file #{file}", :info) File.open(file, mode){ |f| f.write(content) } return type, file end ## # Helper for process_media template method to transform text. # See the transform section in the discussion of the built-in # configuration. def transform_text(type, text, original_encoding = 'ISO-8859-1') return type, text if !config['transform'] || !(transforms = config['transform'][type]) if RUBY_VERSION < "1.9" #convert to UTF-8 begin c = Iconv.new('UTF-8', original_encoding ) utf_t = c.iconv(text) rescue Exception => e utf_t = text end else utf_t = text.encoding == "ASCII-8BIT" ? text.force_encoding("ISO-8859-1").encode("UTF-8") : text end transforms.each do |transform| next unless transform.size == 2 p = transform.first r = transform.last utf_t = utf_t.gsub(p, r) rescue utf_t end return type, utf_t end ## # Helper for process_media template method to transform text. def transform_text_part(part) type = part.part_type? text = part.body.decoded.strip transform_text(type, text) end ## # Helper for process template method to name a temporary filepath based on # information in the part. This version attempts to honor the name of the # media as labeled in the part header and creates a unique temporary # directory for writing the file so filename collision does not occur. # Consumers of this method expect the directory structure to the file # exists, if the method is overridden it is mandatory that this behavior is # retained. def temp_file(part) file_name = filename?(part) File.expand_path(File.join(msg_tmp_dir(),File.basename(file_name))) end ## # Purges the unique MMS2R::Media.media_dir directory created # for this producer and all of the media that it contains. def purge() log("#{self.class} purging #{@media_dir} and all its contents", :info) FileUtils.rm_rf(@media_dir) end ## # Helper to add a file to the media hash. def add_file(type, file) media[type] = [] unless media[type] media[type] << file end ## # Helper to temp_file to create a unique temporary directory that is a # child of tmp_dir This version is based on the message_id of the mail. def msg_tmp_dir() @dir_count += 1 dir = File.expand_path(File.join(@media_dir, "#{@dir_count}")) FileUtils.mkdir_p(dir) dir end ## # returns a filename declared for a part, or a default if its not defined def filename?(part) name = part.filename if (name.nil? || name.empty?) if part.content_id && (matched = /^<(.+)>$/.match(part.content_id)) name = matched[1] else name = "#{Time.now.to_f}.#{self.default_ext(part.part_type?)}" end end # FIXME FWIW, janky look for dot extension 1 to 4 chars long name = (name =~ /\..{1,4}$/ ? name : "#{name}.#{self.default_ext(part.part_type?)}").strip # handle excessively large filenames if name.size > 255 ext = File.extname(name) base = File.basename(name, ext) name = "#{base[0, 255 - ext.size]}#{ext}" end name end def aliases @aliases end ## # Best guess of the mobile device type. Simple heuristics thus far by # inspecting mail headers and jpeg/tiff exif metadata, and file name. # Known smart phone types thus far are # # * :blackberry # * :dash # * :droid # * :htc # * :iphone # * :lge # * :motorola # * :pantech # * :samsung # # If the message is from a carrier known to MMS2R, and not a smart phone # its type is returned as :handset # Otherwise device type is :unknown def device_type? file = attachment(['image']) if file original = file.original_filename @exif = case original when /\.je?pg$/i EXIFR::JPEG.new(file) when /\.tiff?$/i EXIFR::TIFF.new(file) end if @exif models = config['device_types']['models'] rescue {} models.each do |type, regex| return type if @exif.model =~ regex end makes = config['device_types']['makes'] rescue {} makes.each do |type, regex| return type if @exif.make =~ regex end software = config['device_types']['software'] rescue {} software.each do |type, regex| return type if @exif.software =~ regex end end end headers = config['device_types']['headers'] rescue {} headers.keys.each do |header| if mail.header[header.downcase] # headers[header] refers to a hash of smart phone types with regex values # that if they match, the header signals the type should be returned headers[header].each do |type, regex| return type if mail.header[header.downcase].decoded =~ regex + field = mail.header.fields.detect { |field| field.name.downcase == header.downcase } + return type if field && field.to_s =~ regex end end end file = attachment(['image']) if file original_filename = file.original_filename filenames = config['device_types']['filenames'] rescue {} filenames.each do |type, regex| return type if original_filename =~ regex end end file = attachment(['video']) if file original_filename = file.original_filename filenames = config['device_types']['filenames'] rescue {} filenames.each do |type, regex| return type if original_filename =~ regex end end return :handset if File.exist?( File.expand_path( File.join(self.conf_dir, "#{self.aliases[self.carrier] || self.carrier}.yml") ) ) :unknown end ## # exif object on default image from exifr gem def exif device_type? unless @exif @exif end ## # The source of the MMS was some sort of mobile or smart phone def is_mobile? self.device_type? != :unknown end ## # Get the temporary directory where media files are written to. def self.tmp_dir @@tmp_dir ||= File.expand_path(File.join(Dir.tmpdir, (ENV['USER'].nil? ? '':ENV['USER']), 'mms2r')) end ## # Set the temporary directory where media files are written to. def self.tmp_dir=(d) @@tmp_dir=d end ## # Get the directory where conf files are stored. def self.conf_dir @@conf_dir ||= File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'conf')) end ## # Set the directory where conf files are stored. def self.conf_dir=(d) @@conf_dir=d end ## # Helper to create a safe directory path element based on the mail message # id. def self.safe_message_id(mid) mid.nil? ? "#{Time.now.to_i}" : mid.gsub(/\$|<|>|@|\./, "") end ## # Returns a default file extension based on a content type def self.default_ext(content_type) if MMS2R::EXT[content_type] MMS2R::EXT[content_type] elsif content_type content_type.split('/').last end end ## # Joins the generic mms2r configuration with the carrier specific # configuration. def self.initialize_config(c) f = File.expand_path(File.join(self.conf_dir(), "mms2r_media.yml")) conf = YAML::load_file(f) conf['ignore'] ||= {} unless conf['ignore'] conf['transform'] = {} unless conf['transform'] conf['number'] = [] unless conf['number'] return conf unless c kinds = ['ignore', 'transform'] kinds.each do |kind| if c[kind] c[kind].each do |type,array| conf[kind][type] = [] unless conf[kind][type] conf[kind][type] += array end end end conf['number'] = c['number'] if c['number'] conf end def log(message, level = :info) @logger.send(level, message) unless @logger.nil? end ## # convenience accessor for self.class.conf_dir def conf_dir self.class.conf_dir end ## # convenience accessor for self.class.conf_dir def tmp_dir self.class.tmp_dir end ## # convenience accessor for self.class.default_ext def default_ext(type) self.class.default_ext(type) end ## # convenience accessor for self.class.safe_message_id def safe_message_id(message_id) self.class.safe_message_id(message_id) end ## # convenience accessor for self.class.initialize_confg def initialize_config(config) self.class.initialize_config(config) end private ## # accessor for the config def config @config end ## # guess content type from filename def type_from_filename(filename) ext = filename.split('.').last ent = MMS2R::EXT.detect{|k,v| v == ext} ent.nil? ? nil : ent.first end ## # used by #default_media and #text to return the biggest attachment type # listed in the types array def attachment(types) # get all the files that are of the major types passed in files = [] types.each do |type| media.keys.find_all{|k| type.include?("/") ? k == type : k.index(type) == 0 }.each do |key| files += media[key] end end return nil if files.empty? # set temp holders file = nil # explicitly declare the file and size size = 0 mime_type = nil #get the largest file files.each do |path| if File.size(path) > size size = File.size(path) file = File.new(path) media.each do |type,_files| mime_type = type if _files.detect{ |_path| _path == path } end end end return nil if file.nil? # These singleton methods implement the interface necessary to be used # as a drop-in replacement for files uploaded with CGI.rb. # This helps if you want to use the files with, for example, # attachment_fu. def file.local_path self.path end def file.original_filename File.basename(self.path) end def file.size File.size(self.path) end # this one is kind of confusing because it needs a closure. class << file self end.send(:define_method, :content_type) { mime_type } file end end end
monde/mms2r
020a69417398b807aa9614858b2752038a4e33c2
Wasn't picking up iphone names correctly.
diff --git a/conf/mms2r_media.yml b/conf/mms2r_media.yml index f08c5d0..e4146ec 100644 --- a/conf/mms2r_media.yml +++ b/conf/mms2r_media.yml @@ -1,70 +1,69 @@ --- ignore: text/plain: - !ruby/regexp /^\(no subject\)$/i - !ruby/regexp /\ASent via BlackBerry (from|by) .*$/im - !ruby/regexp /\ASent from my Verizon Wireless BlackBerry$/im - !ruby/regexp /\ASent from (my|your) iPhone.?$/im - !ruby/regexp /\ASent on the Sprint.* Now Network.*$/im multipart/mixed: - !ruby/regexp "/^Attachment: /i" transform: text/plain: - - !ruby/regexp /\A(.*?)Sent via BlackBerry (from|by) .*$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from my Verizon Wireless BlackBerry$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from (my|your) iPhone.?$/im - "\\1" - - !ruby/regexp /\A(.*?)\s+image\/jpeg$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent on the Sprint.* Now Network.*$/im - "\\1" device_types: headers: x-mailer: :iphone: !ruby/regexp /iPhone Mail/i :blackberry: !ruby/regexp /Palm webOS/i mime-version: :iphone: !ruby/regexp /iPhone Mail/i x-rim-org-msg-ref-id: :blackberry: !ruby/regexp /.+/ # TODO do something about the assortment of camera models that have # been seen: # 1.3 Megapixel, 2.0 Megapixel, BlackBerry, CU920, G'z One TYPE-S, # Hermes, iPhone, LG8700, LSI_S5K4AAFA, Micron MT9M113 1.3MP YUV, # Motorola Phone, Omni_vision-9650, Pre, # Seoul Electronics & Telecom SIM120B 1.3M, SGH-T729, SGH-T819, # SPH-M540, SPH-M800, SYSTEMLSI S5K4BAFB 2.0 MP, VX-9700 # # NOTE: These model strings are stored in the exif model header of an image file # created and sent by the device, the regex is used by mms2r to detect the # model string makes: :android: !ruby/regexp /Android/i :apple: !ruby/regexp /^(Apple|Hipstamatic)$/i :casio: !ruby/regexp /^CASIO$/i :dash: !ruby/regexp /T-Mobile Dash/i :google: !ruby/regexp /^google$/i :htc: !ruby/regexp /^HTC/i :lge: !ruby/regexp /^(LG|CX87BL05)/i :motorola: !ruby/regexp /^Motorola/i :pantech: !ruby/regexp /^PANTECH$/i :qualcomm: !ruby/regexp /^MSM6/i :research_in_motion: !ruby/regexp /^(RIM|Research In Motion)$/i :samsung: !ruby/regexp /^(SAMSUNG|ES.M800|M6550B-SAM-4480)/i :seoul_electronics: !ruby/regexp /^ISUS0/i :sprint: !ruby/regexp /^Sprint$/i :utstarcom: !ruby/regexp /^T1A_UC1.88$/i models: :blackberry: !ruby/regexp /BlackBerry/i :dash: !ruby/regexp /T-Mobile Dash/i :droid: !ruby/regexp /Droid/i :htc: !ruby/regexp /HTC|Eris|HERO200/i :iphone: !ruby/regexp /iPhone|201/i software: :blackberry: !ruby/regexp /^Rim Exif/i filenames: - :iphone: !ruby/regexp /^photo\.JPG$/ - :iphone: !ruby/regexp /^photo\.PNG$/ + :iphone: !ruby/regexp /^photo\.(JPG|PNG)$/i :video: !ruby/regexp /\.3gp$/
monde/mms2r
bd51f9058477fa46510bca540996aedb78f149df
mm.att.net as seen in the wild
diff --git a/README.txt b/README.txt index 1a69fbc..44d90c9 100644 --- a/README.txt +++ b/README.txt @@ -1,248 +1,248 @@ = mms2r https://github.com/monde/mms2r == DESCRIPTION MMS2R by Mike Mondragon http://mms2r.rubyforge.org/ https://github.com/monde/mms2r https://github.com/monde/mms2r/issues http://peepcode.com/products/mms2r-pdf MMS2R is a library that decodes the parts of an MMS message to disk while stripping out advertising injected by the mobile carriers. MMS messages are multipart email and the carriers often inject branding into these messages. Use MMS2R if you want to get at the real user generated content from a MMS without having to deal with the cruft from the carriers. If MMS2R is not aware of a particular carrier no extra processing is done to the MMS other than decoding and consolidating its media. MMS2R can be used to process any multipart email to conveniently access the parts the mail is comprised of. Contact the author to add additional carriers to be processed by the library. Suggestions and patches appreciated and welcomed! Corpus of carriers currently processed by MMS2R: * 1nbox/Idea: 1nbox.net * 3 Ireland: mms.3ireland.ie * Alltel: mms.alltel.com -* AT&T/Cingular/Legacy: mms.att.net, txt.att.net, mmode.com, mms.mycingular.com, +* AT&T/Cingular/Legacy: mms.att.net, mm.att.net, txt.att.net, mmode.com, mms.mycingular.com, cingularme.com, mobile.mycingular.com pics.cingularme.com * Bell Canada: txt.bell.ca * Bell South / Suncom / SBC Global: bellsouth.net, sbcglobal.net * Cricket Wireless: mms.mycricket.com * Dobson/Cellular One: mms.dobson.net * Helio: mms.myhelio.com * Hutchison 3G UK Ltd: mms.three.co.uk * INDOSAT M2: mobile.indosat.net.id * LUXGSM S.A.: mms.luxgsm.lu * Maroc Telecom / mms.mobileiam.ma * MTM South Africa: mms.mtn.co.za * NetCom (Norway): mms.netcom.no * Nextel: messaging.nextel.com * O2 Germany: mms.o2online.de * O2 UK: mediamessaging.o2.co.uk * Orange & Regional Oranges: orangemms.net, mmsemail.orange.pl, orange.fr * PLSPICTURES.COM mms hosting: waw.plspictures.com * PXT New Zealand: pxt.vodafone.net.nz * Rogers of Canada: rci.rogers.com * SaskTel: sasktel.com, sms.sasktel.com, cdma.sasktel.com * Sprint: pm.sprint.com, messaging.sprintpcs.com, sprintpcs.com * T-Mobile: tmomail.net, mmsreply.t-mobile.co.uk, tmo.blackberry.net * TELUS Corporation (Canada): mms.telusmobility.com, msg.telus.com * U.S. Cellular: mms.uscc.net * UAE MMS: mms.ae * Unicel: unicel.com, info2go.com (note: mobile number is tucked away in a text/plain part for unicel.com) * Verizon: vzwpix.com, vtext.com, labwig.net * Virgin Mobile: vmpix.com, pixmbl.com, vmobl.com, yrmobl.com * Virgin Mobile of Canada: vmobile.ca * Vodacom: mms.vodacom4me.co.za Corpus of smart phones known to MMS2R: * Apple iPhone variants * Blackberry / Research In Motion variants * Casio variants * Droid variants * Google / Nexus One variants * HTC variants (T-Mobile Dash, Sprint HERO) * LG Electronics variants * Motorola variants * Pantech variants * Qualcom variants * Samsung variants * Sprint variants * UTStarCom variants As Seen On The Internets - sites known to be using MMS2R in some fashion * twitpic.com [http://www.twitpic.com/] * Simplton [http://simplton.com/] * fanchatter.com [http://www.fanchatter.com/] * camura.com [http://www.camura.com/] * eachday.com [http://www.eachday.com/] * beenup2.com [http://www.beenup2.com/] * snapmylife.com [http://www.snapmylife.com/] * email the author to be listed here == FEATURES * #default_media and #default_text methods return a File that can be used in attachment_fu or Paperclip * #process supports blocks for enumerating over the content of the MMS * #process can be made lazy when :process => :lazy is passed to new * logging is enabled when :logger => your_logger is passed to new * an mms instance acts like a Mail object, any methods not defined on the instance are delegated to it's underlying Mail object * #device_type? returns a symbol representing a device or smartphone type Known smartphones thus far: iPhone, BlackBerry, T-Mobile Dash, Droid, Samsung == BOOKS MMS2R, Making email useful http://peepcode.com/products/mms2r-pdf == SYNOPSIS begin require 'mms2r' rescue LoadError require 'rubygems' require 'mms2r' end # required for the example require 'fileutils' mail = MMS2R::Media.new(Mail.read('some_saved_mail.file')) puts "mail has default carrier subject" if mail.subject.empty? # access the sender's phone number puts "mail was from phone #{mail.number}" # most mail are either image or video, default_media will return the largest # (non-advertising) video or image found file = mail.default_media puts "mail had a media: #{file.inspect}" unless file.nil? # finds the largest (non-advertising) text found file = mail.default_text puts "mail had some text: #{file.inspect}" unless file.nil? # mail.media is a hash that is indexed by mime-type. # The mime-type key returns an array of filepaths # to media that were extract from the mail and # are of that type mail.media['image/jpeg'].each {|f| puts "#{f}"} mail.media['text/plain'].each {|f| puts "#{f}"} # print the text (assumes mail had text) text = IO.readlines(mail.media['text/plain'].first).join puts text # save the image (assumes mail had a jpeg) FileUtils.cp mail.media['image/jpeg'].first, '/some/where/useful', :verbose => true puts "does the mail have quicktime video? #{!mail.media['video/quicktime'].nil?}" puts "plus run anything that Mail provides, e.g. #{mail.to.inspect}" # check if the mail is from a mobile phone puts "mail is from a mobile phone #{mail.is_mobile?}" # determine the device type of the phone puts "mail is from a mobile phone of type #{mail.device_type?}" # inspect default media's exif data if exifr gem is installed and default # media is a jpeg or tiff puts "mail's default media's exif data is:" puts mail.exif.inspect # Block support, process and receive all media types of video. mail.process do |media_type, files| # assumes a Clip model that is an AttachmentFu Clip.create(:uploaded_data => files.first, :title => "From phone") if media_type =~ /video/ end # Another AttachmentFu example, Picture model is an AttachmentFu picture = Picture.new picture.title = mail.subject picture.uploaded_data = mail.default_media picture.save! #remove all the media that was put to temporary disk mail.purge == REQUIREMENTS * Mail (mail) * Nokogiri (nokogiri) * UUIDTools (uuidtools) * EXIF Reader (exif) == INSTALL * sudo gem install mms2r == SOURCE git clone git://github.com/monde/mms2r.git == AUTHORS Copyright (c) 2007-2010 by Mike Mondragon (blog[http://plasti.cx/]) MMS2R's Flickr page[http://www.flickr.com/photos/8627919@N05/] == CONTRIBUTORS * Luke Francl (blog[http://railspikes.com/]) * Will Jessup (blog[http://www.willjessup.com/]) * Shane Vitarana (blog[http://www.shanesbrain.net/]) * Layton Wedgeworth (http://www.beenup2.com/) * Jason Haruska (blog[http://software.haruska.com/]) * Dave Myron (company[http://contentfree.com/]) * Vijay Yellapragada * Jesse Dp (github profile[http://github.com/jessedp]) * David Alm * Jeremy Wilkins * Matt Conway (github profile[http://github.com/wr0ngway]) * Kai Kai * Michael DelGaudio * Sai Emrys (blog[http://saizai.com]) * Brendan Lim (github profile[http://github.com/brendanlim]) * Scott Taylor (github profile[http://github.com/smtlaissezfaire]) * Jaap van der Meer (github profile[http://github.com/japetheape]) * Karl Baum (github profile[http://github.com/kbaum]) == LICENSE (The MIT License) Copyright (c) 2007, 2008 Mike Mondragon ([email protected]). All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/conf/aliases.yml b/conf/aliases.yml index 0171c15..1c6bb6f 100644 --- a/conf/aliases.yml +++ b/conf/aliases.yml @@ -1,25 +1,26 @@ --- +mm.att.net: mms.att.net txt.att.net: mms.att.net cingularme.com: mms.att.net mmode.com: mms.att.net mms.mycingular.com: mms.att.net mobile.mycingular.com: mms.att.net pics.cingularme.com: mms.att.net sbcglobal.net: mms.att.net vtext.com: vzwpix.com labwig.net: vzwpix.com orange.fr: orangemms.net mmsemail.orange.pl: orangemms.net message.alltel.com: mms.alltel.com mmsreply.t-mobile.co.uk: tmomail.net tmo.blackberry.net: tmomail.net info2go.com: unicel.com mms.telusmobility.com: msg.telus.com sasktel.com: sms.sasktel.com cdma.sasktel.com: sms.sasktel.com sprintpcs.com: pm.sprint.com messaging.sprintpcs.com: pm.sprint.com pixmbl.com: vmpix.com vmobile.ca: vmpix.com vmobl.com: vmpix.com yrmobl.com: vmpix.com diff --git a/test/fixtures/iphone-image-02.mail b/test/fixtures/iphone-image-02.mail new file mode 100644 index 0000000..7c96b9d --- /dev/null +++ b/test/fixtures/iphone-image-02.mail @@ -0,0 +1,1638 @@ +Return-Path: <[email protected]> +Delivered-To: unknown +Received: from imap.gmail.com (74.125.95.109) by ntk with IMAP4-SSL; 16 Mar + 2011 01:55:03 -0000 +Delivered-To: [email protected] +Received: by 10.147.99.4 with SMTP id b4cs153574yam; + Tue, 15 Mar 2011 18:52:52 -0700 (PDT) +Received: by 10.43.59.140 with SMTP id wo12mr108164icb.408.1300240372117; + Tue, 15 Mar 2011 18:52:52 -0700 (PDT) +Received: from mail-iw0-f175.google.com (mail-iw0-f175.google.com [209.85.214.175]) + by mx.google.com with ESMTPS id c4si981226ict.30.2011.03.15.18.52.51 + (version=TLSv1/SSLv3 cipher=OTHER); + Tue, 15 Mar 2011 18:52:52 -0700 (PDT) +Received-SPF: pass (google.com: domain of [email protected] designates 209.85.214.175 as permitted sender) client-ip=209.85.214.175; +Authentication-Results: mx.google.com; spf=pass (google.com: domain of [email protected] designates 209.85.214.175 as permitted sender) [email protected]; dkim=pass (test mode) [email protected] +Received: by mail-iw0-f175.google.com with SMTP id 10so1469259iwn.34 + for <[email protected]>; Tue, 15 Mar 2011 18:52:51 -0700 (PDT) +DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; + d=gmail.com; s=gamma; + h=domainkey-signature:from:content-type:message-id:date:to + :content-transfer-encoding:mime-version:x-mailer; + bh=sH9AbLB2py4K/neNlkXyFvuvYRnCJsUywUfMCk2F79A=; + b=dz/5GCF9ymR+PdzZWyZluwhU2ys+9pY4ZPvjT8ocC+yeuGStPhRJ3Xi8O4jM41JfLv + 8OHmrdAzQwMxYOuvpB/0YDmDjZXsHXg/z9lvfbt5b/lJKz7ECJUHIGt+9DEgvHU7G3Gl + bDKaI7pfLIngIo/RspLRk5t38g5gkd1CLTs9k= +DomainKey-Signature: a=rsa-sha1; c=nofws; + d=gmail.com; s=gamma; + h=from:content-type:message-id:date:to:content-transfer-encoding + :mime-version:x-mailer; + b=wJ9FT+MHhHPY2k3XJHZx7+G4yBPNXYw2zpwg1LRuTcTLqHnLJIR4joG2F43nUMVBEl + 7p52zHdAjFCbAgfiPfCN4y6R1mqYrAjO3KijOIa+9Du8CWGntBitwAx8h857RWPCG4iZ + dgSh/HvJDxTzeUBgPrUTt79neiRy/VbZpZYR8= +Received: by 10.231.29.101 with SMTP id p37mr185060ibc.3.1300240093149; + Tue, 15 Mar 2011 18:48:13 -0700 (PDT) +Received: from [10.68.83.221] ([166.205.140.48]) + by mx.google.com with ESMTPS id d10sm264711ibb.18.2011.03.15.18.47.56 + (version=TLSv1/SSLv3 cipher=OTHER); + Tue, 15 Mar 2011 18:48:11 -0700 (PDT) +From: Tommy Tutone <[email protected]> +Content-Type: multipart/mixed; boundary=Apple-Mail-1--189695060 +Message-Id: <[email protected]> +Date: Tue, 15 Mar 2011 18:47:31 -0700 +To: [email protected] +Content-Transfer-Encoding: 7bit + + +--Apple-Mail-1--189695060 +Content-Transfer-Encoding: 7bit +Content-Type: text/plain; + charset=us-ascii + +Jim's favorite + + +--Apple-Mail-1--189695060 +Content-Disposition: inline; + filename=photo.PNG +Content-Type: image/png; + name=photo.PNG +Content-Transfer-Encoding: base64 + +iVBORw0KGgoAAAANSUhEUgAAAoAAAAPACAYAAACl4sj7AAAgAElEQVR4AeydB7gURdaGCyQoCgZE +JQioKCqmNSuoGMGEGcw5YVpXDGvGsOa4uuYcUXH3N6xiwLCAmCOggCgqCkqSoASB+eure09bXV09 +0z3h3pm53+G5dKqqrnq7p/v0qVOnGt15550ZRSEBEiABEiABEiABEmgwBJosXLiwwTSWDSUBEiAB +EiABEiABElCqybhx48iBBEiABEiABEiABEigARFosmDBggbUXDaVBEiABEiABEiABEiAXcC8B0iA +BEiABEiABEiggRFokslwDEgDu+ZsLgmQAAmQAAmQQAMn0GTx4sUNHAGbTwIkQAIkQAIkQAINi0Dj +htVctpYESIAESIAESIAESIAWQN4DJEACJEACJEACJ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qEm//Cd+mnS92rypO9C6dp26KTadeio2q7e +Sa2z3oaqy/obqU233i6Upho25Hqnjetc5xZAWMVQ2TXWWEOtvvrqxvKHbl/R3HEx0jai3C4gurJh +yYRS26JFC6PYTpkyxSzRvU0hARIgARIggVIRaNNhLVP0jN9rLH9ynqVqTV9iAZNlLkufWASlnCB9 +rSlK3t9isZJyZRnJJzucpZQrFi4pT5KNeP1F9c7QlxSWc2fPUhtvvInqsvbaaoN1u6gjDukryYLl +3Llz1fjx4xTev889fq+aMOFrtVyr5dW2u+yltt15D9VDL30i5xeLnC8N9sVZBoP9tQUtcUyY7vQb +mdoMmdoGy/wcwi8or7YiclwshSu3X9McWbw4PLq7Nnnsok59ANHlC+Wvc+fOqlOnTqpVq1bG2od9 +osHG1rQCD8D3b5VVVjE1X7hwoZoxY4Zq3bp1BbaEVSYBEiABEiCBuicARe/fD9+hXv3PE2rOr9PV +lltuqU475VS17bbbJqrMRhtuGKSbqweafv7ZZ+q990aqgaceplZr31Httt+hav+jTjGKYZCwQlfS +6lGNtttuO1F2S9pkDPjAKF8of/iDT5x8NZT0xGVQOEY2f//99/rrY4KxCjaUdpcBelaBBEiABBoc +gT0uHmTavHyLpmYpL/kmtSY2WYolyZkYRBtmak1RtRndjiuxJApYSa7E0lU7eljyiSVN0olFUUa9 +iu+gKDBL1SZ84bE71dN3XauWbtZU7bPPPmr77XeQUxa8hD7yyitD1IgRI9T8hX+oviefp/Y6rH+I +l9QnOFktlsAiV8unUe3+xcGB2h21PMSHT9oplju5LsJHlnJczivFynHh9kdtwWL5e+biqBVUyvAt +68QCiMphZCz8/TAqFr5wABuB66thFexDty/8HDE4BCZpdBFTSIAESIAESIAEogS+HfuFuv3iU9WU +779W++6zr9p6621Molk6XFwxZeeddlbb6LLfeutNNej2K9Rbzz+pTr38X6pz1z+thsU8X6nLSqtT +ldwHENYu+P1hQASUP4z0rXQfv3wuIrqDl19+eaMIi7aeTznMQwIkQAIkQALZCEyYUeML1vI3sTHV +pF6ueY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LthzPtZTyJN+ShTWjf4dfuovJunBWOhtg +nVkApWGwBI4aNcpMHI55gxEqBho6BopAQ8fon0oXdHOjyxcK7cyZM02w28k55iSs9Daz/iRAAiRA +AiRQVwSgyK2w9lapTicKVKpMVZy4zi2AwlK6ert27WpCxCynJ4Sulq5gKLPw9cMS8yPDGkghARIg +ARIggbok0LnnoeZ0PU+4uiinrTWcKXFNk20p3N0v23Kcy+wEhKdwk+24XG/fe745NPGtJ+KSZN1f +5xZAqQ0sgRB0i/78888mQLRMFyf+gJK20paY+QTxDyHSzkprA+tLAiRAAiRAAiRQvQSgaOZSMqu3 +9WwZCZAACZAACVQ5gXV2Pcq0cLfj9Zy7Wpo1a26W/K+yCCxcuMBU+NX7LjfLca89XFADSh4HsKDa +MTMJkAAJkAAJkAAJkEDRCdACWHSkLJAESIAESIAEyo/Acm1WN5Xa7vDzzLLb5j3McqWVVzbL5s2a +mqWMMnUHTbj7ZdtkSvCflCf5ZFuyuvtlW44XupTzSbmyLeW6+2Vbjkt62S/bctzdL9tyPOlyYW3I +muk6SDVkzEcjzHLYY9ea5dypP5hlof/RAlgoQeYnARIgARIgARIggQojQAtghV0wVpcESIAESIAE +SIAECiVAC2ChBJmfBEiABEiABEiABCqMABXACrtgrC4JkAAJkAAJkAAJFEqACmChBJmfBEiABEiA +BEiABCqMABXACrtgrC4JkAAJkAAJkAAJFEqACmChBJmfBEiABEiABEiABCqMABXACrtgrC4JkAAJ +kAAJkAAJFEqACmChBJmfBEiABEiABEiABCqMABXACrtgrC4JkAAJkAAJkAAJFEqACmChBJmfBEiA +BEiABEiABCqMABXACrtgrC4JkAAJkAAJkAAJFEqACmChBJmfBEiABEiABEiABCqMABXACrtgrC4J +kAAJkAAJkAAJFEqACmChBJmfBEiABEiABEiABCqMABXACrtgrC4JkAAJkAAJkAAJFEqACmChBJmf +BEiABEiABEiABCqMABXACrtgrC4JkAAJkAAJkAAJFEqACmChBJmfBEiABEiABEiABCqMABXACrtg +rC4JkAAJkAAJkAAJFEqACmChBJmfBEiABEiABEiABCqMABXACrtgrC4JkAAJkAAJkAAJFEqACmCh +BJmfBEiABEiABEiABCqMABXACrtgrC4JkAAJkAAJkAAJFEqACmChBJmfBEiABEiABEiABCqMABXA +CrtgrC4JkAAJkAAJkAAJFEqACmChBJmfBEiABEiABEiABCqMABXACrtgrC4JkAAJkAAJkAAJFEqA +CmChBJmfBEiABEiABEiABCqMABXACrtgrC4JkAAJkAAJkAAJFEqACmChBJmfBEiABEiABEiABCqM +ABXACrtgrC4JkAAJkAAJkAAJFEqACmChBJmfBEiABEiABEiABCqMABXACrtgrC4JkAAJkAAJkAAJ +FEqACmChBJmfBEiABEiABEiABCqMABXACrtgrC4JkAAJkAAJkAAJFEqACmChBJmfBEiABEiABEiA +BCqMABXACrtgrC4JkAAJkAAJkAAJFEqACmChBJmfBEiABEiABEiABCqMABXACrtgrC4JkAAJkAAJ +kAAJFEqACmChBJmfBEiABEiABEiABCqMQJMKqy+rSwIkQAIFE2jTpo3abLPN1JIlS9QHH3ygZs6c +WXCZLIAESIAEKokALYCVdLVYVxIggaIQ6Nq1q2ratKlq3ry5WmeddYpSJgshARIggUoiQAWwkq4W +60oCJJCTwEorraQuueQS1b9//9i0Sy21VHCsSRN/R0ijRo3UmmuuqdZee20VlyYohCskQAIkUGEE +/E++CmsEq0sCJEACQmDQoEFq1113NZvt27dXF110kRxKtezWrZtaY401TJ7ll19effjhh6nyMzEJ +kAAJlDMBWgDL+eqwbiRAAqkJdOnSJchzzjnnKHs7OJBjpVWrVqpz585BqmWXXTZY5woJkAAJVAMB +KoDVcBXZBhIggYDAE088Eaw3a9ZM3XLLLcF20pUNN9xQoQtYZNKkSbLKJQmQAAlUBQEqgFVxGdkI +EiABIXDNNdeoH3/8UTbVnnvuaf6CHTlW0G0MP0KR3377TX377beyySUJkAAJVAUBKoBVcRnZCBIg +ASEwd+5cde6558qmWV555ZXKHvgROmhtNG7cWK277rrWHqVGjx5twsWEdnKDBEiABCqcABXACr+A +rD4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QoAKY +AhaTkgAJkAAJkAAJkEA1EKACWA1XkW0gARIgARIgARIggRQEqACmgMWkJEACJEACJEACJFANBKgA +VsNVZBtIgARIgARIgARIIAUBKoApYDEpCZAACZAACZAACVQDASqA1XAV2QYSIAESIAESIAESSEGA +CmAKWExKAiRAAiRAAiRAAtVAgApgNVxFtoEESIAESIAESIAEUhCgApgCFpOSAAmQAAmQAAmQQDUQ +oAJYDVeRbSABEiABEiABEiCBFASoAKaAxaQkQAIkQAIkQAIkUA0EqABWw1VkG0iABEiABEiABEgg +BQEqgClgMSkJkAAJkAAJkAAJVAMBKoDVcBXZBhIgARIgARIgARJIQYAKYApYTEoCJEACJEACJEAC +1UCACmA1XEW2gQRIgARIgARIgARSEKACmAIWk5IACZAACZAACZBANRCgAlgNV5FtIAESIAESIAES +IIEUBKgApoDFpCRAAiRAAiRAAiRQDQSoAFbDVWQbSIAESIAESIAESCAFASqAKWAxKQmQAAmQAAmQ +AAlUAwEqgNVwFdkGEiABEiABEiABEkhBgApgClhMSgIkQAIkQAIkQALVQIAKYDVcRbaBBEiABEiA +BEiABFIQoAKYAhaTkgAJkAAJkAAJkEA1EKACWA1XkW0gARIgARIgARIggRQEqACmgMWkJEACJEAC +JEACJFANBKgAVsNVZBtIgARIgARIgARIIAUBKoApYDEpCZAACZAACZAACVQDASqA1XAV2QYSIAES +IAESIAESSEGACmAKWExKAiRAAiRAAiRAAtVAgApgNVxFtoEESIAESIAESIAEUhCgApgCFpOSAAmQ +AAmQAAmQQDUQoAJYDVeRbSABEiABEiABEiCBFASoAKaAxaQkQAIkQAIkQAIkUA0EqABWw1VkG0iA +BEiABEiABEggBQEqgClgMSkJkAAJkAAJkAAJVAMBKoDVcBXZBhIgARIgARIgARJIQYAKYApYTEoC +JEACJEACJEAC1UCACmA1XEW2gQRIgARIgARIgARSEKACmAIWk5IACZAACZAACZBANRCgAlgNV5Ft +IAESIAESIAESIIEUBKgApoBVDUlXWWUVtdZaa6kmTZpUQ3PYBhIggTogwOdGHUDmKUigjglQCygy +8GOOOUatuuqqoVIHDRqkJk6cGNonGyuuuKLaZ599VOfOnc1fmzZt1Jw5c9Rhhx2mFi9eLMnyXvbq +1UuddNJJqkuXLmqNNdZQyy23nClr0aJFpk7jxo1T9913n/q///s/lclkYs+zzDLLqEMPPTR0HHmH +DRsW2lcpG127dlX77bdfqLpff/21Gjx4cGifu7HsssuqU045RS211FLuIfXOO++o//3vf5H93JGb +wOabb6522WWXUELc/9dff31on73Rt29fteaaa9q71I8//qgeffTR0D57A7+19dZbz96lRo4cqd5+ ++22zb88991SrrbZacPyPP/5QjzzySLDdUFb43Ahf6XK5P8O14hYJFE4Ab33+FYnBxx9/rPWosOy6 +665evvqFl5k0aVI4ce1Ws2bNvHmSXquNN9448+qrr3rL9u386KOPMnvssUfsObVSG8n24IMPxqZP +Ws/6SnfAAQdE2vPCCy9kbU/z5s0zr732WiQfdrz55puZFi1aZM1fX22thPNus802Xq7rrLNOLFOt +sEfyTJs2LTY9OIwaNSqSR38IBHm0Ah86Pnfu3OBYJXAstI58bvjfheVyfxZ6fZnff30bMBcCKebF +T6oAtm7dOoOXS5wUogBuuummmQULFsQVnXX/IYcc4n3hNXQFUFv8Mv/5z3+87N56662Mtgx6uRXz +3qrmssB3xowZEb7aou7luvzyy2eWLFkSSY8d2irozaOt7ZE82sKXadWqVZC+3BXAAQMGZBYuXBj6 +22qrrYL6F3KP8LkR/y4sl/uzkOtbF3lLeX/WRf0b2jnoA6iveH3IUUcdpdCdWGxBFy+6nLUCmVfR +DzzwgNpiiy3yylutmRo1aqTAZd999400EV2+6Db87bffIse4IzkBdPdqi3UkQ48ePSL7sOMvf/mL +wnXxSdz9q604kTzotp89e7avmLLcB9eDpk2bhv7iOKRpAJ8b2Wnx/szOR46W6v6U8rksLgEqgMXl +mbg0+OS58sQTT6jttttOwd8Evkf5yGWXXabWXnvtUFa84J555hnju9atWzelv/SNXyCUGvgC2rL0 +0kurZ599NvKitNM0tPVbb71VHXnkkZFmw/9Rd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m5rJtJEACVUAgo9vA +PzLgPcB7IHPJJZdk0spvv/2WeeeddzKbbrppg76Hjj/++ADdXXfd1aBZ8J3CdyrvgfK/B9gFXAUa +PJtAAvVJoEWLFmqbbbYxFq9jjjmmPqvCc5MACZAACSQkwC7ghKCYjAQaGoEvv/xSXXPNNd5mL7fc +cqp169Zqq622Ur169VJNmjRRSy+9tHrggQfUggUL1BNPPOHNx50kQAIkQALlQYAKYHlcB9aCBMqO +wJQpU9QjjzySs14777yzeuaZZ9SKK65o0upuZCqAOakxAQmQAAnULwF2Adcvf56dBCqewNChQ9VF +F10UtKNr166qXbt2wTZXSIAESIAEyo8AFcDyuyasEQlUHIG33347VOfOnTuHtuM2ll12WbX++uur +Ll26qGWWWSYuWar9KLNQBRR+jejWrgtBd/qaa66pmjdvnvfp0P0Ojt26dVNNmzbNuxxmJAESaDgE +qAA2nGvNlpJAyQjMmzcvVPbPP/8c2rY3OnXqpK6//no1efJkNXfuXDV69Gg1fvx49fvvv6tffvlF +/etf/1Ibb7yxnSW0fuSRR6qRI0eav969e5tjUHzuvvtu9emnn6pZs2apH3/80ZT/3HPPqf333z+U +P25jww03VHr0rilj9uzZCm0aN26cuvDCC4PubfhE3n///ab+ceUk2Y9u88cee0zBzxL1nTBhgjnf ++++/r0455ZREymCzZs3UmWeeacLwgB04IiwP1seMGWPqCT9NCgmQAAnEEWC4Aob/4D3Ae8DcA3YY +mDfeeCPxfXHEEUcEIVAQFmappZby5u3Tp09m0aJFQdpsK6eddpq3jPPPPz/IhvP2798/oweeBPvc +lcWLF2cOPfRQb1n6oWj2H3bYYRnUO060gpbp2LFj5ptvvjFJvv/++0h5ScLANG7cOHP55ZdnUKds +opW5zF/+8pfIOaS+q6++elCXbOX88MMPmR49esSWI+VxWf4hO3iNeI2KfQ/UTR+HrjWFBEigOglo +xSjkA3jjjTcqreBEGrv55purJ598Umnl0ByDte6FF14wVjZ0W6Lb+OCDD1YIqAz55z//qbTCpV56 +6SWz7fvvqKOOUrCmQWB1hD8iBq/AIti9e3eF7lWtdJnBLJMmTVL/+9//IsWcd955odHOqDsscbCo +bbTRRkorYqaLFt3crVq1iuRPugPtfvnll9Wuu+5qsmjFTWklW3344YdmG6F0tthiC9MVju7c119/ +XW277bZq7NixoVOAFQbdrLHGGmb/F198oR5//HGllVLVsmVLU9cDDjjAdKt36NBBvfnmm8aiCqsg +hQRIgARsAvw6pPWH9wDvAXMP2BbAYcOGZVZeeWXvn1Y+MjoETEYrTxmtWAVGKK1gZbT/nPd+0l2n +QTodLiajFZlIOljInn766SDdPffcE0ljWwAloQ47k1lppZVCabUSmJk5c6Ykydx3332h4/ohmGnf +vn1Gd5kGaW655ZaMHs0cSqe7ozNff/11kAYr+VgATzjhhKAMraRmdtttt9B5UB9w/e6774J0WmGM +pIE1U+SVV17xWlu1P2Hm4YcflmQZrTBGysH5+EcGvAca9D3QoBvPByBfArwHrHvAVgAD7SHhyj/+ +8Q+vMiIvmM8//zwoSVv7Yrlrq1uQTlsJI+lcBfCmm26KpJFzDhgwIChLW9Ii6WylFMprXNf1qquu +GuoiTqsAastcBkqfyA477BCpi9QZSqD2CzRJ0VUMJVWOYYn2iqAL3D5mr2tfy6CrWVtHY9PZebjO +9yHvgYZzD3AQiL7bKSRAAoUTOPzww9XJJ59sulzd0tANiy5fdAHfcMMNauLEiW6SYNseQJKry/XX +X39VV1xxRZDXXfn444+DXW3atAnWsdK2bVt19NFHm33aL1Edcsgh3q5rJECdMDglXznjjDOUViJN +djBwR03b5WJuZXT/QsANg15swSAakWzzNmtLotpzzz1V3759lfanVI0aNZJsXJIACZCAog8gbwIS +IAEvgZ9++sn46PkOwp9thRVWUFBG9BzAxq8PvoC333672nvvvdVee+2loFSJLFmyJKLIyDF7Cf82 +jGxNKq+++qrS3byxybXVMTiG+kKhQl0g6623XqCsfvDBB2bkcJDYs4Kg2Oecc47nSO5dW2+9dZDo +tddeC9bjVqAAyujl3XffXV199dVB0nfffTc4BsUSo36hnGLksytDhgxxd3GbBEiABAwBK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QgQRIgASiiUDgv4jR1CrWlQRIIKYJGMEFIRZIKCkpCSSaRxwj/jwu8oQE +SIAEYoQABWCMdCSbQQIk4J8AxZx/NrxDAiQQnwTsmyQTn/zYahIgARIgARIgARKIOgIUgFHXZaww +CZAACZAACZAACQRHgAIwOH5MTQIkQAIkQAIkQAJRR4ACMOq6jBUmARIgARIgARIggeAIUAAGx4+p +SYAESIAESIAESCDqCFAARl2XscIkQAIkQAIkQAIkEBwBCsDg+DE1CZAACZAACZAACUQdAQrAqOsy +VpgESIAESIAESIAEgiNAARgcP6YmARIgARIgARIggagjQAEYdV3GCpMACZAACZAACZBAcAQoAIPj +x9QkQAIkQAIkQAIkEHUEKACjrstYYRIgARIgARIgARIIjgAFYHD8mJoESIAESIAESIAEoo4ABWDU +dRkrTAIkQAIkQAIkQALBEaAADI4fU5MACZAACZAACZBA1BGgAIy6LmOFSYAESIAESIAESCA4AhSA +wfFjahIgARIgARIgARKIOgIUgFHXZawwCZAACZAACZAACQRHgAIwOH5MTQIkQAIkQAIkQAJRR4AC +MOq6jBUmARIgARIgARIggeAIUAAGx4+pSYAESIAESIAESCDqCFAARl2XscIkQAIkQAIkQAIkEBwB +CsDg+DE1CZAACZAACZAACUQdAQrAqOsyVpgESIAESIAESIAEgiNAARgcP6YmARIgARIgARIggagj +QAEYdV3GCpMACZAACZAACZBAcAQoAIPjx9QkQAIkQAIkQAIkEHUEKACjrstYYRIgARIgARIgARII +jgAFYHD8mJoESIAESIAESIAEoo4ABWDUdRkrTAIkQAIkQAIkQALBEUgMLjlTO51AUlKSfOtb33J6 +NVk/EiABEiABBxFo1aqVg2rDqoSCQILK9GIoMmaeJEACJEACJEACJEACziTAIWBn9gtrRQIkQAIk +QAIkQAIhI8Ah4JChdUbGPXr0kAsXLsj58+f10Rm1Yi1IgARIgAScSKBFixbSsmVLwXHPnj1OrCLr +ZBMBCkCbQDo1m9raWsHr7Nmz+ujUerJeJEACJEACkSeQmJgomP+HI0NsE2APx3b/atFXU1MjVV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+ya89u +OXOWbl4a6E/eIgESIAESIAESIIFGCYRlK7gENdPQDPump7eRhQs/aZLl78yZ0xR/jXYlI5AACZAA +CZAACZBAYATCIgCrlKuWCjVsC/G3YcN6Wbd2TYO1y8jIcC/4OHWqUnYU7qTlr0FivEkCJEACJEAC +JEACgRMIiwBEdeYv+FhatWolhTt3NFg7uInp37e/Xu177PhRbfmjm5cGkfEmCZAACZAACZAACTSJ +ALZR+EWTUjQzcrWau1dTUy2d1Yb2hTt3+swF4q97t+56e68jJUek+GAxHfr6JMWLJEACJEACJEAC +JNB8AmH1A4hq9urVS3bt2lWvxt0Luktubq4Wf3v375WysrJ6cXiBBEiABEiABEiABEggeAJhF4DW +Kqenp+u9XLt27ippaWlSXV2t5vvtEOzty0ACJEACJEACJEACJBAaAmFxA+Ov6nl5edIht4O2+pUc +LZGi4iJu6+YPFq+TAAmQAAmQAAmQgE0EImoBRBvg6Lm2tlaq1fxABhIgARIgARIgARIggdATiLgA +DH0TWQIJkAAJkAAJkAAJkICVQNjcwFgL5XsSIAESIAESIAESIIHIEaAAjBx7lkwCJEACJEACJEAC +ESFAARgR7CyUBEiABEiABEiABCJHgAIwcuxZMgmQAAmQAAmQAAlEhAAFYESws1ASIAESIAESIAES +iBwBCsDIsWfJJEACJEACJEACJBARAhSAEcHOQkmABEiABEiABEggcgQoACPHniWTAAmQAAmQAAmQ +QEQIUABGBDsLJQESIAESIAESIIHIEaAAjBx7lkwCJEACJEACJEACESFAARgR7CyUBEiABEiABEiA +BCJHgAIwcuxZMgmQAAmQAAmQAAlEhAAFYESws1ASIAESIAESIAESiBwBCsDIsWfJJEACJEACJEAC +JBARAokjRoyISMEslARIgARIgARIgARIIDIEaAGMDHeWSgIkQAIkQAIkQAIRI5CgSr4YsdJZMAmQ +AAmQAAmQAAmQQNgJ0AIYduQskARIgARIgARIgAQiS4ACMLL8WToJkAAJkAAJkAAJhJ0ABWDYkbNA +EiABEiABEiABEogsAQrAyPJn6SRAAiRAAiRAAiQQdgI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f42eDqoqLSDr +FDM132KHdDkft8wvrn983k2XHIco2NVLs7ZW0bR1i7U+HfHDudD3++RvpwMnr3Gk7ynqDSCoRZVU +IoCADr2+HNZSU1MjYsTGdZnNZqqrq4tr7uzslDy4kcZEJtrq6upId/QdaedSkUkkuoA0rUDoORDg +H3G6Ul9fT9nZ2boWrYo8yEizpy/GNHz6PlVXCCgEFAKZgkCmkD/g2e8EcMn8CVSUP4IG57DfVJiw +jS4eT96Wp5L5A23I4QsR58bzb4UIom3swmn8mkrt7tvUfaODNiwvigk8h+fRiFyWyMlYLSPEzw+B +HkNzBlH1oiIOAmGixuc6KifRllUztNvFWH7B3+/q+mM0MDeH7LtXc7CHNa5fgyZLAj26XreRc8dZ +FeyB/5g0KpBVCQaD0RXBxIsMINCZw+4dMoRAZLilpYWMUaoQkQ6FQtGxCBDx+/3RY1SKi4vJ7XaL +OLLNZiOHwyGZNBL5r8UN/A8PENQBwqcvZWVl5PF4JFcwciFbLBZyOp3U1NQUzcyC84G9y+XSD1V1 +hYBCQCGQcQhkEvkDuD8AOnZSNIrsX+4AAAAASUVORK5CYII= + +--Apple-Mail-1--189695060 +Content-Transfer-Encoding: 7bit +Content-Type: text/plain; + charset=us-ascii + + + + +--Apple-Mail-1--189695060--
monde/mms2r
adf9502d0349a204272a0c549a83c62d918da4ec
messaging.sprintpcs.com was dropped from aliases, somehow
diff --git a/conf/aliases.yml b/conf/aliases.yml index 0530ec8..0171c15 100644 --- a/conf/aliases.yml +++ b/conf/aliases.yml @@ -1,24 +1,25 @@ --- txt.att.net: mms.att.net cingularme.com: mms.att.net mmode.com: mms.att.net mms.mycingular.com: mms.att.net mobile.mycingular.com: mms.att.net pics.cingularme.com: mms.att.net sbcglobal.net: mms.att.net vtext.com: vzwpix.com labwig.net: vzwpix.com orange.fr: orangemms.net mmsemail.orange.pl: orangemms.net message.alltel.com: mms.alltel.com mmsreply.t-mobile.co.uk: tmomail.net tmo.blackberry.net: tmomail.net info2go.com: unicel.com mms.telusmobility.com: msg.telus.com sasktel.com: sms.sasktel.com cdma.sasktel.com: sms.sasktel.com sprintpcs.com: pm.sprint.com +messaging.sprintpcs.com: pm.sprint.com pixmbl.com: vmpix.com vmobile.ca: vmpix.com vmobl.com: vmpix.com yrmobl.com: vmpix.com
monde/mms2r
4323aab0738ea15fbd5f5ca27b70d7683c08c097
The message has 3gp video mark is as coming from a mobile device.
diff --git a/conf/mms2r_media.yml b/conf/mms2r_media.yml index 36dafab..f08c5d0 100644 --- a/conf/mms2r_media.yml +++ b/conf/mms2r_media.yml @@ -1,69 +1,70 @@ --- ignore: text/plain: - !ruby/regexp /^\(no subject\)$/i - !ruby/regexp /\ASent via BlackBerry (from|by) .*$/im - !ruby/regexp /\ASent from my Verizon Wireless BlackBerry$/im - !ruby/regexp /\ASent from (my|your) iPhone.?$/im - !ruby/regexp /\ASent on the Sprint.* Now Network.*$/im multipart/mixed: - !ruby/regexp "/^Attachment: /i" transform: text/plain: - - !ruby/regexp /\A(.*?)Sent via BlackBerry (from|by) .*$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from my Verizon Wireless BlackBerry$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from (my|your) iPhone.?$/im - "\\1" - - !ruby/regexp /\A(.*?)\s+image\/jpeg$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent on the Sprint.* Now Network.*$/im - "\\1" device_types: headers: x-mailer: :iphone: !ruby/regexp /iPhone Mail/i :blackberry: !ruby/regexp /Palm webOS/i mime-version: :iphone: !ruby/regexp /iPhone Mail/i x-rim-org-msg-ref-id: :blackberry: !ruby/regexp /.+/ # TODO do something about the assortment of camera models that have # been seen: # 1.3 Megapixel, 2.0 Megapixel, BlackBerry, CU920, G'z One TYPE-S, # Hermes, iPhone, LG8700, LSI_S5K4AAFA, Micron MT9M113 1.3MP YUV, # Motorola Phone, Omni_vision-9650, Pre, # Seoul Electronics & Telecom SIM120B 1.3M, SGH-T729, SGH-T819, # SPH-M540, SPH-M800, SYSTEMLSI S5K4BAFB 2.0 MP, VX-9700 # # NOTE: These model strings are stored in the exif model header of an image file # created and sent by the device, the regex is used by mms2r to detect the # model string makes: :android: !ruby/regexp /Android/i :apple: !ruby/regexp /^(Apple|Hipstamatic)$/i :casio: !ruby/regexp /^CASIO$/i :dash: !ruby/regexp /T-Mobile Dash/i :google: !ruby/regexp /^google$/i :htc: !ruby/regexp /^HTC/i :lge: !ruby/regexp /^(LG|CX87BL05)/i :motorola: !ruby/regexp /^Motorola/i :pantech: !ruby/regexp /^PANTECH$/i :qualcomm: !ruby/regexp /^MSM6/i :research_in_motion: !ruby/regexp /^(RIM|Research In Motion)$/i :samsung: !ruby/regexp /^(SAMSUNG|ES.M800|M6550B-SAM-4480)/i :seoul_electronics: !ruby/regexp /^ISUS0/i :sprint: !ruby/regexp /^Sprint$/i :utstarcom: !ruby/regexp /^T1A_UC1.88$/i models: :blackberry: !ruby/regexp /BlackBerry/i :dash: !ruby/regexp /T-Mobile Dash/i :droid: !ruby/regexp /Droid/i :htc: !ruby/regexp /HTC|Eris|HERO200/i :iphone: !ruby/regexp /iPhone|201/i software: :blackberry: !ruby/regexp /^Rim Exif/i filenames: - :iphone: !ruby/regexp /^photo.JPG$/ - :iphone: !ruby/regexp /^photo.PNG$/ + :iphone: !ruby/regexp /^photo\.JPG$/ + :iphone: !ruby/regexp /^photo\.PNG$/ + :video: !ruby/regexp /\.3gp$/ diff --git a/lib/mms2r/media.rb b/lib/mms2r/media.rb index 2ab70d1..a61a051 100644 --- a/lib/mms2r/media.rb +++ b/lib/mms2r/media.rb @@ -93,726 +93,735 @@ # - "\1" # number: # - from # - /^([^\s]+)\s.*/ # - "\1" # # Carriers often provide their services under many different domain names. # The conf/aliases.yml is a YAML file with a hash that maps alternative or # legacy carrier names to the most common name of their service. For example # in terms of MMS2R txt.att.net is an alias for mms.att.net. Therefore when # an MMS with a Sender of txt.att.net is processed MMS2R will use the # mms.att.net configuration to process the message. module MMS2R class MMS2R::Media # Pass off everything we don't do to the Mail object # TODO: refactor to explicit addition a la http://blog.jayfields.com/2008/02/ruby-replace-methodmissing-with-dynamic.html def method_missing method, *args, &block mail.send method, *args, &block end ## # Mail object that the media files were derived from. attr_reader :mail ## # media returns the hash of media. The media hash is keyed by mime-type # such as 'text/plain' and the value mapped to the key is an array of # media that are of that type. attr_reader :media ## # Carrier is the domain name of the carrier. If the carrier is not known # the carrier will be set to 'mms2r.media' attr_reader :carrier ## # Base working dir where media for a unique mms message are dropped attr_reader :media_dir ## # Determine if return-path or from is going to be used to desiginate the # origin carrier. If the domain in the From header is listed in # conf/from.yaml then that is the carrier domain. Else if there is a # Return-Path header its address's domain is the carrier doamin, else # use From header's address domain. def self.domain(mail) return_path = case when mail.return_path mail.return_path ? mail.return_path.split('@').last : '' else '' end from_domain = case when mail.from && mail.from.first mail.from.first.split('@').last else '' end f = File.expand_path(File.join(self.conf_dir(), "from.yml")) from = YAML::load_file(f) ret = case when from.include?(from_domain) from_domain when return_path.present? return_path else from_domain end ret end ## # Initialize a new MMS2R::Media comprised of a mail. # # Specify options to initialize with: # :logger => some_logger for logging # :process => :lazy, for non-greedy processing upon initialization # # #process will have to be called explicitly if the lazy process option # is chosen. def initialize(mail, opts={}) @mail = mail @logger = opts[:logger] log("#{self.class} created", :info) @carrier = self.class.domain(mail) @dir_count = 0 sha = Digest::SHA1.hexdigest("#{@carrier}-#{Time.now.to_i}-#{rand}") @media_dir = File.expand_path( File.join(self.tmp_dir(), "#{self.safe_message_id(@mail.message_id)}_#{sha}")) @media = {} @was_processed = false @number = nil @subject = nil @body = nil @exif = nil @default_media = nil @default_text = nil @default_html = nil f = File.expand_path(File.join(self.conf_dir(), "aliases.yml")) @aliases = YAML::load_file(f) conf = "#{@aliases[@carrier] || @carrier}.yml" f = File.expand_path(File.join(self.conf_dir(), conf)) c = File.exist?(f) ? YAML::load_file(f) : {} @config = self.class.initialize_config(c) processor_module = MMS2R::CARRIERS[@carrier] extend processor_module if processor_module lazy = (opts[:process] == :lazy) rescue false self.process() unless lazy end ## # Get the phone number associated with this MMS if it exists. The value # returned is simplistic, it is just the user name of the from address # before the @ symbol. Validation of the number is left to you. Most # carriers are using the real phone number as the username. def number unless @number params = config['number'] if params && params.any? && (header = mail.header[params[0]]) @number = header.to_s.gsub(params[1], params[2]) end if @number.nil? || @number.blank? @number = mail.from.first.split(/@|\//).first rescue "" end end @number end ## # Return the Subject for this message, returns "" for default carrier # subject such as 'Multimedia message' for ATT&T carrier. def subject unless @subject subject = mail.subject.strip rescue "" ignores = config['ignore']['text/plain'] if ignores && ignores.detect{|s| s == subject} @subject = "" else @subject = transform_text('text/plain', subject).last end end @subject end # Convenience method that returns a string including all the text of the # default text/plain file found. If the plain text is blank then it returns # stripped down version of the title and body of default text/html. Returns # empty string if no body text is found. def body text_file = default_text @body = text_file ? IO.readlines(text_file.path).join.strip : "" if @body.blank? && html_file = default_html html = Nokogiri::HTML(IO.read(html_file.path)) @body = (html.xpath("//head/title").map(&:text) + html.xpath("//body/*").map(&:text)).join(" ") end @body end # Returns a File with the most likely candidate for the user-submitted # media. Given that most MMS messages only have one file attached, this # method will try to return that file. Singleton methods are added to # the File object so it can be used in place of a CGI upload (local_path, # original_filename, size, and content_type) such as in conjunction with # AttachementFu. The largest file found in terms of bytes is returned. # # Returns nil if there are not any video or image Files found. def default_media @default_media ||= attachment(['video', 'image', 'application', 'text']) end # Returns a File with the most likely candidate that is text, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_text @default_text ||= attachment(['text/plain']) end # Returns a File with the most likely candidate that is html, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_html @default_html ||= attachment(['text/html']) end ## # process is a template method and collects all the media in a MMS. # Override helper methods to this template to clean out advertising and/or # ignore media that are advertising. This method should not be overridden # unless there is an extreme special case in processing the media of a MMS # (like Sprint) # # Helper methods for the process template: # * ignore_media? -- true if the media contained in a part should be ignored. # * process_media -- retrieves media to temporary file, returns path to file. # * transform_text -- called by process_media, strips out advertising. # * temp_file -- creates a temporary filepath based on information from the part. # # Block support: # Call process() with a block to automatically iterate through media. # For example, to process and receive only media of video type: # mms.process do |media_type, file| # results << file if media_type =~ /video/ # end # # note: purge must be explicitly called to remove the media files # mms2r extracts from an mms message. def process() # :yields: media_type, file unless @was_processed log("#{self.class} processing", :info) parts = mail.multipart? ? mail.parts : [mail] # Double check for multipart/related, if it exists replace it with its # children parts. Do this twice as multipart/alternative can have # children and we want to fold everything down for i in 1..2 flat = [] parts.each do |p| if p.multipart? p.parts.each {|mp| flat << mp } else flat << p end end parts = flat.dup end # get to work parts.each do |p| t = p.part_type? unless ignore_media?(t,p) t,f = process_media(p) add_file(t,f) unless t.nil? || f.nil? end end @was_processed = true end # when process acts upon a block if block_given? media.each do |k, v| yield(k, v) end end end ## # Helper for process template method to determine if media contained in a # part should be ignored. Producers should override this method to return # true for media such as images that are advertising, carrier logos, etc. # See the ignore section in the discussion of the built-in configuration. def ignore_media?(type, part) ignores = config['ignore'][type] || [] ignore = ignores.detect{ |test| filename?(part) == test} ignore ||= ignores.detect{ |test| filename?(part) =~ test if test.is_a?(Regexp) } ignore ||= ignores.detect{ |test| part.body.decoded.strip =~ test if test.is_a?(Regexp) } ignore ||= (part.body.decoded.strip.size == 0 ? true : nil) ignore.nil? ? false : true end ## # Helper for process template method to decode the part based on its type # and write its content to a temporary file. Returns path to temporary # file that holds the content. Parts with a main type of text will have # their contents transformed with a call to transform_text # # Producers should only override this method if the parts of the MMS need # special treatment besides what is expected for a normal mime part (like # Sprint). # # Returns a tuple of content type, file path def process_media(part) # Mail body auto-magically decodes quoted # printable for text/html type. file = temp_file(part) if part.part_type? =~ /^text\// || part.part_type? == 'application/smil' type, content = transform_text_part(part) mode = 'wb' else if part.part_type? == 'application/octet-stream' type = type_from_filename(filename?(part)) else type = part.part_type? end content = part.body.decoded mode = 'wb' # open with binary bit for Windows for non text end return type, nil if content.nil? || content.empty? log("#{self.class} writing file #{file}", :info) File.open(file, mode){ |f| f.write(content) } return type, file end ## # Helper for process_media template method to transform text. # See the transform section in the discussion of the built-in # configuration. def transform_text(type, text, original_encoding = 'ISO-8859-1') return type, text if !config['transform'] || !(transforms = config['transform'][type]) if RUBY_VERSION < "1.9" #convert to UTF-8 begin c = Iconv.new('UTF-8', original_encoding ) utf_t = c.iconv(text) rescue Exception => e utf_t = text end else utf_t = text.encoding == "ASCII-8BIT" ? text.force_encoding("ISO-8859-1").encode("UTF-8") : text end transforms.each do |transform| next unless transform.size == 2 p = transform.first r = transform.last utf_t = utf_t.gsub(p, r) rescue utf_t end return type, utf_t end ## # Helper for process_media template method to transform text. def transform_text_part(part) type = part.part_type? text = part.body.decoded.strip transform_text(type, text) end ## # Helper for process template method to name a temporary filepath based on # information in the part. This version attempts to honor the name of the # media as labeled in the part header and creates a unique temporary # directory for writing the file so filename collision does not occur. # Consumers of this method expect the directory structure to the file # exists, if the method is overridden it is mandatory that this behavior is # retained. def temp_file(part) file_name = filename?(part) File.expand_path(File.join(msg_tmp_dir(),File.basename(file_name))) end ## # Purges the unique MMS2R::Media.media_dir directory created # for this producer and all of the media that it contains. def purge() log("#{self.class} purging #{@media_dir} and all its contents", :info) FileUtils.rm_rf(@media_dir) end ## # Helper to add a file to the media hash. def add_file(type, file) media[type] = [] unless media[type] media[type] << file end ## # Helper to temp_file to create a unique temporary directory that is a # child of tmp_dir This version is based on the message_id of the mail. def msg_tmp_dir() @dir_count += 1 dir = File.expand_path(File.join(@media_dir, "#{@dir_count}")) FileUtils.mkdir_p(dir) dir end ## # returns a filename declared for a part, or a default if its not defined def filename?(part) name = part.filename if (name.nil? || name.empty?) if part.content_id && (matched = /^<(.+)>$/.match(part.content_id)) name = matched[1] else name = "#{Time.now.to_f}.#{self.default_ext(part.part_type?)}" end end # FIXME FWIW, janky look for dot extension 1 to 4 chars long name = (name =~ /\..{1,4}$/ ? name : "#{name}.#{self.default_ext(part.part_type?)}").strip # handle excessively large filenames if name.size > 255 ext = File.extname(name) base = File.basename(name, ext) name = "#{base[0, 255 - ext.size]}#{ext}" end name end def aliases @aliases end ## # Best guess of the mobile device type. Simple heuristics thus far by # inspecting mail headers and jpeg/tiff exif metadata, and file name. # Known smart phone types thus far are # # * :blackberry # * :dash # * :droid # * :htc # * :iphone # * :lge # * :motorola # * :pantech # * :samsung # # If the message is from a carrier known to MMS2R, and not a smart phone # its type is returned as :handset # Otherwise device type is :unknown def device_type? file = attachment(['image']) if file original = file.original_filename @exif = case original when /\.je?pg$/i EXIFR::JPEG.new(file) when /\.tiff?$/i EXIFR::TIFF.new(file) end if @exif models = config['device_types']['models'] rescue {} models.each do |type, regex| return type if @exif.model =~ regex end makes = config['device_types']['makes'] rescue {} makes.each do |type, regex| return type if @exif.make =~ regex end software = config['device_types']['software'] rescue {} software.each do |type, regex| return type if @exif.software =~ regex end end end headers = config['device_types']['headers'] rescue {} headers.keys.each do |header| if mail.header[header.downcase] # headers[header] refers to a hash of smart phone types with regex values # that if they match, the header signals the type should be returned headers[header].each do |type, regex| return type if mail.header[header.downcase].decoded =~ regex end end end file = attachment(['image']) if file original_filename = file.original_filename filenames = config['device_types']['filenames'] rescue {} filenames.each do |type, regex| return type if original_filename =~ regex end end + file = attachment(['video']) + if file + original_filename = file.original_filename + filenames = config['device_types']['filenames'] rescue {} + filenames.each do |type, regex| + return type if original_filename =~ regex + end + end + return :handset if File.exist?( File.expand_path( File.join(self.conf_dir, "#{self.aliases[self.carrier] || self.carrier}.yml") ) ) :unknown end ## # exif object on default image from exifr gem def exif device_type? unless @exif @exif end ## # The source of the MMS was some sort of mobile or smart phone def is_mobile? self.device_type? != :unknown end ## # Get the temporary directory where media files are written to. def self.tmp_dir @@tmp_dir ||= File.expand_path(File.join(Dir.tmpdir, (ENV['USER'].nil? ? '':ENV['USER']), 'mms2r')) end ## # Set the temporary directory where media files are written to. def self.tmp_dir=(d) @@tmp_dir=d end ## # Get the directory where conf files are stored. def self.conf_dir @@conf_dir ||= File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'conf')) end ## # Set the directory where conf files are stored. def self.conf_dir=(d) @@conf_dir=d end ## # Helper to create a safe directory path element based on the mail message # id. def self.safe_message_id(mid) mid.nil? ? "#{Time.now.to_i}" : mid.gsub(/\$|<|>|@|\./, "") end ## # Returns a default file extension based on a content type def self.default_ext(content_type) if MMS2R::EXT[content_type] MMS2R::EXT[content_type] elsif content_type content_type.split('/').last end end ## # Joins the generic mms2r configuration with the carrier specific # configuration. def self.initialize_config(c) f = File.expand_path(File.join(self.conf_dir(), "mms2r_media.yml")) conf = YAML::load_file(f) conf['ignore'] ||= {} unless conf['ignore'] conf['transform'] = {} unless conf['transform'] conf['number'] = [] unless conf['number'] return conf unless c kinds = ['ignore', 'transform'] kinds.each do |kind| if c[kind] c[kind].each do |type,array| conf[kind][type] = [] unless conf[kind][type] conf[kind][type] += array end end end conf['number'] = c['number'] if c['number'] conf end def log(message, level = :info) @logger.send(level, message) unless @logger.nil? end ## # convenience accessor for self.class.conf_dir def conf_dir self.class.conf_dir end ## # convenience accessor for self.class.conf_dir def tmp_dir self.class.tmp_dir end ## # convenience accessor for self.class.default_ext def default_ext(type) self.class.default_ext(type) end ## # convenience accessor for self.class.safe_message_id def safe_message_id(message_id) self.class.safe_message_id(message_id) end ## # convenience accessor for self.class.initialize_confg def initialize_config(config) self.class.initialize_config(config) end private ## # accessor for the config def config @config end ## # guess content type from filename def type_from_filename(filename) ext = filename.split('.').last ent = MMS2R::EXT.detect{|k,v| v == ext} ent.nil? ? nil : ent.first end ## # used by #default_media and #text to return the biggest attachment type # listed in the types array def attachment(types) # get all the files that are of the major types passed in files = [] types.each do |type| media.keys.find_all{|k| type.include?("/") ? k == type : k.index(type) == 0 }.each do |key| files += media[key] end end return nil if files.empty? # set temp holders file = nil # explicitly declare the file and size size = 0 mime_type = nil #get the largest file files.each do |path| if File.size(path) > size size = File.size(path) file = File.new(path) media.each do |type,_files| mime_type = type if _files.detect{ |_path| _path == path } end end end return nil if file.nil? # These singleton methods implement the interface necessary to be used # as a drop-in replacement for files uploaded with CGI.rb. # This helps if you want to use the files with, for example, # attachment_fu. def file.local_path self.path end def file.original_filename File.basename(self.path) end def file.size File.size(self.path) end # this one is kind of confusing because it needs a closure. class << file self end.send(:define_method, :content_type) { mime_type } file end end end
monde/mms2r
da353e92321051e259f2eacbc3ea614d59de1391
Verizon has a hosting service at labwig.net
diff --git a/README.txt b/README.txt index 67e4500..1a69fbc 100644 --- a/README.txt +++ b/README.txt @@ -1,248 +1,248 @@ = mms2r https://github.com/monde/mms2r == DESCRIPTION MMS2R by Mike Mondragon http://mms2r.rubyforge.org/ https://github.com/monde/mms2r https://github.com/monde/mms2r/issues http://peepcode.com/products/mms2r-pdf MMS2R is a library that decodes the parts of an MMS message to disk while stripping out advertising injected by the mobile carriers. MMS messages are multipart email and the carriers often inject branding into these messages. Use MMS2R if you want to get at the real user generated content from a MMS without having to deal with the cruft from the carriers. If MMS2R is not aware of a particular carrier no extra processing is done to the MMS other than decoding and consolidating its media. MMS2R can be used to process any multipart email to conveniently access the parts the mail is comprised of. Contact the author to add additional carriers to be processed by the library. Suggestions and patches appreciated and welcomed! Corpus of carriers currently processed by MMS2R: * 1nbox/Idea: 1nbox.net * 3 Ireland: mms.3ireland.ie * Alltel: mms.alltel.com * AT&T/Cingular/Legacy: mms.att.net, txt.att.net, mmode.com, mms.mycingular.com, cingularme.com, mobile.mycingular.com pics.cingularme.com * Bell Canada: txt.bell.ca * Bell South / Suncom / SBC Global: bellsouth.net, sbcglobal.net * Cricket Wireless: mms.mycricket.com * Dobson/Cellular One: mms.dobson.net * Helio: mms.myhelio.com * Hutchison 3G UK Ltd: mms.three.co.uk * INDOSAT M2: mobile.indosat.net.id * LUXGSM S.A.: mms.luxgsm.lu * Maroc Telecom / mms.mobileiam.ma * MTM South Africa: mms.mtn.co.za * NetCom (Norway): mms.netcom.no * Nextel: messaging.nextel.com * O2 Germany: mms.o2online.de * O2 UK: mediamessaging.o2.co.uk * Orange & Regional Oranges: orangemms.net, mmsemail.orange.pl, orange.fr * PLSPICTURES.COM mms hosting: waw.plspictures.com * PXT New Zealand: pxt.vodafone.net.nz * Rogers of Canada: rci.rogers.com * SaskTel: sasktel.com, sms.sasktel.com, cdma.sasktel.com * Sprint: pm.sprint.com, messaging.sprintpcs.com, sprintpcs.com * T-Mobile: tmomail.net, mmsreply.t-mobile.co.uk, tmo.blackberry.net * TELUS Corporation (Canada): mms.telusmobility.com, msg.telus.com * U.S. Cellular: mms.uscc.net * UAE MMS: mms.ae * Unicel: unicel.com, info2go.com (note: mobile number is tucked away in a text/plain part for unicel.com) -* Verizon: vzwpix.com, vtext.com +* Verizon: vzwpix.com, vtext.com, labwig.net * Virgin Mobile: vmpix.com, pixmbl.com, vmobl.com, yrmobl.com * Virgin Mobile of Canada: vmobile.ca * Vodacom: mms.vodacom4me.co.za Corpus of smart phones known to MMS2R: * Apple iPhone variants * Blackberry / Research In Motion variants * Casio variants * Droid variants * Google / Nexus One variants * HTC variants (T-Mobile Dash, Sprint HERO) * LG Electronics variants * Motorola variants * Pantech variants * Qualcom variants * Samsung variants * Sprint variants * UTStarCom variants As Seen On The Internets - sites known to be using MMS2R in some fashion * twitpic.com [http://www.twitpic.com/] * Simplton [http://simplton.com/] * fanchatter.com [http://www.fanchatter.com/] * camura.com [http://www.camura.com/] * eachday.com [http://www.eachday.com/] * beenup2.com [http://www.beenup2.com/] * snapmylife.com [http://www.snapmylife.com/] * email the author to be listed here == FEATURES * #default_media and #default_text methods return a File that can be used in attachment_fu or Paperclip * #process supports blocks for enumerating over the content of the MMS * #process can be made lazy when :process => :lazy is passed to new * logging is enabled when :logger => your_logger is passed to new * an mms instance acts like a Mail object, any methods not defined on the instance are delegated to it's underlying Mail object * #device_type? returns a symbol representing a device or smartphone type Known smartphones thus far: iPhone, BlackBerry, T-Mobile Dash, Droid, Samsung == BOOKS MMS2R, Making email useful http://peepcode.com/products/mms2r-pdf == SYNOPSIS begin require 'mms2r' rescue LoadError require 'rubygems' require 'mms2r' end # required for the example require 'fileutils' mail = MMS2R::Media.new(Mail.read('some_saved_mail.file')) puts "mail has default carrier subject" if mail.subject.empty? # access the sender's phone number puts "mail was from phone #{mail.number}" # most mail are either image or video, default_media will return the largest # (non-advertising) video or image found file = mail.default_media puts "mail had a media: #{file.inspect}" unless file.nil? # finds the largest (non-advertising) text found file = mail.default_text puts "mail had some text: #{file.inspect}" unless file.nil? # mail.media is a hash that is indexed by mime-type. # The mime-type key returns an array of filepaths # to media that were extract from the mail and # are of that type mail.media['image/jpeg'].each {|f| puts "#{f}"} mail.media['text/plain'].each {|f| puts "#{f}"} # print the text (assumes mail had text) text = IO.readlines(mail.media['text/plain'].first).join puts text # save the image (assumes mail had a jpeg) FileUtils.cp mail.media['image/jpeg'].first, '/some/where/useful', :verbose => true puts "does the mail have quicktime video? #{!mail.media['video/quicktime'].nil?}" puts "plus run anything that Mail provides, e.g. #{mail.to.inspect}" # check if the mail is from a mobile phone puts "mail is from a mobile phone #{mail.is_mobile?}" # determine the device type of the phone puts "mail is from a mobile phone of type #{mail.device_type?}" # inspect default media's exif data if exifr gem is installed and default # media is a jpeg or tiff puts "mail's default media's exif data is:" puts mail.exif.inspect # Block support, process and receive all media types of video. mail.process do |media_type, files| # assumes a Clip model that is an AttachmentFu Clip.create(:uploaded_data => files.first, :title => "From phone") if media_type =~ /video/ end # Another AttachmentFu example, Picture model is an AttachmentFu picture = Picture.new picture.title = mail.subject picture.uploaded_data = mail.default_media picture.save! #remove all the media that was put to temporary disk mail.purge == REQUIREMENTS * Mail (mail) * Nokogiri (nokogiri) * UUIDTools (uuidtools) * EXIF Reader (exif) == INSTALL * sudo gem install mms2r == SOURCE git clone git://github.com/monde/mms2r.git == AUTHORS Copyright (c) 2007-2010 by Mike Mondragon (blog[http://plasti.cx/]) MMS2R's Flickr page[http://www.flickr.com/photos/8627919@N05/] == CONTRIBUTORS * Luke Francl (blog[http://railspikes.com/]) * Will Jessup (blog[http://www.willjessup.com/]) * Shane Vitarana (blog[http://www.shanesbrain.net/]) * Layton Wedgeworth (http://www.beenup2.com/) * Jason Haruska (blog[http://software.haruska.com/]) * Dave Myron (company[http://contentfree.com/]) * Vijay Yellapragada * Jesse Dp (github profile[http://github.com/jessedp]) * David Alm * Jeremy Wilkins * Matt Conway (github profile[http://github.com/wr0ngway]) * Kai Kai * Michael DelGaudio * Sai Emrys (blog[http://saizai.com]) * Brendan Lim (github profile[http://github.com/brendanlim]) * Scott Taylor (github profile[http://github.com/smtlaissezfaire]) * Jaap van der Meer (github profile[http://github.com/japetheape]) * Karl Baum (github profile[http://github.com/kbaum]) == LICENSE (The MIT License) Copyright (c) 2007, 2008 Mike Mondragon ([email protected]). All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/conf/aliases.yml b/conf/aliases.yml index abd1a1b..0530ec8 100644 --- a/conf/aliases.yml +++ b/conf/aliases.yml @@ -1,23 +1,24 @@ --- txt.att.net: mms.att.net cingularme.com: mms.att.net mmode.com: mms.att.net mms.mycingular.com: mms.att.net mobile.mycingular.com: mms.att.net pics.cingularme.com: mms.att.net sbcglobal.net: mms.att.net vtext.com: vzwpix.com +labwig.net: vzwpix.com orange.fr: orangemms.net mmsemail.orange.pl: orangemms.net message.alltel.com: mms.alltel.com mmsreply.t-mobile.co.uk: tmomail.net tmo.blackberry.net: tmomail.net info2go.com: unicel.com mms.telusmobility.com: msg.telus.com sasktel.com: sms.sasktel.com cdma.sasktel.com: sms.sasktel.com sprintpcs.com: pm.sprint.com pixmbl.com: vmpix.com vmobile.ca: vmpix.com vmobl.com: vmpix.com yrmobl.com: vmpix.com
monde/mms2r
0c0ee29f4670fd3ed7d81339f6b298cd4ea6caee
sasktel.com is using a cdma subdomain
diff --git a/README.txt b/README.txt index b83933f..67e4500 100644 --- a/README.txt +++ b/README.txt @@ -1,248 +1,248 @@ = mms2r https://github.com/monde/mms2r == DESCRIPTION MMS2R by Mike Mondragon http://mms2r.rubyforge.org/ https://github.com/monde/mms2r https://github.com/monde/mms2r/issues http://peepcode.com/products/mms2r-pdf MMS2R is a library that decodes the parts of an MMS message to disk while stripping out advertising injected by the mobile carriers. MMS messages are multipart email and the carriers often inject branding into these messages. Use MMS2R if you want to get at the real user generated content from a MMS without having to deal with the cruft from the carriers. If MMS2R is not aware of a particular carrier no extra processing is done to the MMS other than decoding and consolidating its media. MMS2R can be used to process any multipart email to conveniently access the parts the mail is comprised of. Contact the author to add additional carriers to be processed by the library. Suggestions and patches appreciated and welcomed! Corpus of carriers currently processed by MMS2R: * 1nbox/Idea: 1nbox.net * 3 Ireland: mms.3ireland.ie * Alltel: mms.alltel.com * AT&T/Cingular/Legacy: mms.att.net, txt.att.net, mmode.com, mms.mycingular.com, cingularme.com, mobile.mycingular.com pics.cingularme.com * Bell Canada: txt.bell.ca * Bell South / Suncom / SBC Global: bellsouth.net, sbcglobal.net * Cricket Wireless: mms.mycricket.com * Dobson/Cellular One: mms.dobson.net * Helio: mms.myhelio.com * Hutchison 3G UK Ltd: mms.three.co.uk * INDOSAT M2: mobile.indosat.net.id * LUXGSM S.A.: mms.luxgsm.lu * Maroc Telecom / mms.mobileiam.ma * MTM South Africa: mms.mtn.co.za * NetCom (Norway): mms.netcom.no * Nextel: messaging.nextel.com * O2 Germany: mms.o2online.de * O2 UK: mediamessaging.o2.co.uk * Orange & Regional Oranges: orangemms.net, mmsemail.orange.pl, orange.fr * PLSPICTURES.COM mms hosting: waw.plspictures.com * PXT New Zealand: pxt.vodafone.net.nz * Rogers of Canada: rci.rogers.com -* SaskTel: sasktel.com, sms.sasktel.com +* SaskTel: sasktel.com, sms.sasktel.com, cdma.sasktel.com * Sprint: pm.sprint.com, messaging.sprintpcs.com, sprintpcs.com * T-Mobile: tmomail.net, mmsreply.t-mobile.co.uk, tmo.blackberry.net * TELUS Corporation (Canada): mms.telusmobility.com, msg.telus.com * U.S. Cellular: mms.uscc.net * UAE MMS: mms.ae * Unicel: unicel.com, info2go.com (note: mobile number is tucked away in a text/plain part for unicel.com) * Verizon: vzwpix.com, vtext.com * Virgin Mobile: vmpix.com, pixmbl.com, vmobl.com, yrmobl.com * Virgin Mobile of Canada: vmobile.ca * Vodacom: mms.vodacom4me.co.za Corpus of smart phones known to MMS2R: * Apple iPhone variants * Blackberry / Research In Motion variants * Casio variants * Droid variants * Google / Nexus One variants * HTC variants (T-Mobile Dash, Sprint HERO) * LG Electronics variants * Motorola variants * Pantech variants * Qualcom variants * Samsung variants * Sprint variants * UTStarCom variants As Seen On The Internets - sites known to be using MMS2R in some fashion * twitpic.com [http://www.twitpic.com/] * Simplton [http://simplton.com/] * fanchatter.com [http://www.fanchatter.com/] * camura.com [http://www.camura.com/] * eachday.com [http://www.eachday.com/] * beenup2.com [http://www.beenup2.com/] * snapmylife.com [http://www.snapmylife.com/] * email the author to be listed here == FEATURES * #default_media and #default_text methods return a File that can be used in attachment_fu or Paperclip * #process supports blocks for enumerating over the content of the MMS * #process can be made lazy when :process => :lazy is passed to new * logging is enabled when :logger => your_logger is passed to new * an mms instance acts like a Mail object, any methods not defined on the instance are delegated to it's underlying Mail object * #device_type? returns a symbol representing a device or smartphone type Known smartphones thus far: iPhone, BlackBerry, T-Mobile Dash, Droid, Samsung == BOOKS MMS2R, Making email useful http://peepcode.com/products/mms2r-pdf == SYNOPSIS begin require 'mms2r' rescue LoadError require 'rubygems' require 'mms2r' end # required for the example require 'fileutils' mail = MMS2R::Media.new(Mail.read('some_saved_mail.file')) puts "mail has default carrier subject" if mail.subject.empty? # access the sender's phone number puts "mail was from phone #{mail.number}" # most mail are either image or video, default_media will return the largest # (non-advertising) video or image found file = mail.default_media puts "mail had a media: #{file.inspect}" unless file.nil? # finds the largest (non-advertising) text found file = mail.default_text puts "mail had some text: #{file.inspect}" unless file.nil? # mail.media is a hash that is indexed by mime-type. # The mime-type key returns an array of filepaths # to media that were extract from the mail and # are of that type mail.media['image/jpeg'].each {|f| puts "#{f}"} mail.media['text/plain'].each {|f| puts "#{f}"} # print the text (assumes mail had text) text = IO.readlines(mail.media['text/plain'].first).join puts text # save the image (assumes mail had a jpeg) FileUtils.cp mail.media['image/jpeg'].first, '/some/where/useful', :verbose => true puts "does the mail have quicktime video? #{!mail.media['video/quicktime'].nil?}" puts "plus run anything that Mail provides, e.g. #{mail.to.inspect}" # check if the mail is from a mobile phone puts "mail is from a mobile phone #{mail.is_mobile?}" # determine the device type of the phone puts "mail is from a mobile phone of type #{mail.device_type?}" # inspect default media's exif data if exifr gem is installed and default # media is a jpeg or tiff puts "mail's default media's exif data is:" puts mail.exif.inspect # Block support, process and receive all media types of video. mail.process do |media_type, files| # assumes a Clip model that is an AttachmentFu Clip.create(:uploaded_data => files.first, :title => "From phone") if media_type =~ /video/ end # Another AttachmentFu example, Picture model is an AttachmentFu picture = Picture.new picture.title = mail.subject picture.uploaded_data = mail.default_media picture.save! #remove all the media that was put to temporary disk mail.purge == REQUIREMENTS * Mail (mail) * Nokogiri (nokogiri) * UUIDTools (uuidtools) * EXIF Reader (exif) == INSTALL * sudo gem install mms2r == SOURCE git clone git://github.com/monde/mms2r.git == AUTHORS Copyright (c) 2007-2010 by Mike Mondragon (blog[http://plasti.cx/]) MMS2R's Flickr page[http://www.flickr.com/photos/8627919@N05/] == CONTRIBUTORS * Luke Francl (blog[http://railspikes.com/]) * Will Jessup (blog[http://www.willjessup.com/]) * Shane Vitarana (blog[http://www.shanesbrain.net/]) * Layton Wedgeworth (http://www.beenup2.com/) * Jason Haruska (blog[http://software.haruska.com/]) * Dave Myron (company[http://contentfree.com/]) * Vijay Yellapragada * Jesse Dp (github profile[http://github.com/jessedp]) * David Alm * Jeremy Wilkins * Matt Conway (github profile[http://github.com/wr0ngway]) * Kai Kai * Michael DelGaudio * Sai Emrys (blog[http://saizai.com]) * Brendan Lim (github profile[http://github.com/brendanlim]) * Scott Taylor (github profile[http://github.com/smtlaissezfaire]) * Jaap van der Meer (github profile[http://github.com/japetheape]) * Karl Baum (github profile[http://github.com/kbaum]) == LICENSE (The MIT License) Copyright (c) 2007, 2008 Mike Mondragon ([email protected]). All rights reserved. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/conf/aliases.yml b/conf/aliases.yml index e7d530f..abd1a1b 100644 --- a/conf/aliases.yml +++ b/conf/aliases.yml @@ -1,22 +1,23 @@ --- txt.att.net: mms.att.net cingularme.com: mms.att.net mmode.com: mms.att.net mms.mycingular.com: mms.att.net mobile.mycingular.com: mms.att.net pics.cingularme.com: mms.att.net sbcglobal.net: mms.att.net vtext.com: vzwpix.com orange.fr: orangemms.net mmsemail.orange.pl: orangemms.net message.alltel.com: mms.alltel.com mmsreply.t-mobile.co.uk: tmomail.net tmo.blackberry.net: tmomail.net info2go.com: unicel.com mms.telusmobility.com: msg.telus.com sasktel.com: sms.sasktel.com +cdma.sasktel.com: sms.sasktel.com sprintpcs.com: pm.sprint.com pixmbl.com: vmpix.com vmobile.ca: vmpix.com vmobl.com: vmpix.com yrmobl.com: vmpix.com
monde/mms2r
c6af00539a1ec86129716975c6b3c363befc0f7c
Detecting an Android phone.
diff --git a/conf/mms2r_media.yml b/conf/mms2r_media.yml index 78bf269..36dafab 100644 --- a/conf/mms2r_media.yml +++ b/conf/mms2r_media.yml @@ -1,68 +1,69 @@ --- ignore: text/plain: - !ruby/regexp /^\(no subject\)$/i - !ruby/regexp /\ASent via BlackBerry (from|by) .*$/im - !ruby/regexp /\ASent from my Verizon Wireless BlackBerry$/im - !ruby/regexp /\ASent from (my|your) iPhone.?$/im - !ruby/regexp /\ASent on the Sprint.* Now Network.*$/im multipart/mixed: - !ruby/regexp "/^Attachment: /i" transform: text/plain: - - !ruby/regexp /\A(.*?)Sent via BlackBerry (from|by) .*$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from my Verizon Wireless BlackBerry$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from (my|your) iPhone.?$/im - "\\1" - - !ruby/regexp /\A(.*?)\s+image\/jpeg$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent on the Sprint.* Now Network.*$/im - "\\1" device_types: headers: x-mailer: :iphone: !ruby/regexp /iPhone Mail/i :blackberry: !ruby/regexp /Palm webOS/i mime-version: :iphone: !ruby/regexp /iPhone Mail/i x-rim-org-msg-ref-id: :blackberry: !ruby/regexp /.+/ # TODO do something about the assortment of camera models that have # been seen: # 1.3 Megapixel, 2.0 Megapixel, BlackBerry, CU920, G'z One TYPE-S, # Hermes, iPhone, LG8700, LSI_S5K4AAFA, Micron MT9M113 1.3MP YUV, # Motorola Phone, Omni_vision-9650, Pre, # Seoul Electronics & Telecom SIM120B 1.3M, SGH-T729, SGH-T819, # SPH-M540, SPH-M800, SYSTEMLSI S5K4BAFB 2.0 MP, VX-9700 # # NOTE: These model strings are stored in the exif model header of an image file # created and sent by the device, the regex is used by mms2r to detect the # model string makes: + :android: !ruby/regexp /Android/i :apple: !ruby/regexp /^(Apple|Hipstamatic)$/i :casio: !ruby/regexp /^CASIO$/i :dash: !ruby/regexp /T-Mobile Dash/i :google: !ruby/regexp /^google$/i :htc: !ruby/regexp /^HTC/i :lge: !ruby/regexp /^(LG|CX87BL05)/i :motorola: !ruby/regexp /^Motorola/i :pantech: !ruby/regexp /^PANTECH$/i :qualcomm: !ruby/regexp /^MSM6/i :research_in_motion: !ruby/regexp /^(RIM|Research In Motion)$/i :samsung: !ruby/regexp /^(SAMSUNG|ES.M800|M6550B-SAM-4480)/i :seoul_electronics: !ruby/regexp /^ISUS0/i :sprint: !ruby/regexp /^Sprint$/i :utstarcom: !ruby/regexp /^T1A_UC1.88$/i models: :blackberry: !ruby/regexp /BlackBerry/i :dash: !ruby/regexp /T-Mobile Dash/i :droid: !ruby/regexp /Droid/i :htc: !ruby/regexp /HTC|Eris|HERO200/i :iphone: !ruby/regexp /iPhone|201/i software: :blackberry: !ruby/regexp /^Rim Exif/i filenames: :iphone: !ruby/regexp /^photo.JPG$/ :iphone: !ruby/regexp /^photo.PNG$/ diff --git a/test/test_mms2r_media.rb b/test/test_mms2r_media.rb index af7d767..99ac44e 100644 --- a/test/test_mms2r_media.rb +++ b/test/test_mms2r_media.rb @@ -322,544 +322,551 @@ class TestMms2rMedia < Test::Unit::TestCase def test_empty_body mms = MMS2R::Media.new stub_mail mms.stubs(:default_text).returns(nil) assert_equal "", mms.body end def test_body mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") mms.stubs(:default_text).returns(File.new(temp_big)) body = mms.body assert_equal "hello world", body end def test_body_when_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") mms.stubs(:default_html).returns(File.new(temp_big)) assert_equal "hello world teapot", mms.body end def test_default_text mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'text/plain' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_text.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_text.local_path end def test_default_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") temp_small = temp_text_file("<html><head><title>hello</title></head><body>world<body></html>") mms.stubs(:media).returns({'text/html' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_html.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_html.local_path end def test_default_media mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'image/jpeg' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_media.local_path end def test_default_media_treats_image_and_video_equally mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big_image = temp_text_file("hello world") temp_small_image = temp_text_file("hello") temp_big_video = temp_text_file("hello world again") temp_small_video = temp_text_file("hello again") mms.stubs(:media).returns({'image/jpeg' => [temp_small_image, temp_big_image], 'video/mpeg' => [temp_small_video, temp_big_video], }) assert_equal temp_big_video, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big_video, mms.default_media.local_path end #def test_default_media_treats_gif_and_jpg_equally # #it doesn't matter that these are text files, we just need say they are images # temp_big = temp_text_file("hello world") # temp_small = temp_text_file("hello") # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/jpeg' => [temp_big], 'image/gif' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/gif' => [temp_big], 'image/jpg' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path #end def test_purge mms = MMS2R::Media.new stub_mail mms.purge assert_equal false, File.exist?(mms.media_dir) end def test_ignore_media_by_filename_equality name = 'foo.txt' type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [name]}}) # type is not in the ingore part = stub(:body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and filename are in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal true, mms.ignore_media?(type, part) # type but not file name are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_filename name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'foo.txt', mms.filename?(part) end def test_long_filename name = 'x' * 300 + '.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'x' * 251 + '.txt', mms.filename?(part) end def test_filename_when_file_extension_missing_part name = 'foo' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.txt', mms.filename?(part) name = 'foo.janky' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.janky.txt', mms.filename?(part) end def test_ignore_media_by_filename_regexp name = 'foo.txt' regexp = /foo\.txt/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [regexp, 'nil.txt']}}) # type is not in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the filename are in the ingore part = stub(:filename => name) assert_equal true, mms.ignore_media?(type, part) # type but not regexp for filename are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_by_regexp_on_file_content name = 'foo.txt' content = "aaaaaaahello worldbbbbbbbbb" regexp = /.*Hello World.*/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => ['nil.txt', regexp]}}) part = stub(:filename => name, :body => Mail::Body.new(content)) # type is not in the ingore assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the content are in the ingore assert_equal true, mms.ignore_media?(type, part) # type but not regexp for content are in the ignore part = stub(:filename => name, :body => Mail::Body.new('no teapots')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_when_file_content_is_empty mms = MMS2R::Media.new stub_mail # there is no conf but the part's body is empty part = stub(:filename => 'foo.txt', :body => Mail::Body.new) assert_equal true, mms.ignore_media?('text/test', part) # there is no conf but the part's body is white space part = stub(:filename => 'foo.txt', :body => Mail::Body.new("\t\n\t\n ")) assert_equal true, mms.ignore_media?('text/test', part) end def test_add_file mail = stub_mail mail.stubs(:from).returns(['[email protected]']) mms = MMS2R::Media.new(mail) mms.stubs(:media).returns({}) assert_nil mms.media['text/html'] mms.add_file('text/html', '/tmp/foo.html') assert_equal ['/tmp/foo.html'], mms.media['text/html'] mms.add_file('text/html', '/tmp/bar.html') assert_equal ['/tmp/foo.html', '/tmp/bar.html'], mms.media['text/html'] end def test_temp_file name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal name, File.basename(mms.temp_file(part)) end def test_process_media_for_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', 'hello world']) result = mms.process_media(part) assert_equal 'text/plain', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_with_empty_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', '']) assert_equal ['text/plain', nil], mms.process_media(part) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_application_smil name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['application/smil', nil]) part = stub(:filename => name, :content_type => 'application/smil', :part_type? => 'application/smil', :main_type => 'application') assert_equal ['application/smil', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['application/smil', 'hello world']) result = mms.process_media(part) assert_equal 'application/smil', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_application_octet_stream_when_image name = 'fake.jpg' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'application/octet-stream', :part_type? => 'application/octet-stream', :body => Mail::Body.new("data"), :main_type => 'application') result = mms.process_media(part) assert_equal 'image/jpeg', result.first assert_match(/fake\.jpg$/, result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_all_other_media name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :main_type => 'faux', :part_type? => 'faux/text', :body => Mail::Body.new(nil)) assert_equal ['faux/text', nil], mms.process_media(part) part = stub(:filename => name, :main_type => 'faux', :part_type? => 'faux/text', :body => Mail::Body.new('hello world')) result = mms.process_media(part) assert_equal 'faux/text', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process mms = MMS2R::Media.new stub_mail assert_equal 1, mms.media.size assert_not_nil mms.media['text/plain'] assert_equal 1, mms.media['text/plain'].size assert_equal true, File.exist?(mms.media['text/plain'].first) assert_equal 1, File.size(mms.media['text/plain'].first) mms.purge end def test_process_with_multipart_double_parts mail = mail('apple-double-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_not_nil mms.media['application/applefile'] assert_equal 1, mms.media['application/applefile'].size assert_not_nil mms.media['image/jpeg'] assert_equal 1, mms.media['image/jpeg'].size assert_match(/DSCN1715\.jpg$/, mms.media['image/jpeg'].first) assert_file_size mms.media['image/jpeg'].first, 337 mms.purge end def test_process_with_multipart_alternative_parts mail = stub_mail plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new('a'), :main_type => 'text') plain.stubs(:multipart?).at_least_once.returns(false) html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new('a'), :main_type => 'text') html.stubs(:multipart?).at_least_once.returns(false) multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) multi.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:parts).at_least_once.returns([multi]) # the multipart/alternative should get flattend to text and html mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_equal 2, mms.media.size assert_not_nil mms.media['text/plain'] assert_not_nil mms.media['text/html'] assert_equal 1, mms.media['text/plain'].size assert_equal 1, mms.media['text/html'].size assert_equal 'message.txt', File.basename(mms.media['text/plain'].first) assert_equal 'message.html', File.basename(mms.media['text/html'].first) assert_equal true, File.exist?(mms.media['text/plain'].first) assert_equal true, File.exist?(mms.media['text/html'].first) assert_equal 1, File.size(mms.media['text/plain'].first) assert_equal 1, File.size(mms.media['text/html'].first) mms.purge end def test_process_when_media_is_ignored mail = stub_mail plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new(''), :main_type => 'text') plain.stubs(:multipart?).at_least_once.returns(false) html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new(''), :main_type => 'text') html.stubs(:multipart?).at_least_once.returns(false) multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) multi.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:parts).at_least_once.returns([multi]) mms = MMS2R::Media.new(mail, :process => :lazy) mms.stubs(:config).returns({'ignore' => {'text/plain' => ['message.txt'], 'text/html' => ['message.html']}}) assert_nothing_raised { mms.process } # the multipart/alternative should get flattend to text and html and then # what's flattened is ignored assert_equal 0, mms.media.size mms.purge end def test_process_when_yielding_to_a_block mail = stub_mail plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new('a'), :main_type => 'text') plain.stubs(:multipart?).at_least_once.returns(false) html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new('b'), :main_type => 'text') html.stubs(:multipart?).at_least_once.returns(false) multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) multi.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:parts).at_least_once.returns([multi]) # the multipart/alternative should get flattend to text and html mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size mms.process do |type, files| assert_equal 1, files.size assert_equal true, type == 'text/plain' || type == 'text/html' assert_equal true, File.basename(files.first) == 'message.txt' || File.basename(files.first) == 'message.html' assert_equal true, File::exist?(files.first) end mms.purge end def test_domain_from_return_path mail = mock() mail.expects(:from).at_least_once.returns([]) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'null.example.com', domain end def test_domain_from_from mail = mock() mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'null.example.com', domain end def test_domain_from_from_yaml f = File.join(MMS2R::Media.conf_dir, 'from.yml') YAML.expects(:load_file).once.with(f).returns(['example.com']) mail = mock() mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'example.com', domain end def test_unknown_device_type mail = mail('generic.mail') mms = MMS2R::Media.new(mail) assert_equal :unknown, mms.device_type? assert_equal false, mms.is_mobile? end def test_iphone_device_type_by_header iphones = ['att-iphone-01.mail', 'iphone-image-01.mail'] iphones.each do |iphone| mail = mail(iphone) mms = MMS2R::Media.new(mail) assert_equal :iphone, mms.device_type?, "fixture #{iphone} was not a iphone" assert_equal true, mms.is_mobile? end end def test_exif mail = smart_phone_mock mms = MMS2R::Media.new(mail) assert_equal 'iPhone', mms.exif.model end def test_iphone_device_type_by_exif mail = smart_phone_mock mms = MMS2R::Media.new(mail) assert_equal :iphone, mms.device_type? assert_equal true, mms.is_mobile? end def test_faux_tiff_iphone_device_type_by_exif mail = smart_phone_mock('Apple', 'iPhone', nil, nil, jpeg = false) mms = MMS2R::Media.new(mail) assert_equal :iphone, mms.device_type? assert_equal true, mms.is_mobile? end def test_iphone_device_type_by_filename_jpg mail = smart_phone_mock('Hipstamatic', '201') mms = MMS2R::Media.new(mail) assert_equal :apple, mms.device_type? assert_equal true, mms.is_mobile? end def test_iphone_device_type_by_filename_png mail = mail('iphone-image-02.mail') mms = MMS2R::Media.new(mail) assert_equal true, mms.is_mobile? assert_equal :iphone, mms.device_type? end def test_blackberry_device_type_by_exif_make_model mail = smart_phone_mock('Research In Motion', 'BlackBerry') mms = MMS2R::Media.new(mail) assert_equal :blackberry, mms.device_type? assert_equal true, mms.is_mobile? end def test_blackberry_device_type_by_exif_software mail = smart_phone_mock(nil, nil, "Rim Exif Version1.00a") mms = MMS2R::Media.new(mail) assert_equal :blackberry, mms.device_type? assert_equal true, mms.is_mobile? end def test_dash_device_type_by_exif mail = smart_phone_mock('T-Mobile Dash', 'T-Mobile Dash') mms = MMS2R::Media.new(mail) assert_equal :dash, mms.device_type? assert_equal true, mms.is_mobile? end def test_droid_device_type_by_exif mail = smart_phone_mock('Motorola', 'Droid') mms = MMS2R::Media.new(mail) assert_equal :droid, mms.device_type? assert_equal true, mms.is_mobile? end def test_htc_eris_device_type_by_exif mail = smart_phone_mock('HTC', 'Eris') mms = MMS2R::Media.new(mail) assert_equal :htc, mms.device_type? assert_equal true, mms.is_mobile? end def test_htc_hero_device_type_by_exif mail = smart_phone_mock('HTC', 'HERO200') mms = MMS2R::Media.new(mail) assert_equal :htc, mms.device_type? assert_equal true, mms.is_mobile? end + def test_android_app_by_exif + mail = smart_phone_mock('Retro Camera Android', "Xoloroid 2000") + mms = MMS2R::Media.new(mail) + assert_equal :android, mms.device_type? + assert_equal true, mms.is_mobile? + end + def test_handsets_by_exif handsets = YAML.load_file(fixture('handsets.yml')) handsets.each do |handset| mail = smart_phone_mock(handset.first, handset.last) mms = MMS2R::Media.new(mail) assert_equal true, mms.is_mobile?, "mms with make #{mms.exif.make}, and model #{mms.exif.model}, should be considered a mobile device" end end def test_blackberry_device_type berries = ['att-blackberry.mail', 'suncom-blackberry.mail', 'tmobile-blackberry-02.mail', 'tmobile-blackberry.mail', 'tmo.blackberry.net-image-01.mail', 'verizon-blackberry.mail', 'verizon-blackberry.mail'] berries.each do |berry| mms = MMS2R::Media.new(mail(berry)) assert_equal :blackberry, mms.device_type?, "fixture #{berry} was not a blackberrry" assert_equal true, mms.is_mobile? end end def test_handset_device_type mail = mail('att-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal :handset, mms.device_type? assert_equal true, mms.is_mobile? end end
monde/mms2r
f72ed908f5965f3eb130faf54ae9d178c0776905
Mark images name photo.PNG as coming from iphones. Mark images coming from Hipstamatic as coming from apple products.
diff --git a/conf/mms2r_media.yml b/conf/mms2r_media.yml index 9be7a75..78bf269 100644 --- a/conf/mms2r_media.yml +++ b/conf/mms2r_media.yml @@ -1,65 +1,68 @@ --- ignore: text/plain: - !ruby/regexp /^\(no subject\)$/i - !ruby/regexp /\ASent via BlackBerry (from|by) .*$/im - !ruby/regexp /\ASent from my Verizon Wireless BlackBerry$/im - !ruby/regexp /\ASent from (my|your) iPhone.?$/im - !ruby/regexp /\ASent on the Sprint.* Now Network.*$/im multipart/mixed: - !ruby/regexp "/^Attachment: /i" transform: text/plain: - - !ruby/regexp /\A(.*?)Sent via BlackBerry (from|by) .*$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from my Verizon Wireless BlackBerry$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from (my|your) iPhone.?$/im - "\\1" - - !ruby/regexp /\A(.*?)\s+image\/jpeg$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent on the Sprint.* Now Network.*$/im - "\\1" device_types: headers: x-mailer: :iphone: !ruby/regexp /iPhone Mail/i :blackberry: !ruby/regexp /Palm webOS/i mime-version: :iphone: !ruby/regexp /iPhone Mail/i x-rim-org-msg-ref-id: :blackberry: !ruby/regexp /.+/ # TODO do something about the assortment of camera models that have # been seen: # 1.3 Megapixel, 2.0 Megapixel, BlackBerry, CU920, G'z One TYPE-S, # Hermes, iPhone, LG8700, LSI_S5K4AAFA, Micron MT9M113 1.3MP YUV, # Motorola Phone, Omni_vision-9650, Pre, # Seoul Electronics & Telecom SIM120B 1.3M, SGH-T729, SGH-T819, # SPH-M540, SPH-M800, SYSTEMLSI S5K4BAFB 2.0 MP, VX-9700 # # NOTE: These model strings are stored in the exif model header of an image file # created and sent by the device, the regex is used by mms2r to detect the # model string - models: - :blackberry: !ruby/regexp /BlackBerry/i - :dash: !ruby/regexp /T-Mobile Dash/i - :droid: !ruby/regexp /Droid/i - :htc: !ruby/regexp /HTC|Eris|HERO200/i - :iphone: !ruby/regexp /iPhone/i makes: - :apple: !ruby/regexp /^Apple$/i + :apple: !ruby/regexp /^(Apple|Hipstamatic)$/i :casio: !ruby/regexp /^CASIO$/i :dash: !ruby/regexp /T-Mobile Dash/i :google: !ruby/regexp /^google$/i :htc: !ruby/regexp /^HTC/i :lge: !ruby/regexp /^(LG|CX87BL05)/i :motorola: !ruby/regexp /^Motorola/i :pantech: !ruby/regexp /^PANTECH$/i :qualcomm: !ruby/regexp /^MSM6/i :research_in_motion: !ruby/regexp /^(RIM|Research In Motion)$/i :samsung: !ruby/regexp /^(SAMSUNG|ES.M800|M6550B-SAM-4480)/i :seoul_electronics: !ruby/regexp /^ISUS0/i :sprint: !ruby/regexp /^Sprint$/i :utstarcom: !ruby/regexp /^T1A_UC1.88$/i + models: + :blackberry: !ruby/regexp /BlackBerry/i + :dash: !ruby/regexp /T-Mobile Dash/i + :droid: !ruby/regexp /Droid/i + :htc: !ruby/regexp /HTC|Eris|HERO200/i + :iphone: !ruby/regexp /iPhone|201/i software: :blackberry: !ruby/regexp /^Rim Exif/i + filenames: + :iphone: !ruby/regexp /^photo.JPG$/ + :iphone: !ruby/regexp /^photo.PNG$/ diff --git a/lib/mms2r/media.rb b/lib/mms2r/media.rb index 625d649..2ab70d1 100644 --- a/lib/mms2r/media.rb +++ b/lib/mms2r/media.rb @@ -28,772 +28,791 @@ # require 'mms2r' # end # mail = Mail.read("sample-MMS.file") # mms = MMS2R::Media.new(mail) # subject = mms.subject # number = mms.number # file = mms.default_media # mms.purge # # == Rails ActionMailer#receive w/ AttachmentFu Example # # def receive(mail) # mms = MMS2R::Media.new(mail) # picture = Picture.new # picture is an attachemnt_fu model # picture.title = mms.subject # picture.uploaded_data = mms.default_media # picture.save! # mms.purge # end # # == More Examples # # See the README.txt file for more examples # # == Built In Configuration # # A custom configuration can be created for processing the MMS from carriers # that are not currently known by MMS2R. In the conf/ directory create a # YAML file named by combining the domain name of the MMS sender plus a .yml # extension. For instance the configuration of senders from AT&T's cellular # service with a Sender pattern of [email protected] have a configuration # named conf/mms.att.net.yml # # The YAML configuration contains a Hash with instructions for determining what # is content generated by the user and what is content inserted by the carrier. # # The root hash itself has two hashes under the keys 'ignore' and 'transform', # and an array under the 'number' key. # Each hash is itself keyed by mime-type. The value pointed to by the mime-type # key is an array. The ignore arrays are first inspected as regular expressions # else are used as a equality for a string filename. Ignores # work by filename # for the multi-part of the MMS that is being inspected. The array pointed to # by the 'number' key represents an alternate mail header where the sender's # number can be found with a regular expression and replacement value for a # gsub. # # The transform arrays are themselves an array of two element arrays. The elements # are regexp parameters for gsub. # # Ignore instructions are honored first then transform instructions. In the sample, # masthead.jpg is ignored as a regular expression, and spacer.gif is ignored as a # filename comparison. The transform has a match and a replacement, see the gsub # documentation for more information about match and replace. # # -- # ignore: # image/jpeg: # - /^masthead.jpg$/i # image/gif: # - spacer.gif # text/plain: # - /\AThis message was sent using PIX-FLIX Messaging service from .*/m # transform: # text/plain: # - - /\A(.+?)\s+This message was sent using PIX-FLIX Messaging .*/m # - "\1" # number: # - from # - /^([^\s]+)\s.*/ # - "\1" # # Carriers often provide their services under many different domain names. # The conf/aliases.yml is a YAML file with a hash that maps alternative or # legacy carrier names to the most common name of their service. For example # in terms of MMS2R txt.att.net is an alias for mms.att.net. Therefore when # an MMS with a Sender of txt.att.net is processed MMS2R will use the # mms.att.net configuration to process the message. module MMS2R class MMS2R::Media # Pass off everything we don't do to the Mail object # TODO: refactor to explicit addition a la http://blog.jayfields.com/2008/02/ruby-replace-methodmissing-with-dynamic.html def method_missing method, *args, &block mail.send method, *args, &block end ## # Mail object that the media files were derived from. attr_reader :mail ## # media returns the hash of media. The media hash is keyed by mime-type # such as 'text/plain' and the value mapped to the key is an array of # media that are of that type. attr_reader :media ## # Carrier is the domain name of the carrier. If the carrier is not known # the carrier will be set to 'mms2r.media' attr_reader :carrier ## # Base working dir where media for a unique mms message are dropped attr_reader :media_dir ## # Determine if return-path or from is going to be used to desiginate the # origin carrier. If the domain in the From header is listed in # conf/from.yaml then that is the carrier domain. Else if there is a # Return-Path header its address's domain is the carrier doamin, else # use From header's address domain. def self.domain(mail) return_path = case when mail.return_path mail.return_path ? mail.return_path.split('@').last : '' else '' end from_domain = case when mail.from && mail.from.first mail.from.first.split('@').last else '' end f = File.expand_path(File.join(self.conf_dir(), "from.yml")) from = YAML::load_file(f) ret = case when from.include?(from_domain) from_domain when return_path.present? return_path else from_domain end ret end ## # Initialize a new MMS2R::Media comprised of a mail. # # Specify options to initialize with: # :logger => some_logger for logging # :process => :lazy, for non-greedy processing upon initialization # # #process will have to be called explicitly if the lazy process option # is chosen. def initialize(mail, opts={}) @mail = mail @logger = opts[:logger] log("#{self.class} created", :info) @carrier = self.class.domain(mail) @dir_count = 0 sha = Digest::SHA1.hexdigest("#{@carrier}-#{Time.now.to_i}-#{rand}") @media_dir = File.expand_path( File.join(self.tmp_dir(), "#{self.safe_message_id(@mail.message_id)}_#{sha}")) @media = {} @was_processed = false @number = nil @subject = nil @body = nil @exif = nil @default_media = nil @default_text = nil @default_html = nil f = File.expand_path(File.join(self.conf_dir(), "aliases.yml")) @aliases = YAML::load_file(f) conf = "#{@aliases[@carrier] || @carrier}.yml" f = File.expand_path(File.join(self.conf_dir(), conf)) c = File.exist?(f) ? YAML::load_file(f) : {} @config = self.class.initialize_config(c) processor_module = MMS2R::CARRIERS[@carrier] extend processor_module if processor_module lazy = (opts[:process] == :lazy) rescue false self.process() unless lazy end ## # Get the phone number associated with this MMS if it exists. The value # returned is simplistic, it is just the user name of the from address # before the @ symbol. Validation of the number is left to you. Most # carriers are using the real phone number as the username. def number unless @number params = config['number'] if params && params.any? && (header = mail.header[params[0]]) @number = header.to_s.gsub(params[1], params[2]) end if @number.nil? || @number.blank? @number = mail.from.first.split(/@|\//).first rescue "" end end @number end ## # Return the Subject for this message, returns "" for default carrier # subject such as 'Multimedia message' for ATT&T carrier. def subject unless @subject subject = mail.subject.strip rescue "" ignores = config['ignore']['text/plain'] if ignores && ignores.detect{|s| s == subject} @subject = "" else @subject = transform_text('text/plain', subject).last end end @subject end # Convenience method that returns a string including all the text of the # default text/plain file found. If the plain text is blank then it returns # stripped down version of the title and body of default text/html. Returns # empty string if no body text is found. def body text_file = default_text @body = text_file ? IO.readlines(text_file.path).join.strip : "" if @body.blank? && html_file = default_html html = Nokogiri::HTML(IO.read(html_file.path)) @body = (html.xpath("//head/title").map(&:text) + html.xpath("//body/*").map(&:text)).join(" ") end @body end # Returns a File with the most likely candidate for the user-submitted # media. Given that most MMS messages only have one file attached, this # method will try to return that file. Singleton methods are added to # the File object so it can be used in place of a CGI upload (local_path, # original_filename, size, and content_type) such as in conjunction with # AttachementFu. The largest file found in terms of bytes is returned. # # Returns nil if there are not any video or image Files found. def default_media @default_media ||= attachment(['video', 'image', 'application', 'text']) end # Returns a File with the most likely candidate that is text, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_text @default_text ||= attachment(['text/plain']) end # Returns a File with the most likely candidate that is html, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_html @default_html ||= attachment(['text/html']) end ## # process is a template method and collects all the media in a MMS. # Override helper methods to this template to clean out advertising and/or # ignore media that are advertising. This method should not be overridden # unless there is an extreme special case in processing the media of a MMS # (like Sprint) # # Helper methods for the process template: # * ignore_media? -- true if the media contained in a part should be ignored. # * process_media -- retrieves media to temporary file, returns path to file. # * transform_text -- called by process_media, strips out advertising. # * temp_file -- creates a temporary filepath based on information from the part. # # Block support: # Call process() with a block to automatically iterate through media. # For example, to process and receive only media of video type: # mms.process do |media_type, file| # results << file if media_type =~ /video/ # end # # note: purge must be explicitly called to remove the media files # mms2r extracts from an mms message. def process() # :yields: media_type, file unless @was_processed log("#{self.class} processing", :info) parts = mail.multipart? ? mail.parts : [mail] # Double check for multipart/related, if it exists replace it with its # children parts. Do this twice as multipart/alternative can have # children and we want to fold everything down for i in 1..2 flat = [] parts.each do |p| if p.multipart? p.parts.each {|mp| flat << mp } else flat << p end end parts = flat.dup end # get to work parts.each do |p| t = p.part_type? unless ignore_media?(t,p) t,f = process_media(p) add_file(t,f) unless t.nil? || f.nil? end end @was_processed = true end # when process acts upon a block if block_given? media.each do |k, v| yield(k, v) end end end ## # Helper for process template method to determine if media contained in a # part should be ignored. Producers should override this method to return # true for media such as images that are advertising, carrier logos, etc. # See the ignore section in the discussion of the built-in configuration. def ignore_media?(type, part) ignores = config['ignore'][type] || [] ignore = ignores.detect{ |test| filename?(part) == test} ignore ||= ignores.detect{ |test| filename?(part) =~ test if test.is_a?(Regexp) } ignore ||= ignores.detect{ |test| part.body.decoded.strip =~ test if test.is_a?(Regexp) } ignore ||= (part.body.decoded.strip.size == 0 ? true : nil) ignore.nil? ? false : true end ## # Helper for process template method to decode the part based on its type # and write its content to a temporary file. Returns path to temporary # file that holds the content. Parts with a main type of text will have # their contents transformed with a call to transform_text # # Producers should only override this method if the parts of the MMS need # special treatment besides what is expected for a normal mime part (like # Sprint). # # Returns a tuple of content type, file path def process_media(part) # Mail body auto-magically decodes quoted # printable for text/html type. file = temp_file(part) if part.part_type? =~ /^text\// || part.part_type? == 'application/smil' type, content = transform_text_part(part) mode = 'wb' else if part.part_type? == 'application/octet-stream' type = type_from_filename(filename?(part)) else type = part.part_type? end content = part.body.decoded mode = 'wb' # open with binary bit for Windows for non text end return type, nil if content.nil? || content.empty? log("#{self.class} writing file #{file}", :info) File.open(file, mode){ |f| f.write(content) } return type, file end ## # Helper for process_media template method to transform text. # See the transform section in the discussion of the built-in # configuration. def transform_text(type, text, original_encoding = 'ISO-8859-1') return type, text if !config['transform'] || !(transforms = config['transform'][type]) if RUBY_VERSION < "1.9" #convert to UTF-8 begin c = Iconv.new('UTF-8', original_encoding ) utf_t = c.iconv(text) rescue Exception => e utf_t = text end else utf_t = text.encoding == "ASCII-8BIT" ? text.force_encoding("ISO-8859-1").encode("UTF-8") : text end transforms.each do |transform| next unless transform.size == 2 p = transform.first r = transform.last utf_t = utf_t.gsub(p, r) rescue utf_t end return type, utf_t end ## # Helper for process_media template method to transform text. def transform_text_part(part) type = part.part_type? text = part.body.decoded.strip transform_text(type, text) end ## # Helper for process template method to name a temporary filepath based on # information in the part. This version attempts to honor the name of the # media as labeled in the part header and creates a unique temporary # directory for writing the file so filename collision does not occur. # Consumers of this method expect the directory structure to the file # exists, if the method is overridden it is mandatory that this behavior is # retained. def temp_file(part) file_name = filename?(part) File.expand_path(File.join(msg_tmp_dir(),File.basename(file_name))) end ## # Purges the unique MMS2R::Media.media_dir directory created # for this producer and all of the media that it contains. def purge() log("#{self.class} purging #{@media_dir} and all its contents", :info) FileUtils.rm_rf(@media_dir) end ## # Helper to add a file to the media hash. def add_file(type, file) media[type] = [] unless media[type] media[type] << file end ## # Helper to temp_file to create a unique temporary directory that is a # child of tmp_dir This version is based on the message_id of the mail. def msg_tmp_dir() @dir_count += 1 dir = File.expand_path(File.join(@media_dir, "#{@dir_count}")) FileUtils.mkdir_p(dir) dir end ## # returns a filename declared for a part, or a default if its not defined def filename?(part) name = part.filename if (name.nil? || name.empty?) if part.content_id && (matched = /^<(.+)>$/.match(part.content_id)) name = matched[1] else name = "#{Time.now.to_f}.#{self.default_ext(part.part_type?)}" end end # FIXME FWIW, janky look for dot extension 1 to 4 chars long name = (name =~ /\..{1,4}$/ ? name : "#{name}.#{self.default_ext(part.part_type?)}").strip # handle excessively large filenames if name.size > 255 ext = File.extname(name) base = File.basename(name, ext) name = "#{base[0, 255 - ext.size]}#{ext}" end name end def aliases @aliases end ## - # Best guess of the mobile device type. Simple heuristics thus far by - # inspecting mail headers and jpeg/tiff exif metadata. - # Smart phone types are - # :iphone :blackberry :dash :droid + # Best guess of the mobile device type. Simple heuristics thus far by + # inspecting mail headers and jpeg/tiff exif metadata, and file name. + # Known smart phone types thus far are + # + # * :blackberry + # * :dash + # * :droid + # * :htc + # * :iphone + # * :lge + # * :motorola + # * :pantech + # * :samsung + # # If the message is from a carrier known to MMS2R, and not a smart phone # its type is returned as :handset # Otherwise device type is :unknown def device_type? file = attachment(['image']) if file original = file.original_filename @exif = case original when /\.je?pg$/i EXIFR::JPEG.new(file) when /\.tiff?$/i EXIFR::TIFF.new(file) end if @exif models = config['device_types']['models'] rescue {} - models.each do |model, regex| - return model if @exif.model =~ regex + models.each do |type, regex| + return type if @exif.model =~ regex end makes = config['device_types']['makes'] rescue {} - makes.each do |make, regex| - return make if @exif.make =~ regex + makes.each do |type, regex| + return type if @exif.make =~ regex end - softwares = config['device_types']['software'] rescue {} - softwares.each do |software, regex| - return software if @exif.software =~ regex + software = config['device_types']['software'] rescue {} + software.each do |type, regex| + return type if @exif.software =~ regex end end end headers = config['device_types']['headers'] rescue {} headers.keys.each do |header| if mail.header[header.downcase] # headers[header] refers to a hash of smart phone types with regex values # that if they match, the header signals the type should be returned headers[header].each do |type, regex| return type if mail.header[header.downcase].decoded =~ regex end end end + file = attachment(['image']) + if file + original_filename = file.original_filename + filenames = config['device_types']['filenames'] rescue {} + filenames.each do |type, regex| + return type if original_filename =~ regex + end + end + return :handset if File.exist?( File.expand_path( File.join(self.conf_dir, "#{self.aliases[self.carrier] || self.carrier}.yml") ) ) :unknown end ## # exif object on default image from exifr gem def exif device_type? unless @exif @exif end ## # The source of the MMS was some sort of mobile or smart phone def is_mobile? self.device_type? != :unknown end ## # Get the temporary directory where media files are written to. def self.tmp_dir @@tmp_dir ||= File.expand_path(File.join(Dir.tmpdir, (ENV['USER'].nil? ? '':ENV['USER']), 'mms2r')) end ## # Set the temporary directory where media files are written to. def self.tmp_dir=(d) @@tmp_dir=d end ## # Get the directory where conf files are stored. def self.conf_dir @@conf_dir ||= File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'conf')) end ## # Set the directory where conf files are stored. def self.conf_dir=(d) @@conf_dir=d end ## # Helper to create a safe directory path element based on the mail message # id. def self.safe_message_id(mid) mid.nil? ? "#{Time.now.to_i}" : mid.gsub(/\$|<|>|@|\./, "") end ## # Returns a default file extension based on a content type def self.default_ext(content_type) if MMS2R::EXT[content_type] MMS2R::EXT[content_type] elsif content_type content_type.split('/').last end end ## # Joins the generic mms2r configuration with the carrier specific # configuration. def self.initialize_config(c) f = File.expand_path(File.join(self.conf_dir(), "mms2r_media.yml")) conf = YAML::load_file(f) conf['ignore'] ||= {} unless conf['ignore'] conf['transform'] = {} unless conf['transform'] conf['number'] = [] unless conf['number'] return conf unless c kinds = ['ignore', 'transform'] kinds.each do |kind| if c[kind] c[kind].each do |type,array| conf[kind][type] = [] unless conf[kind][type] conf[kind][type] += array end end end conf['number'] = c['number'] if c['number'] conf end def log(message, level = :info) @logger.send(level, message) unless @logger.nil? end ## # convenience accessor for self.class.conf_dir def conf_dir self.class.conf_dir end ## # convenience accessor for self.class.conf_dir def tmp_dir self.class.tmp_dir end ## # convenience accessor for self.class.default_ext def default_ext(type) self.class.default_ext(type) end ## # convenience accessor for self.class.safe_message_id def safe_message_id(message_id) self.class.safe_message_id(message_id) end ## # convenience accessor for self.class.initialize_confg def initialize_config(config) self.class.initialize_config(config) end private ## # accessor for the config def config @config end ## # guess content type from filename def type_from_filename(filename) ext = filename.split('.').last ent = MMS2R::EXT.detect{|k,v| v == ext} ent.nil? ? nil : ent.first end ## # used by #default_media and #text to return the biggest attachment type # listed in the types array def attachment(types) # get all the files that are of the major types passed in files = [] types.each do |type| media.keys.find_all{|k| type.include?("/") ? k == type : k.index(type) == 0 }.each do |key| files += media[key] end end return nil if files.empty? # set temp holders file = nil # explicitly declare the file and size size = 0 mime_type = nil #get the largest file files.each do |path| if File.size(path) > size size = File.size(path) file = File.new(path) media.each do |type,_files| mime_type = type if _files.detect{ |_path| _path == path } end end end return nil if file.nil? # These singleton methods implement the interface necessary to be used # as a drop-in replacement for files uploaded with CGI.rb. # This helps if you want to use the files with, for example, # attachment_fu. def file.local_path self.path end def file.original_filename File.basename(self.path) end def file.size File.size(self.path) end # this one is kind of confusing because it needs a closure. class << file self end.send(:define_method, :content_type) { mime_type } file end end end diff --git a/test/fixtures/sprint-blackberry-01.mail b/test/fixtures/sprint-blackberry-01.mail index f0fdad6..0255b13 100644 --- a/test/fixtures/sprint-blackberry-01.mail +++ b/test/fixtures/sprint-blackberry-01.mail @@ -1,536 +1,536 @@ Return-Path: <[email protected]> Delivered-To: unknown Received: from imap.gmail.com (209.85.225.109) by ntk with IMAP4-SSL; 30 Oct 2011 06:10:03 -0000 -Delivered-To: [email protected] +Delivered-To: [email protected] Received: by 10.216.10.213 with SMTP id 63cs4880wev; Sat, 29 Oct 2011 23:07:11 -0700 (PDT) Received: by 10.224.189.7 with SMTP id dc7mr8092483qab.90.1319954829144; Sat, 29 Oct 2011 23:07:09 -0700 (PDT) Received: from snt0-omc2-s31.snt0.hotmail.com (snt0-omc2-s31.snt0.hotmail.com. [65.55.90.106]) by mx.google.com with ESMTP id 12si8277724vci.60.2011.10.29.23.07.08; Sat, 29 Oct 2011 23:07:09 -0700 (PDT) Received-SPF: pass (google.com: domain of [email protected] designates 65.55.90.106 as permitted sender) client-ip=65.55.90.106; Authentication-Results: mx.google.com; spf=pass (google.com: domain of [email protected] designates 65.55.90.106 as permitted sender) [email protected] Received: from SNT121-DS23 ([65.55.90.73]) by snt0-omc2-s31.snt0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); Sat, 29 Oct 2011 23:07:08 -0700 X-Originating-IP: [10.8.209.166] X-Originating-Email: [[email protected]] Message-ID: <[email protected]> Content-Type: multipart/mixed; boundary="_99db4215-8df5-4407-9408-286fd34bd3a9_" MIME-Version: 1.0 From: "tommy tutone " <[email protected]> -To: "Cellphotobot " <[email protected]> +To: [email protected] Date: Sun, 30 Oct 2011 06:07:08 +0000 Subject: Washington-20111030-00056.jpg X-OriginalArrivalTime: 30 Oct 2011 06:07:08.0134 (UTC) FILETIME=[27BFC060:01CC96CA] --_99db4215-8df5-4407-9408-286fd34bd3a9_ Content-Type: text/plain; charset="iso-8859-15" Content-Transfer-Encoding: quoted-printable Sent on the Sprint=AE Now Network from my BlackBerry=AE --_99db4215-8df5-4407-9408-286fd34bd3a9_ Content-Description: =?utf-8?B?V2FzaGluZ3Rvbi0yMDExMTAzMC0wMDA1Ni5qcGc=?= Content-Type: image/jpeg; name="=?utf-8?B?V2FzaGluZ3Rvbi0yMDExMTAzMC0wMDA1Ni5qcGc=?=" Content-Disposition: attachment; filename="=?utf-8?B?V2FzaGluZ3Rvbi0yMDExMTAzMC0wMDA1Ni5qcGc=?=" Content-Transfer-Encoding: base64 /9j/4QI4RXhpZgAASUkqAAgAAAALAA8BAgABAAAAAAAAABABAgABAAAAAAAAABIBAwABAAAAAQAA ABoBBQABAAAAkgAAABsBBQABAAAAmgAAACgBAwABAAAAAgAAADEBAgAWAAAAogAAADIBAgABAAAA AAAAABMCAwABAAAAAQAAAGmHBAABAAAAuAAAACWIBAABAAAAXgEAAAAAAABIAAAAAQAAAEgAAAAB AAAAUmltIEV4aWYgVmVyc2lvbjEuMDBhAAwAmoIFAAEAAABOAQAAAJAHAAQAAAAwMjIwA5ACAAEA AAAAAAAAAZEHAAQAAAABAgMABpIFAAEAAABWAQAACJIDAAEAAAAAAAAACZIDAAEAAAAgAAAAfJIH AAAAAAAAAAAAAaADAAEAAAABAAAAAqADAAEAAAAgAwAAA6ADAAEAAABYAgAAC6QHAAAAAAAAAAAA AAAAAAAAAAABAAAAAAAAAAEAAAALAAAABwAEAAAAMjIwMAEAAgABAAAATgAAAAIABQADAAAA6AEA AAMAAgABAAAAVwAAAAQABQADAAAAAAIAAAUABwABAAAAAAAAAAYABQABAAAAGAIAAAwAAgABAAAA SwAAAA0ABQABAAAAIAIAAA4AAgABAAAAVAAAAA8ABQABAAAAKAIAAAAAAAAnAAAAAQAAAAzEAADo AwAAAAAAAAEAAABWAAAAAQAAADkhAADoAwAAAAAAAAEAAADhAAAAAQAAAAAAAAAAAA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3JF3kYz9DTSJ3dhxlA4HQiiWxK0I8khsHNS oXV0Wp2GgntVtXL5urEHJPODU7aFcysO5BoSa0Icuo3ccEUMnmvuIAWwM9+aN2CS3JDnaAvGOtNv sXHzE5zyfxpPUbXYFGMAmp1LXkTJweaW7L8gY59aTvJ2KWiIifzocbImUrkTHjmtIp2MdL2BeQea V7midmPVcc0raFKQ8Ac+/ajULiquevai/mPoPVAw5qUAbQCR6DrRfQu4vbIouAmR0xjNHKu4PUTH diff --git a/test/test_mms2r_media.rb b/test/test_mms2r_media.rb index 5527789..af7d767 100644 --- a/test/test_mms2r_media.rb +++ b/test/test_mms2r_media.rb @@ -260,592 +260,606 @@ class TestMms2rMedia < Test::Unit::TestCase mms = MMS2R::Media.new(mail) assert_equal '', mms.subject end def test_subject_with_subject_ignored s = 'hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) mms.stubs(:config).returns({'ignore' => {'text/plain' => [s]}}) assert_equal '', mms.subject end def test_subject_with_subject_transformed s = 'Default Subject: hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) mms.stubs(:config).returns( { 'ignore' => {}, 'transform' => {'text/plain' => [[/Default Subject: (.+)/, '\1']]}}) assert_equal 'hello world', mms.subject end def test_attachment_should_return_nil_if_files_for_type_are_not_found mms = MMS2R::Media.new stub_mail mms.stubs(:media).returns({}) assert_nil mms.send(:attachment, ['text']) end def test_attachment_should_return_nil_if_empty_files_are_found mms = MMS2R::Media.new stub_mail mms.stubs(:media).returns({'text/plain' => [Tempfile.new('test')]}) assert_nil mms.send(:attachment, ['text']) end def test_type_from_filename mms = MMS2R::Media.new stub_mail assert_equal 'image/jpeg', mms.send(:type_from_filename, "example.jpg") end def test_type_from_filename_should_be_nil mms = MMS2R::Media.new stub_mail assert_nil mms.send(:type_from_filename, "example.example") end def test_attachment_should_return_duck_typed_file mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") size = File.size(temp_text_file("hello world")) temp_small = temp_text_file("hello") mms.stubs(:media).returns({'text/plain' => [temp_small, temp_big]}) duck_file = mms.send(:attachment, ['text']) assert_not_nil duck_file assert_equal true, File::exist?(duck_file) assert_equal true, File::exist?(temp_big) assert_equal temp_big, duck_file.local_path assert_equal File.basename(temp_big), duck_file.original_filename assert_equal size, duck_file.size assert_equal 'text/plain', duck_file.content_type end def test_empty_body mms = MMS2R::Media.new stub_mail mms.stubs(:default_text).returns(nil) assert_equal "", mms.body end def test_body mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") mms.stubs(:default_text).returns(File.new(temp_big)) body = mms.body assert_equal "hello world", body end def test_body_when_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") mms.stubs(:default_html).returns(File.new(temp_big)) assert_equal "hello world teapot", mms.body end def test_default_text mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'text/plain' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_text.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_text.local_path end def test_default_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") temp_small = temp_text_file("<html><head><title>hello</title></head><body>world<body></html>") mms.stubs(:media).returns({'text/html' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_html.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_html.local_path end def test_default_media mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'image/jpeg' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_media.local_path end def test_default_media_treats_image_and_video_equally mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big_image = temp_text_file("hello world") temp_small_image = temp_text_file("hello") temp_big_video = temp_text_file("hello world again") temp_small_video = temp_text_file("hello again") mms.stubs(:media).returns({'image/jpeg' => [temp_small_image, temp_big_image], 'video/mpeg' => [temp_small_video, temp_big_video], }) assert_equal temp_big_video, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big_video, mms.default_media.local_path end #def test_default_media_treats_gif_and_jpg_equally # #it doesn't matter that these are text files, we just need say they are images # temp_big = temp_text_file("hello world") # temp_small = temp_text_file("hello") # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/jpeg' => [temp_big], 'image/gif' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/gif' => [temp_big], 'image/jpg' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path #end def test_purge mms = MMS2R::Media.new stub_mail mms.purge assert_equal false, File.exist?(mms.media_dir) end def test_ignore_media_by_filename_equality name = 'foo.txt' type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [name]}}) # type is not in the ingore part = stub(:body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and filename are in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal true, mms.ignore_media?(type, part) # type but not file name are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_filename name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'foo.txt', mms.filename?(part) end def test_long_filename name = 'x' * 300 + '.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'x' * 251 + '.txt', mms.filename?(part) end def test_filename_when_file_extension_missing_part name = 'foo' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.txt', mms.filename?(part) name = 'foo.janky' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.janky.txt', mms.filename?(part) end def test_ignore_media_by_filename_regexp name = 'foo.txt' regexp = /foo\.txt/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [regexp, 'nil.txt']}}) # type is not in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the filename are in the ingore part = stub(:filename => name) assert_equal true, mms.ignore_media?(type, part) # type but not regexp for filename are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_by_regexp_on_file_content name = 'foo.txt' content = "aaaaaaahello worldbbbbbbbbb" regexp = /.*Hello World.*/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => ['nil.txt', regexp]}}) part = stub(:filename => name, :body => Mail::Body.new(content)) # type is not in the ingore assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the content are in the ingore assert_equal true, mms.ignore_media?(type, part) # type but not regexp for content are in the ignore part = stub(:filename => name, :body => Mail::Body.new('no teapots')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_when_file_content_is_empty mms = MMS2R::Media.new stub_mail # there is no conf but the part's body is empty part = stub(:filename => 'foo.txt', :body => Mail::Body.new) assert_equal true, mms.ignore_media?('text/test', part) # there is no conf but the part's body is white space part = stub(:filename => 'foo.txt', :body => Mail::Body.new("\t\n\t\n ")) assert_equal true, mms.ignore_media?('text/test', part) end def test_add_file mail = stub_mail mail.stubs(:from).returns(['[email protected]']) mms = MMS2R::Media.new(mail) mms.stubs(:media).returns({}) assert_nil mms.media['text/html'] mms.add_file('text/html', '/tmp/foo.html') assert_equal ['/tmp/foo.html'], mms.media['text/html'] mms.add_file('text/html', '/tmp/bar.html') assert_equal ['/tmp/foo.html', '/tmp/bar.html'], mms.media['text/html'] end def test_temp_file name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal name, File.basename(mms.temp_file(part)) end def test_process_media_for_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', 'hello world']) result = mms.process_media(part) assert_equal 'text/plain', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_with_empty_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', '']) assert_equal ['text/plain', nil], mms.process_media(part) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_application_smil name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['application/smil', nil]) part = stub(:filename => name, :content_type => 'application/smil', :part_type? => 'application/smil', :main_type => 'application') assert_equal ['application/smil', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['application/smil', 'hello world']) result = mms.process_media(part) assert_equal 'application/smil', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_application_octet_stream_when_image name = 'fake.jpg' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'application/octet-stream', :part_type? => 'application/octet-stream', :body => Mail::Body.new("data"), :main_type => 'application') result = mms.process_media(part) assert_equal 'image/jpeg', result.first assert_match(/fake\.jpg$/, result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_all_other_media name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :main_type => 'faux', :part_type? => 'faux/text', :body => Mail::Body.new(nil)) assert_equal ['faux/text', nil], mms.process_media(part) part = stub(:filename => name, :main_type => 'faux', :part_type? => 'faux/text', :body => Mail::Body.new('hello world')) result = mms.process_media(part) assert_equal 'faux/text', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process mms = MMS2R::Media.new stub_mail assert_equal 1, mms.media.size assert_not_nil mms.media['text/plain'] assert_equal 1, mms.media['text/plain'].size assert_equal true, File.exist?(mms.media['text/plain'].first) assert_equal 1, File.size(mms.media['text/plain'].first) mms.purge end def test_process_with_multipart_double_parts mail = mail('apple-double-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_not_nil mms.media['application/applefile'] assert_equal 1, mms.media['application/applefile'].size assert_not_nil mms.media['image/jpeg'] assert_equal 1, mms.media['image/jpeg'].size assert_match(/DSCN1715\.jpg$/, mms.media['image/jpeg'].first) assert_file_size mms.media['image/jpeg'].first, 337 mms.purge end def test_process_with_multipart_alternative_parts mail = stub_mail plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new('a'), :main_type => 'text') plain.stubs(:multipart?).at_least_once.returns(false) html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new('a'), :main_type => 'text') html.stubs(:multipart?).at_least_once.returns(false) multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) multi.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:parts).at_least_once.returns([multi]) # the multipart/alternative should get flattend to text and html mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_equal 2, mms.media.size assert_not_nil mms.media['text/plain'] assert_not_nil mms.media['text/html'] assert_equal 1, mms.media['text/plain'].size assert_equal 1, mms.media['text/html'].size assert_equal 'message.txt', File.basename(mms.media['text/plain'].first) assert_equal 'message.html', File.basename(mms.media['text/html'].first) assert_equal true, File.exist?(mms.media['text/plain'].first) assert_equal true, File.exist?(mms.media['text/html'].first) assert_equal 1, File.size(mms.media['text/plain'].first) assert_equal 1, File.size(mms.media['text/html'].first) mms.purge end def test_process_when_media_is_ignored mail = stub_mail plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new(''), :main_type => 'text') plain.stubs(:multipart?).at_least_once.returns(false) html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new(''), :main_type => 'text') html.stubs(:multipart?).at_least_once.returns(false) multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) multi.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:parts).at_least_once.returns([multi]) mms = MMS2R::Media.new(mail, :process => :lazy) mms.stubs(:config).returns({'ignore' => {'text/plain' => ['message.txt'], 'text/html' => ['message.html']}}) assert_nothing_raised { mms.process } # the multipart/alternative should get flattend to text and html and then # what's flattened is ignored assert_equal 0, mms.media.size mms.purge end def test_process_when_yielding_to_a_block mail = stub_mail plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new('a'), :main_type => 'text') plain.stubs(:multipart?).at_least_once.returns(false) html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new('b'), :main_type => 'text') html.stubs(:multipart?).at_least_once.returns(false) multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) multi.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:parts).at_least_once.returns([multi]) # the multipart/alternative should get flattend to text and html mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size mms.process do |type, files| assert_equal 1, files.size assert_equal true, type == 'text/plain' || type == 'text/html' assert_equal true, File.basename(files.first) == 'message.txt' || File.basename(files.first) == 'message.html' assert_equal true, File::exist?(files.first) end mms.purge end def test_domain_from_return_path mail = mock() mail.expects(:from).at_least_once.returns([]) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'null.example.com', domain end def test_domain_from_from mail = mock() mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'null.example.com', domain end def test_domain_from_from_yaml f = File.join(MMS2R::Media.conf_dir, 'from.yml') YAML.expects(:load_file).once.with(f).returns(['example.com']) mail = mock() mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'example.com', domain end def test_unknown_device_type mail = mail('generic.mail') mms = MMS2R::Media.new(mail) assert_equal :unknown, mms.device_type? assert_equal false, mms.is_mobile? end def test_iphone_device_type_by_header iphones = ['att-iphone-01.mail', 'iphone-image-01.mail'] iphones.each do |iphone| mail = mail(iphone) mms = MMS2R::Media.new(mail) assert_equal :iphone, mms.device_type?, "fixture #{iphone} was not a iphone" assert_equal true, mms.is_mobile? end end def test_exif mail = smart_phone_mock mms = MMS2R::Media.new(mail) assert_equal 'iPhone', mms.exif.model end def test_iphone_device_type_by_exif mail = smart_phone_mock mms = MMS2R::Media.new(mail) assert_equal :iphone, mms.device_type? assert_equal true, mms.is_mobile? end def test_faux_tiff_iphone_device_type_by_exif - mail = smart_phone_mock('Apple', 'iPhone', nil, jpeg = false) + mail = smart_phone_mock('Apple', 'iPhone', nil, nil, jpeg = false) mms = MMS2R::Media.new(mail) assert_equal :iphone, mms.device_type? assert_equal true, mms.is_mobile? end + def test_iphone_device_type_by_filename_jpg + mail = smart_phone_mock('Hipstamatic', '201') + mms = MMS2R::Media.new(mail) + assert_equal :apple, mms.device_type? + assert_equal true, mms.is_mobile? + end + + def test_iphone_device_type_by_filename_png + mail = mail('iphone-image-02.mail') + mms = MMS2R::Media.new(mail) + assert_equal true, mms.is_mobile? + assert_equal :iphone, mms.device_type? + end + def test_blackberry_device_type_by_exif_make_model mail = smart_phone_mock('Research In Motion', 'BlackBerry') mms = MMS2R::Media.new(mail) assert_equal :blackberry, mms.device_type? assert_equal true, mms.is_mobile? end def test_blackberry_device_type_by_exif_software mail = smart_phone_mock(nil, nil, "Rim Exif Version1.00a") mms = MMS2R::Media.new(mail) assert_equal :blackberry, mms.device_type? assert_equal true, mms.is_mobile? end def test_dash_device_type_by_exif mail = smart_phone_mock('T-Mobile Dash', 'T-Mobile Dash') mms = MMS2R::Media.new(mail) assert_equal :dash, mms.device_type? assert_equal true, mms.is_mobile? end def test_droid_device_type_by_exif mail = smart_phone_mock('Motorola', 'Droid') mms = MMS2R::Media.new(mail) assert_equal :droid, mms.device_type? assert_equal true, mms.is_mobile? end def test_htc_eris_device_type_by_exif mail = smart_phone_mock('HTC', 'Eris') mms = MMS2R::Media.new(mail) assert_equal :htc, mms.device_type? assert_equal true, mms.is_mobile? end def test_htc_hero_device_type_by_exif mail = smart_phone_mock('HTC', 'HERO200') mms = MMS2R::Media.new(mail) assert_equal :htc, mms.device_type? assert_equal true, mms.is_mobile? end def test_handsets_by_exif handsets = YAML.load_file(fixture('handsets.yml')) handsets.each do |handset| mail = smart_phone_mock(handset.first, handset.last) mms = MMS2R::Media.new(mail) assert_equal true, mms.is_mobile?, "mms with make #{mms.exif.make}, and model #{mms.exif.model}, should be considered a mobile device" end end def test_blackberry_device_type berries = ['att-blackberry.mail', 'suncom-blackberry.mail', 'tmobile-blackberry-02.mail', 'tmobile-blackberry.mail', 'tmo.blackberry.net-image-01.mail', 'verizon-blackberry.mail', 'verizon-blackberry.mail'] berries.each do |berry| mms = MMS2R::Media.new(mail(berry)) assert_equal :blackberry, mms.device_type?, "fixture #{berry} was not a blackberrry" assert_equal true, mms.is_mobile? end end def test_handset_device_type mail = mail('att-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal :handset, mms.device_type? assert_equal true, mms.is_mobile? end end
monde/mms2r
88a105086a494a1a8a73a53b77c6446a36ae6428
Also test correct device type is returned.
diff --git a/test/test_sprint.rb b/test/test_sprint.rb index 8d3d535..bd9737b 100644 --- a/test/test_sprint.rb +++ b/test/test_sprint.rb @@ -1,17 +1,18 @@ require "test_helper" class Testprint < Test::Unit::TestCase include MMS2R::TestHelper def test_sprint_blackberry_01 # Rim Exif Version1.00a mail = mail('sprint-blackberry-01.mail') mms = MMS2R::Media.new(mail) assert_equal true, mms.is_mobile? + assert_equal :blackberry, mms.device_type? assert_equal "", mms.body assert_equal 1, mms.media.size assert_equal 1, mms.media['image/jpeg'].size mms.purge end end
monde/mms2r
98b1e3e60bbae623a4ff85303344646af29b182e
Identify if the image is from a mobile device by its software listed in the exif information.
diff --git a/conf/mms2r_media.yml b/conf/mms2r_media.yml index a4341d7..9be7a75 100644 --- a/conf/mms2r_media.yml +++ b/conf/mms2r_media.yml @@ -1,63 +1,65 @@ --- ignore: text/plain: - !ruby/regexp /^\(no subject\)$/i - !ruby/regexp /\ASent via BlackBerry (from|by) .*$/im - !ruby/regexp /\ASent from my Verizon Wireless BlackBerry$/im - !ruby/regexp /\ASent from (my|your) iPhone.?$/im - !ruby/regexp /\ASent on the Sprint.* Now Network.*$/im multipart/mixed: - !ruby/regexp "/^Attachment: /i" transform: text/plain: - - !ruby/regexp /\A(.*?)Sent via BlackBerry (from|by) .*$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from my Verizon Wireless BlackBerry$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent from (my|your) iPhone.?$/im - "\\1" - - !ruby/regexp /\A(.*?)\s+image\/jpeg$/im - "\\1" - - !ruby/regexp /\A(.*?)Sent on the Sprint.* Now Network.*$/im - "\\1" device_types: headers: x-mailer: :iphone: !ruby/regexp /iPhone Mail/i :blackberry: !ruby/regexp /Palm webOS/i mime-version: :iphone: !ruby/regexp /iPhone Mail/i x-rim-org-msg-ref-id: :blackberry: !ruby/regexp /.+/ # TODO do something about the assortment of camera models that have # been seen: # 1.3 Megapixel, 2.0 Megapixel, BlackBerry, CU920, G'z One TYPE-S, # Hermes, iPhone, LG8700, LSI_S5K4AAFA, Micron MT9M113 1.3MP YUV, # Motorola Phone, Omni_vision-9650, Pre, # Seoul Electronics & Telecom SIM120B 1.3M, SGH-T729, SGH-T819, # SPH-M540, SPH-M800, SYSTEMLSI S5K4BAFB 2.0 MP, VX-9700 # # NOTE: These model strings are stored in the exif model header of an image file # created and sent by the device, the regex is used by mms2r to detect the # model string models: :blackberry: !ruby/regexp /BlackBerry/i :dash: !ruby/regexp /T-Mobile Dash/i :droid: !ruby/regexp /Droid/i :htc: !ruby/regexp /HTC|Eris|HERO200/i :iphone: !ruby/regexp /iPhone/i makes: :apple: !ruby/regexp /^Apple$/i :casio: !ruby/regexp /^CASIO$/i :dash: !ruby/regexp /T-Mobile Dash/i :google: !ruby/regexp /^google$/i :htc: !ruby/regexp /^HTC/i :lge: !ruby/regexp /^(LG|CX87BL05)/i :motorola: !ruby/regexp /^Motorola/i :pantech: !ruby/regexp /^PANTECH$/i :qualcomm: !ruby/regexp /^MSM6/i :research_in_motion: !ruby/regexp /^(RIM|Research In Motion)$/i :samsung: !ruby/regexp /^(SAMSUNG|ES.M800|M6550B-SAM-4480)/i :seoul_electronics: !ruby/regexp /^ISUS0/i :sprint: !ruby/regexp /^Sprint$/i :utstarcom: !ruby/regexp /^T1A_UC1.88$/i + software: + :blackberry: !ruby/regexp /^Rim Exif/i diff --git a/dev_tools/anonymizer.rb b/dev_tools/anonymizer.rb index ba6b8b6..82e00fa 100755 --- a/dev_tools/anonymizer.rb +++ b/dev_tools/anonymizer.rb @@ -1,20 +1,18 @@ #! /usr/bin/env ruby if ARGV.size != 3 puts "Usage: anonymizer.rb message_file phone_number email_address" exit(1) end message_file = ARGV[0] phone_number = ARGV[1] email_address = ARGV[2] message = File.read(message_file) message.gsub!(phone_number, '2068675309') message.gsub!(email_address, '[email protected]') out = File.open(message_file, "wb") out.puts message out.close - - diff --git a/lib/mms2r/media.rb b/lib/mms2r/media.rb index 4a15d7c..625d649 100644 --- a/lib/mms2r/media.rb +++ b/lib/mms2r/media.rb @@ -56,740 +56,744 @@ # YAML file named by combining the domain name of the MMS sender plus a .yml # extension. For instance the configuration of senders from AT&T's cellular # service with a Sender pattern of [email protected] have a configuration # named conf/mms.att.net.yml # # The YAML configuration contains a Hash with instructions for determining what # is content generated by the user and what is content inserted by the carrier. # # The root hash itself has two hashes under the keys 'ignore' and 'transform', # and an array under the 'number' key. # Each hash is itself keyed by mime-type. The value pointed to by the mime-type # key is an array. The ignore arrays are first inspected as regular expressions # else are used as a equality for a string filename. Ignores # work by filename # for the multi-part of the MMS that is being inspected. The array pointed to # by the 'number' key represents an alternate mail header where the sender's # number can be found with a regular expression and replacement value for a # gsub. # # The transform arrays are themselves an array of two element arrays. The elements # are regexp parameters for gsub. # # Ignore instructions are honored first then transform instructions. In the sample, # masthead.jpg is ignored as a regular expression, and spacer.gif is ignored as a # filename comparison. The transform has a match and a replacement, see the gsub # documentation for more information about match and replace. # # -- # ignore: # image/jpeg: # - /^masthead.jpg$/i # image/gif: # - spacer.gif # text/plain: # - /\AThis message was sent using PIX-FLIX Messaging service from .*/m # transform: # text/plain: # - - /\A(.+?)\s+This message was sent using PIX-FLIX Messaging .*/m # - "\1" # number: # - from # - /^([^\s]+)\s.*/ # - "\1" # # Carriers often provide their services under many different domain names. # The conf/aliases.yml is a YAML file with a hash that maps alternative or # legacy carrier names to the most common name of their service. For example # in terms of MMS2R txt.att.net is an alias for mms.att.net. Therefore when # an MMS with a Sender of txt.att.net is processed MMS2R will use the # mms.att.net configuration to process the message. module MMS2R class MMS2R::Media # Pass off everything we don't do to the Mail object # TODO: refactor to explicit addition a la http://blog.jayfields.com/2008/02/ruby-replace-methodmissing-with-dynamic.html def method_missing method, *args, &block mail.send method, *args, &block end ## # Mail object that the media files were derived from. attr_reader :mail ## # media returns the hash of media. The media hash is keyed by mime-type # such as 'text/plain' and the value mapped to the key is an array of # media that are of that type. attr_reader :media ## # Carrier is the domain name of the carrier. If the carrier is not known # the carrier will be set to 'mms2r.media' attr_reader :carrier ## # Base working dir where media for a unique mms message are dropped attr_reader :media_dir ## # Determine if return-path or from is going to be used to desiginate the # origin carrier. If the domain in the From header is listed in # conf/from.yaml then that is the carrier domain. Else if there is a # Return-Path header its address's domain is the carrier doamin, else # use From header's address domain. def self.domain(mail) return_path = case when mail.return_path mail.return_path ? mail.return_path.split('@').last : '' else '' end from_domain = case when mail.from && mail.from.first mail.from.first.split('@').last else '' end f = File.expand_path(File.join(self.conf_dir(), "from.yml")) from = YAML::load_file(f) ret = case when from.include?(from_domain) from_domain when return_path.present? return_path else from_domain end ret end ## # Initialize a new MMS2R::Media comprised of a mail. # # Specify options to initialize with: # :logger => some_logger for logging # :process => :lazy, for non-greedy processing upon initialization # # #process will have to be called explicitly if the lazy process option # is chosen. def initialize(mail, opts={}) @mail = mail @logger = opts[:logger] log("#{self.class} created", :info) @carrier = self.class.domain(mail) @dir_count = 0 sha = Digest::SHA1.hexdigest("#{@carrier}-#{Time.now.to_i}-#{rand}") @media_dir = File.expand_path( File.join(self.tmp_dir(), "#{self.safe_message_id(@mail.message_id)}_#{sha}")) @media = {} @was_processed = false @number = nil @subject = nil @body = nil @exif = nil @default_media = nil @default_text = nil @default_html = nil f = File.expand_path(File.join(self.conf_dir(), "aliases.yml")) @aliases = YAML::load_file(f) conf = "#{@aliases[@carrier] || @carrier}.yml" f = File.expand_path(File.join(self.conf_dir(), conf)) c = File.exist?(f) ? YAML::load_file(f) : {} @config = self.class.initialize_config(c) processor_module = MMS2R::CARRIERS[@carrier] extend processor_module if processor_module lazy = (opts[:process] == :lazy) rescue false self.process() unless lazy end ## # Get the phone number associated with this MMS if it exists. The value # returned is simplistic, it is just the user name of the from address # before the @ symbol. Validation of the number is left to you. Most # carriers are using the real phone number as the username. def number unless @number params = config['number'] if params && params.any? && (header = mail.header[params[0]]) @number = header.to_s.gsub(params[1], params[2]) end if @number.nil? || @number.blank? @number = mail.from.first.split(/@|\//).first rescue "" end end @number end ## # Return the Subject for this message, returns "" for default carrier # subject such as 'Multimedia message' for ATT&T carrier. def subject unless @subject subject = mail.subject.strip rescue "" ignores = config['ignore']['text/plain'] if ignores && ignores.detect{|s| s == subject} @subject = "" else @subject = transform_text('text/plain', subject).last end end @subject end # Convenience method that returns a string including all the text of the # default text/plain file found. If the plain text is blank then it returns # stripped down version of the title and body of default text/html. Returns # empty string if no body text is found. def body text_file = default_text @body = text_file ? IO.readlines(text_file.path).join.strip : "" if @body.blank? && html_file = default_html html = Nokogiri::HTML(IO.read(html_file.path)) @body = (html.xpath("//head/title").map(&:text) + html.xpath("//body/*").map(&:text)).join(" ") end @body end # Returns a File with the most likely candidate for the user-submitted # media. Given that most MMS messages only have one file attached, this # method will try to return that file. Singleton methods are added to # the File object so it can be used in place of a CGI upload (local_path, # original_filename, size, and content_type) such as in conjunction with # AttachementFu. The largest file found in terms of bytes is returned. # # Returns nil if there are not any video or image Files found. def default_media @default_media ||= attachment(['video', 'image', 'application', 'text']) end # Returns a File with the most likely candidate that is text, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_text @default_text ||= attachment(['text/plain']) end # Returns a File with the most likely candidate that is html, or nil # otherwise. It also adds singleton methods to the File object so it can be # used in place of a CGI upload (local_path, original_filename, size, and # content_type) such as in conjunction with AttachmentFu. The largest file # found in terms of bytes is returned. # # Returns nil if there are not any text Files found def default_html @default_html ||= attachment(['text/html']) end ## # process is a template method and collects all the media in a MMS. # Override helper methods to this template to clean out advertising and/or # ignore media that are advertising. This method should not be overridden # unless there is an extreme special case in processing the media of a MMS # (like Sprint) # # Helper methods for the process template: # * ignore_media? -- true if the media contained in a part should be ignored. # * process_media -- retrieves media to temporary file, returns path to file. # * transform_text -- called by process_media, strips out advertising. # * temp_file -- creates a temporary filepath based on information from the part. # # Block support: # Call process() with a block to automatically iterate through media. # For example, to process and receive only media of video type: # mms.process do |media_type, file| # results << file if media_type =~ /video/ # end # # note: purge must be explicitly called to remove the media files # mms2r extracts from an mms message. def process() # :yields: media_type, file unless @was_processed log("#{self.class} processing", :info) parts = mail.multipart? ? mail.parts : [mail] # Double check for multipart/related, if it exists replace it with its # children parts. Do this twice as multipart/alternative can have # children and we want to fold everything down for i in 1..2 flat = [] parts.each do |p| if p.multipart? p.parts.each {|mp| flat << mp } else flat << p end end parts = flat.dup end # get to work parts.each do |p| t = p.part_type? unless ignore_media?(t,p) t,f = process_media(p) add_file(t,f) unless t.nil? || f.nil? end end @was_processed = true end # when process acts upon a block if block_given? media.each do |k, v| yield(k, v) end end end ## # Helper for process template method to determine if media contained in a # part should be ignored. Producers should override this method to return # true for media such as images that are advertising, carrier logos, etc. # See the ignore section in the discussion of the built-in configuration. def ignore_media?(type, part) ignores = config['ignore'][type] || [] ignore = ignores.detect{ |test| filename?(part) == test} ignore ||= ignores.detect{ |test| filename?(part) =~ test if test.is_a?(Regexp) } ignore ||= ignores.detect{ |test| part.body.decoded.strip =~ test if test.is_a?(Regexp) } ignore ||= (part.body.decoded.strip.size == 0 ? true : nil) ignore.nil? ? false : true end ## # Helper for process template method to decode the part based on its type # and write its content to a temporary file. Returns path to temporary # file that holds the content. Parts with a main type of text will have # their contents transformed with a call to transform_text # # Producers should only override this method if the parts of the MMS need # special treatment besides what is expected for a normal mime part (like # Sprint). # # Returns a tuple of content type, file path def process_media(part) # Mail body auto-magically decodes quoted # printable for text/html type. file = temp_file(part) if part.part_type? =~ /^text\// || part.part_type? == 'application/smil' type, content = transform_text_part(part) mode = 'wb' else if part.part_type? == 'application/octet-stream' type = type_from_filename(filename?(part)) else type = part.part_type? end content = part.body.decoded mode = 'wb' # open with binary bit for Windows for non text end return type, nil if content.nil? || content.empty? log("#{self.class} writing file #{file}", :info) File.open(file, mode){ |f| f.write(content) } return type, file end ## # Helper for process_media template method to transform text. # See the transform section in the discussion of the built-in # configuration. def transform_text(type, text, original_encoding = 'ISO-8859-1') return type, text if !config['transform'] || !(transforms = config['transform'][type]) if RUBY_VERSION < "1.9" #convert to UTF-8 begin c = Iconv.new('UTF-8', original_encoding ) utf_t = c.iconv(text) rescue Exception => e utf_t = text end else utf_t = text.encoding == "ASCII-8BIT" ? text.force_encoding("ISO-8859-1").encode("UTF-8") : text end transforms.each do |transform| next unless transform.size == 2 p = transform.first r = transform.last utf_t = utf_t.gsub(p, r) rescue utf_t end return type, utf_t end ## # Helper for process_media template method to transform text. def transform_text_part(part) type = part.part_type? text = part.body.decoded.strip transform_text(type, text) end ## # Helper for process template method to name a temporary filepath based on # information in the part. This version attempts to honor the name of the # media as labeled in the part header and creates a unique temporary # directory for writing the file so filename collision does not occur. # Consumers of this method expect the directory structure to the file # exists, if the method is overridden it is mandatory that this behavior is # retained. def temp_file(part) file_name = filename?(part) File.expand_path(File.join(msg_tmp_dir(),File.basename(file_name))) end ## # Purges the unique MMS2R::Media.media_dir directory created # for this producer and all of the media that it contains. def purge() log("#{self.class} purging #{@media_dir} and all its contents", :info) FileUtils.rm_rf(@media_dir) end ## # Helper to add a file to the media hash. def add_file(type, file) media[type] = [] unless media[type] media[type] << file end ## # Helper to temp_file to create a unique temporary directory that is a # child of tmp_dir This version is based on the message_id of the mail. def msg_tmp_dir() @dir_count += 1 dir = File.expand_path(File.join(@media_dir, "#{@dir_count}")) FileUtils.mkdir_p(dir) dir end ## # returns a filename declared for a part, or a default if its not defined def filename?(part) name = part.filename if (name.nil? || name.empty?) if part.content_id && (matched = /^<(.+)>$/.match(part.content_id)) name = matched[1] else name = "#{Time.now.to_f}.#{self.default_ext(part.part_type?)}" end end # FIXME FWIW, janky look for dot extension 1 to 4 chars long name = (name =~ /\..{1,4}$/ ? name : "#{name}.#{self.default_ext(part.part_type?)}").strip # handle excessively large filenames if name.size > 255 ext = File.extname(name) base = File.basename(name, ext) name = "#{base[0, 255 - ext.size]}#{ext}" end name end def aliases @aliases end ## # Best guess of the mobile device type. Simple heuristics thus far by # inspecting mail headers and jpeg/tiff exif metadata. # Smart phone types are # :iphone :blackberry :dash :droid # If the message is from a carrier known to MMS2R, and not a smart phone # its type is returned as :handset # Otherwise device type is :unknown def device_type? file = attachment(['image']) if file original = file.original_filename @exif = case original when /\.je?pg$/i EXIFR::JPEG.new(file) when /\.tiff?$/i EXIFR::TIFF.new(file) end if @exif models = config['device_types']['models'] rescue {} models.each do |model, regex| return model if @exif.model =~ regex end makes = config['device_types']['makes'] rescue {} makes.each do |make, regex| return make if @exif.make =~ regex end + softwares = config['device_types']['software'] rescue {} + softwares.each do |software, regex| + return software if @exif.software =~ regex + end end end headers = config['device_types']['headers'] rescue {} headers.keys.each do |header| if mail.header[header.downcase] # headers[header] refers to a hash of smart phone types with regex values # that if they match, the header signals the type should be returned headers[header].each do |type, regex| return type if mail.header[header.downcase].decoded =~ regex end end end return :handset if File.exist?( File.expand_path( File.join(self.conf_dir, "#{self.aliases[self.carrier] || self.carrier}.yml") ) ) :unknown end ## # exif object on default image from exifr gem def exif device_type? unless @exif @exif end ## # The source of the MMS was some sort of mobile or smart phone def is_mobile? self.device_type? != :unknown end ## # Get the temporary directory where media files are written to. def self.tmp_dir @@tmp_dir ||= File.expand_path(File.join(Dir.tmpdir, (ENV['USER'].nil? ? '':ENV['USER']), 'mms2r')) end ## # Set the temporary directory where media files are written to. def self.tmp_dir=(d) @@tmp_dir=d end ## # Get the directory where conf files are stored. def self.conf_dir @@conf_dir ||= File.expand_path(File.join(File.dirname(__FILE__), '..', '..', 'conf')) end ## # Set the directory where conf files are stored. def self.conf_dir=(d) @@conf_dir=d end ## # Helper to create a safe directory path element based on the mail message # id. def self.safe_message_id(mid) mid.nil? ? "#{Time.now.to_i}" : mid.gsub(/\$|<|>|@|\./, "") end ## # Returns a default file extension based on a content type def self.default_ext(content_type) if MMS2R::EXT[content_type] MMS2R::EXT[content_type] elsif content_type content_type.split('/').last end end ## # Joins the generic mms2r configuration with the carrier specific # configuration. def self.initialize_config(c) f = File.expand_path(File.join(self.conf_dir(), "mms2r_media.yml")) conf = YAML::load_file(f) conf['ignore'] ||= {} unless conf['ignore'] conf['transform'] = {} unless conf['transform'] conf['number'] = [] unless conf['number'] return conf unless c kinds = ['ignore', 'transform'] kinds.each do |kind| if c[kind] c[kind].each do |type,array| conf[kind][type] = [] unless conf[kind][type] conf[kind][type] += array end end end conf['number'] = c['number'] if c['number'] conf end def log(message, level = :info) @logger.send(level, message) unless @logger.nil? end ## # convenience accessor for self.class.conf_dir def conf_dir self.class.conf_dir end ## # convenience accessor for self.class.conf_dir def tmp_dir self.class.tmp_dir end ## # convenience accessor for self.class.default_ext def default_ext(type) self.class.default_ext(type) end ## # convenience accessor for self.class.safe_message_id def safe_message_id(message_id) self.class.safe_message_id(message_id) end ## # convenience accessor for self.class.initialize_confg def initialize_config(config) self.class.initialize_config(config) end private ## # accessor for the config def config @config end ## # guess content type from filename def type_from_filename(filename) ext = filename.split('.').last ent = MMS2R::EXT.detect{|k,v| v == ext} ent.nil? ? nil : ent.first end ## # used by #default_media and #text to return the biggest attachment type # listed in the types array def attachment(types) # get all the files that are of the major types passed in files = [] types.each do |type| media.keys.find_all{|k| type.include?("/") ? k == type : k.index(type) == 0 }.each do |key| files += media[key] end end return nil if files.empty? # set temp holders file = nil # explicitly declare the file and size size = 0 mime_type = nil #get the largest file files.each do |path| if File.size(path) > size size = File.size(path) file = File.new(path) media.each do |type,_files| mime_type = type if _files.detect{ |_path| _path == path } end end end return nil if file.nil? # These singleton methods implement the interface necessary to be used # as a drop-in replacement for files uploaded with CGI.rb. # This helps if you want to use the files with, for example, # attachment_fu. def file.local_path self.path end def file.original_filename File.basename(self.path) end def file.size File.size(self.path) end # this one is kind of confusing because it needs a closure. class << file self end.send(:define_method, :content_type) { mime_type } file end end end diff --git a/test/fixtures/sprint-blackberry-01.mail b/test/fixtures/sprint-blackberry-01.mail new file mode 100644 index 0000000..f0fdad6 --- /dev/null +++ b/test/fixtures/sprint-blackberry-01.mail @@ -0,0 +1,1644 @@ +Return-Path: <[email protected]> +Delivered-To: unknown +Received: from imap.gmail.com (209.85.225.109) by ntk with IMAP4-SSL; 30 Oct + 2011 06:10:03 -0000 +Delivered-To: [email protected] +Received: by 10.216.10.213 with SMTP id 63cs4880wev; + Sat, 29 Oct 2011 23:07:11 -0700 (PDT) +Received: by 10.224.189.7 with SMTP id dc7mr8092483qab.90.1319954829144; + Sat, 29 Oct 2011 23:07:09 -0700 (PDT) +Received: from snt0-omc2-s31.snt0.hotmail.com (snt0-omc2-s31.snt0.hotmail.com. [65.55.90.106]) + by mx.google.com with ESMTP id 12si8277724vci.60.2011.10.29.23.07.08; + Sat, 29 Oct 2011 23:07:09 -0700 (PDT) +Received-SPF: pass (google.com: domain of [email protected] designates 65.55.90.106 as permitted sender) client-ip=65.55.90.106; +Authentication-Results: mx.google.com; spf=pass (google.com: domain of [email protected] designates 65.55.90.106 as permitted sender) [email protected] +Received: from SNT121-DS23 ([65.55.90.73]) by snt0-omc2-s31.snt0.hotmail.com with Microsoft SMTPSVC(6.0.3790.4675); + Sat, 29 Oct 2011 23:07:08 -0700 +X-Originating-IP: [10.8.209.166] +X-Originating-Email: [[email protected]] +Message-ID: <[email protected]> +Content-Type: multipart/mixed; + boundary="_99db4215-8df5-4407-9408-286fd34bd3a9_" +MIME-Version: 1.0 +From: "tommy tutone " <[email protected]> +To: "Cellphotobot " <[email protected]> +Date: Sun, 30 Oct 2011 06:07:08 +0000 +Subject: Washington-20111030-00056.jpg +X-OriginalArrivalTime: 30 Oct 2011 06:07:08.0134 (UTC) FILETIME=[27BFC060:01CC96CA] + +--_99db4215-8df5-4407-9408-286fd34bd3a9_ +Content-Type: text/plain; charset="iso-8859-15" +Content-Transfer-Encoding: quoted-printable + +Sent on the Sprint=AE Now Network from my BlackBerry=AE + + +--_99db4215-8df5-4407-9408-286fd34bd3a9_ +Content-Description: =?utf-8?B?V2FzaGluZ3Rvbi0yMDExMTAzMC0wMDA1Ni5qcGc=?= +Content-Type: image/jpeg; + name="=?utf-8?B?V2FzaGluZ3Rvbi0yMDExMTAzMC0wMDA1Ni5qcGc=?=" +Content-Disposition: attachment; + filename="=?utf-8?B?V2FzaGluZ3Rvbi0yMDExMTAzMC0wMDA1Ni5qcGc=?=" +Content-Transfer-Encoding: base64 + +/9j/4QI4RXhpZgAASUkqAAgAAAALAA8BAgABAAAAAAAAABABAgABAAAAAAAAABIBAwABAAAAAQAA +ABoBBQABAAAAkgAAABsBBQABAAAAmgAAACgBAwABAAAAAgAAADEBAgAWAAAAogAAADIBAgABAAAA +AAAAABMCAwABAAAAAQAAAGmHBAABAAAAuAAAACWIBAABAAAAXgEAAAAAAABIAAAAAQAAAEgAAAAB +AAAAUmltIEV4aWYgVmVyc2lvbjEuMDBhAAwAmoIFAAEAAABOAQAAAJAHAAQAAAAwMjIwA5ACAAEA +AAAAAAAAAZEHAAQAAAABAgMABpIFAAEAAABWAQAACJIDAAEAAAAAAAAACZIDAAEAAAAgAAAAfJIH +AAAAAAAAAAAAAaADAAEAAAABAAAAAqADAAEAAAAgAwAAA6ADAAEAAABYAgAAC6QHAAAAAAAAAAAA +AAAAAAAAAAABAAAAAAAAAAEAAAALAAAABwAEAAAAMjIwMAEAAgABAAAATgAAAAIABQADAAAA6AEA +AAMAAgABAAAAVwAAAAQABQADAAAAAAIAAAUABwABAAAAAAAAAAYABQABAAAAGAIAAAwAAgABAAAA +SwAAAA0ABQABAAAAIAIAAA4AAgABAAAAVAAAAA8ABQABAAAAKAIAAAAAAAAnAAAAAQAAAAzEAADo +AwAAAAAAAAEAAABWAAAAAQAAADkhAADoAwAAAAAAAAEAAADhAAAAAQAAAAAAAAAAAAAAAAAAAAAA +AAD/2wCEAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0aHBwgJC4nICIsIxwcKDcpLDAx +NDQ0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eR2UDjJpRkkthyi1uxtresdL1G042lBIBjuD/8Aqq1G80zNu8ZLyOcE +298/wGu5LlWpwfEak95PYy27Wtw21YwBjjIyTj8yayprmeqKn7r0ZkeILqSe2a4kO55CB+GMV20I +pO0TmrybV2zly7MoDHOK7LWehwO73IZTnODT13JViVAVVRzlu1Qm0rsvdnSQ2CLbqD1xXnyquTPQ +hBJCPZIO1HN0E1qM+zR7ecU7tA4oabdR/CKHN2J5dRPJUdcY7UXbHZIPLTqB0oTavYmxVuI1KnA6 +1cJSQpJFWL5cgnpWk+7FB9C7bvtZTxwawlqdEHZkt3IXDITkEVENHc0lqtTOKntmuhXepzaXHL81 +Rsyku5HKn8Xp6VpCRE46DFOG+lD2QR0ReTDR89axu09DojK6KUy7WIH4VtF3RzSViAj3+tXqZjoj +yQeM0mWnroOzgkUiup//2Q== + +--_99db4215-8df5-4407-9408-286fd34bd3a9_-- diff --git a/test/test_helper.rb b/test/test_helper.rb index 22982e2..3e0e1cc 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -1,102 +1,102 @@ # do it like rake http://ozmm.org/posts/do_it_like_rake.html %W{ test/unit set net/http net/https pp tempfile mocha }.each do |g| begin require g rescue LoadError require 'rubygems' require g end end # NOTE when we upgrade to test-unit 2.x.x or greater we'll not need redgreen, # it's baked into test-unit begin require 'redgreen'; rescue LoadError; end require File.join(File.expand_path(File.dirname(__FILE__)), '..', 'lib', 'mms2r') module MMS2R module TestHelper def assert_file_size(file, size) assert_not_nil(file, "file was nil") assert(File::exist?(file), "file #{file} does not exist") assert(File::size(file) == size, "file #{file} is #{File::size(file)} bytes, not #{size} bytes") end def fixture(file) File.join(File.expand_path(File.dirname(__FILE__)), "fixtures", file) end def fixture_data(name) open(fixture(name)).read end def mail_fixture(file) fixture(file) end def mail(name) Mail.read(mail_fixture(name)) end - def smart_phone_mock(make_text = 'Apple', model_text = 'iPhone', jpeg = true) + def smart_phone_mock(make_text = 'Apple', model_text = 'iPhone', software_text = nil, jpeg = true) mail = stub('mail', :from => ['[email protected]'], :return_path => '<[email protected]>', :message_id => 'abcd0123', :multipart? => true, :header => {}) part = stub('part', :part_type? => "image/#{jpeg ? 'jpeg' : 'tiff'}", :body => Mail::Body.new('abc'), :multipart? => false, :filename => "foo.#{jpeg ? 'jpg' : 'tif'}" ) mail.stubs(:parts).returns([part]) - exif = stub('exif', :make => make_text, :model => model_text) + exif = stub('exif', :make => make_text, :model => model_text, :software => software_text) if jpeg EXIFR::JPEG.expects(:new).at_least_once.returns(exif) else EXIFR::TIFF.expects(:new).at_least_once.returns(exif) end mail end end end class Hash def except(*keys) rejected = Set.new(respond_to?(:convert_key) ? keys.map { |key| convert_key(key) } : keys) reject { |key,| rejected.include?(key) } end def except!(*keys) replace(except(*keys)) end end # monkey patch Net::HTTP so un caged requests don't go over the wire module Net #:nodoc: class HTTP #:nodoc: alias :old_net_http_request :request alias :old_net_http_connect :connect def request(req, body = nil, &block) prot = use_ssl ? "https" : "http" uri_cls = use_ssl ? URI::HTTPS : URI::HTTP query = req.path.split('?',2) opts = {:host => self.address, :port => self.port, :path => query[0]} opts[:query] = query[1] if query[1] uri = uri_cls.build(opts) raise ArgumentError.new("#{req.method} method to #{uri} not being handled in testing") end def connect raise ArgumentError.new("connect not being handled in testing") end end end diff --git a/test/test_mms2r_media.rb b/test/test_mms2r_media.rb index efb9081..5527789 100644 --- a/test/test_mms2r_media.rb +++ b/test/test_mms2r_media.rb @@ -260,585 +260,592 @@ class TestMms2rMedia < Test::Unit::TestCase mms = MMS2R::Media.new(mail) assert_equal '', mms.subject end def test_subject_with_subject_ignored s = 'hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) mms.stubs(:config).returns({'ignore' => {'text/plain' => [s]}}) assert_equal '', mms.subject end def test_subject_with_subject_transformed s = 'Default Subject: hello world' mail = stub_mail mail.stubs(:subject).returns(s) mms = MMS2R::Media.new(mail) mms.stubs(:config).returns( { 'ignore' => {}, 'transform' => {'text/plain' => [[/Default Subject: (.+)/, '\1']]}}) assert_equal 'hello world', mms.subject end def test_attachment_should_return_nil_if_files_for_type_are_not_found mms = MMS2R::Media.new stub_mail mms.stubs(:media).returns({}) assert_nil mms.send(:attachment, ['text']) end def test_attachment_should_return_nil_if_empty_files_are_found mms = MMS2R::Media.new stub_mail mms.stubs(:media).returns({'text/plain' => [Tempfile.new('test')]}) assert_nil mms.send(:attachment, ['text']) end def test_type_from_filename mms = MMS2R::Media.new stub_mail assert_equal 'image/jpeg', mms.send(:type_from_filename, "example.jpg") end def test_type_from_filename_should_be_nil mms = MMS2R::Media.new stub_mail assert_nil mms.send(:type_from_filename, "example.example") end def test_attachment_should_return_duck_typed_file mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") size = File.size(temp_text_file("hello world")) temp_small = temp_text_file("hello") mms.stubs(:media).returns({'text/plain' => [temp_small, temp_big]}) duck_file = mms.send(:attachment, ['text']) assert_not_nil duck_file assert_equal true, File::exist?(duck_file) assert_equal true, File::exist?(temp_big) assert_equal temp_big, duck_file.local_path assert_equal File.basename(temp_big), duck_file.original_filename assert_equal size, duck_file.size assert_equal 'text/plain', duck_file.content_type end def test_empty_body mms = MMS2R::Media.new stub_mail mms.stubs(:default_text).returns(nil) assert_equal "", mms.body end def test_body mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") mms.stubs(:default_text).returns(File.new(temp_big)) body = mms.body assert_equal "hello world", body end def test_body_when_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") mms.stubs(:default_html).returns(File.new(temp_big)) assert_equal "hello world teapot", mms.body end def test_default_text mms = MMS2R::Media.new stub_mail temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'text/plain' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_text.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_text.local_path end def test_default_html mms = MMS2R::Media.new stub_mail(:body => '') temp_big = temp_text_file("<html><head><title>hello</title></head><body><p>world</p><p>teapot</p><body></html>") temp_small = temp_text_file("<html><head><title>hello</title></head><body>world<body></html>") mms.stubs(:media).returns({'text/html' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_html.local_path # second time through shouldn't setup the @default_text by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_html.local_path end def test_default_media mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big = temp_text_file("hello world") temp_small = temp_text_file("hello") mms.stubs(:media).returns({'image/jpeg' => [temp_small, temp_big]}) assert_equal temp_big, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big, mms.default_media.local_path end def test_default_media_treats_image_and_video_equally mms = MMS2R::Media.new stub_mail #it doesn't matter that these are text files, we just need say they are images temp_big_image = temp_text_file("hello world") temp_small_image = temp_text_file("hello") temp_big_video = temp_text_file("hello world again") temp_small_video = temp_text_file("hello again") mms.stubs(:media).returns({'image/jpeg' => [temp_small_image, temp_big_image], 'video/mpeg' => [temp_small_video, temp_big_video], }) assert_equal temp_big_video, mms.default_media.local_path # second time through shouldn't setup the @default_media by calling attachment mms.expects(:attachment).never assert_equal temp_big_video, mms.default_media.local_path end #def test_default_media_treats_gif_and_jpg_equally # #it doesn't matter that these are text files, we just need say they are images # temp_big = temp_text_file("hello world") # temp_small = temp_text_file("hello") # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/jpeg' => [temp_big], 'image/gif' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path # mms = MMS2R::Media.new stub_mail # mms.stubs(:media).returns({'image/gif' => [temp_big], 'image/jpg' => [temp_small]}) # assert_equal temp_big, mms.default_media.local_path #end def test_purge mms = MMS2R::Media.new stub_mail mms.purge assert_equal false, File.exist?(mms.media_dir) end def test_ignore_media_by_filename_equality name = 'foo.txt' type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [name]}}) # type is not in the ingore part = stub(:body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and filename are in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal true, mms.ignore_media?(type, part) # type but not file name are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_filename name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'foo.txt', mms.filename?(part) end def test_long_filename name = 'x' * 300 + '.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal 'x' * 251 + '.txt', mms.filename?(part) end def test_filename_when_file_extension_missing_part name = 'foo' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.txt', mms.filename?(part) name = 'foo.janky' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain') assert_equal 'foo.janky.txt', mms.filename?(part) end def test_ignore_media_by_filename_regexp name = 'foo.txt' regexp = /foo\.txt/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => [regexp, 'nil.txt']}}) # type is not in the ingore part = stub(:filename => name, :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the filename are in the ingore part = stub(:filename => name) assert_equal true, mms.ignore_media?(type, part) # type but not regexp for filename are in the ignore part = stub(:filename => 'bar.txt', :body => Mail::Body.new('a')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_by_regexp_on_file_content name = 'foo.txt' content = "aaaaaaahello worldbbbbbbbbb" regexp = /.*Hello World.*/i type = 'text/plain' mms = MMS2R::Media.new stub_mail mms.stubs(:config).returns({'ignore' => {type => ['nil.txt', regexp]}}) part = stub(:filename => name, :body => Mail::Body.new(content)) # type is not in the ingore assert_equal false, mms.ignore_media?('text/test', part) # type and regexp for the content are in the ingore assert_equal true, mms.ignore_media?(type, part) # type but not regexp for content are in the ignore part = stub(:filename => name, :body => Mail::Body.new('no teapots')) assert_equal false, mms.ignore_media?(type, part) end def test_ignore_media_when_file_content_is_empty mms = MMS2R::Media.new stub_mail # there is no conf but the part's body is empty part = stub(:filename => 'foo.txt', :body => Mail::Body.new) assert_equal true, mms.ignore_media?('text/test', part) # there is no conf but the part's body is white space part = stub(:filename => 'foo.txt', :body => Mail::Body.new("\t\n\t\n ")) assert_equal true, mms.ignore_media?('text/test', part) end def test_add_file mail = stub_mail mail.stubs(:from).returns(['[email protected]']) mms = MMS2R::Media.new(mail) mms.stubs(:media).returns({}) assert_nil mms.media['text/html'] mms.add_file('text/html', '/tmp/foo.html') assert_equal ['/tmp/foo.html'], mms.media['text/html'] mms.add_file('text/html', '/tmp/bar.html') assert_equal ['/tmp/foo.html', '/tmp/bar.html'], mms.media['text/html'] end def test_temp_file name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name) assert_equal name, File.basename(mms.temp_file(part)) end def test_process_media_for_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', 'hello world']) result = mms.process_media(part) assert_equal 'text/plain', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_with_empty_text name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['text/plain', nil]) part = stub(:filename => name, :content_type => 'text/plain', :part_type? => 'text/plain', :main_type => 'text') assert_equal ['text/plain', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['text/plain', '']) assert_equal ['text/plain', nil], mms.process_media(part) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_application_smil name = 'foo.txt' mms = MMS2R::Media.new stub_mail mms.stubs(:transform_text_part).returns(['application/smil', nil]) part = stub(:filename => name, :content_type => 'application/smil', :part_type? => 'application/smil', :main_type => 'application') assert_equal ['application/smil', nil], mms.process_media(part) mms.stubs(:transform_text_part).returns(['application/smil', 'hello world']) result = mms.process_media(part) assert_equal 'application/smil', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_application_octet_stream_when_image name = 'fake.jpg' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :content_type => 'application/octet-stream', :part_type? => 'application/octet-stream', :body => Mail::Body.new("data"), :main_type => 'application') result = mms.process_media(part) assert_equal 'image/jpeg', result.first assert_match(/fake\.jpg$/, result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process_media_for_all_other_media name = 'foo.txt' mms = MMS2R::Media.new stub_mail part = stub(:filename => name, :main_type => 'faux', :part_type? => 'faux/text', :body => Mail::Body.new(nil)) assert_equal ['faux/text', nil], mms.process_media(part) part = stub(:filename => name, :main_type => 'faux', :part_type? => 'faux/text', :body => Mail::Body.new('hello world')) result = mms.process_media(part) assert_equal 'faux/text', result.first assert_equal 'hello world', IO.read(result.last) mms.purge # have to call purge since a file is put to disk as side effect end def test_process mms = MMS2R::Media.new stub_mail assert_equal 1, mms.media.size assert_not_nil mms.media['text/plain'] assert_equal 1, mms.media['text/plain'].size assert_equal true, File.exist?(mms.media['text/plain'].first) assert_equal 1, File.size(mms.media['text/plain'].first) mms.purge end def test_process_with_multipart_double_parts mail = mail('apple-double-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_not_nil mms.media['application/applefile'] assert_equal 1, mms.media['application/applefile'].size assert_not_nil mms.media['image/jpeg'] assert_equal 1, mms.media['image/jpeg'].size assert_match(/DSCN1715\.jpg$/, mms.media['image/jpeg'].first) assert_file_size mms.media['image/jpeg'].first, 337 mms.purge end def test_process_with_multipart_alternative_parts mail = stub_mail plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new('a'), :main_type => 'text') plain.stubs(:multipart?).at_least_once.returns(false) html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new('a'), :main_type => 'text') html.stubs(:multipart?).at_least_once.returns(false) multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) multi.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:parts).at_least_once.returns([multi]) # the multipart/alternative should get flattend to text and html mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size assert_equal 2, mms.media.size assert_not_nil mms.media['text/plain'] assert_not_nil mms.media['text/html'] assert_equal 1, mms.media['text/plain'].size assert_equal 1, mms.media['text/html'].size assert_equal 'message.txt', File.basename(mms.media['text/plain'].first) assert_equal 'message.html', File.basename(mms.media['text/html'].first) assert_equal true, File.exist?(mms.media['text/plain'].first) assert_equal true, File.exist?(mms.media['text/html'].first) assert_equal 1, File.size(mms.media['text/plain'].first) assert_equal 1, File.size(mms.media['text/html'].first) mms.purge end def test_process_when_media_is_ignored mail = stub_mail plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new(''), :main_type => 'text') plain.stubs(:multipart?).at_least_once.returns(false) html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new(''), :main_type => 'text') html.stubs(:multipart?).at_least_once.returns(false) multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) multi.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:parts).at_least_once.returns([multi]) mms = MMS2R::Media.new(mail, :process => :lazy) mms.stubs(:config).returns({'ignore' => {'text/plain' => ['message.txt'], 'text/html' => ['message.html']}}) assert_nothing_raised { mms.process } # the multipart/alternative should get flattend to text and html and then # what's flattened is ignored assert_equal 0, mms.media.size mms.purge end def test_process_when_yielding_to_a_block mail = stub_mail plain = stub('plain', :filename => 'message.txt', :content_type => 'text/plain', :part_type? => 'text/plain', :body => Mail::Body.new('a'), :main_type => 'text') plain.stubs(:multipart?).at_least_once.returns(false) html = stub('html', :filename => 'message.html', :content_type => 'text/html', :part_type? => 'text/html', :body => Mail::Body.new('b'), :main_type => 'text') html.stubs(:multipart?).at_least_once.returns(false) multi = stub('multi', :content_type => 'multipart/alternative', :part_type? => 'multipart/alternative', :parts => [plain, html]) multi.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:multipart?).at_least_once.returns(true) mail.stubs(:parts).at_least_once.returns([multi]) # the multipart/alternative should get flattend to text and html mms = MMS2R::Media.new(mail) assert_equal 2, mms.media.size mms.process do |type, files| assert_equal 1, files.size assert_equal true, type == 'text/plain' || type == 'text/html' assert_equal true, File.basename(files.first) == 'message.txt' || File.basename(files.first) == 'message.html' assert_equal true, File::exist?(files.first) end mms.purge end def test_domain_from_return_path mail = mock() mail.expects(:from).at_least_once.returns([]) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'null.example.com', domain end def test_domain_from_from mail = mock() mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'null.example.com', domain end def test_domain_from_from_yaml f = File.join(MMS2R::Media.conf_dir, 'from.yml') YAML.expects(:load_file).once.with(f).returns(['example.com']) mail = mock() mail.expects(:from).at_least_once.returns(['[email protected]']) mail.expects(:return_path).at_least_once.returns('[email protected]') domain = MMS2R::Media.domain(mail) assert_equal 'example.com', domain end def test_unknown_device_type mail = mail('generic.mail') mms = MMS2R::Media.new(mail) assert_equal :unknown, mms.device_type? assert_equal false, mms.is_mobile? end def test_iphone_device_type_by_header iphones = ['att-iphone-01.mail', 'iphone-image-01.mail'] iphones.each do |iphone| mail = mail(iphone) mms = MMS2R::Media.new(mail) assert_equal :iphone, mms.device_type?, "fixture #{iphone} was not a iphone" assert_equal true, mms.is_mobile? end end def test_exif mail = smart_phone_mock mms = MMS2R::Media.new(mail) assert_equal 'iPhone', mms.exif.model end def test_iphone_device_type_by_exif mail = smart_phone_mock mms = MMS2R::Media.new(mail) assert_equal :iphone, mms.device_type? assert_equal true, mms.is_mobile? end def test_faux_tiff_iphone_device_type_by_exif - mail = smart_phone_mock('Apple', 'iPhone', jpeg = false) + mail = smart_phone_mock('Apple', 'iPhone', nil, jpeg = false) mms = MMS2R::Media.new(mail) assert_equal :iphone, mms.device_type? assert_equal true, mms.is_mobile? end - def test_blackberry_device_type_by_exif + def test_blackberry_device_type_by_exif_make_model mail = smart_phone_mock('Research In Motion', 'BlackBerry') mms = MMS2R::Media.new(mail) assert_equal :blackberry, mms.device_type? assert_equal true, mms.is_mobile? end + def test_blackberry_device_type_by_exif_software + mail = smart_phone_mock(nil, nil, "Rim Exif Version1.00a") + mms = MMS2R::Media.new(mail) + assert_equal :blackberry, mms.device_type? + assert_equal true, mms.is_mobile? + end + def test_dash_device_type_by_exif mail = smart_phone_mock('T-Mobile Dash', 'T-Mobile Dash') mms = MMS2R::Media.new(mail) assert_equal :dash, mms.device_type? assert_equal true, mms.is_mobile? end def test_droid_device_type_by_exif mail = smart_phone_mock('Motorola', 'Droid') mms = MMS2R::Media.new(mail) assert_equal :droid, mms.device_type? assert_equal true, mms.is_mobile? end def test_htc_eris_device_type_by_exif mail = smart_phone_mock('HTC', 'Eris') mms = MMS2R::Media.new(mail) assert_equal :htc, mms.device_type? assert_equal true, mms.is_mobile? end def test_htc_hero_device_type_by_exif mail = smart_phone_mock('HTC', 'HERO200') mms = MMS2R::Media.new(mail) assert_equal :htc, mms.device_type? assert_equal true, mms.is_mobile? end def test_handsets_by_exif handsets = YAML.load_file(fixture('handsets.yml')) handsets.each do |handset| mail = smart_phone_mock(handset.first, handset.last) mms = MMS2R::Media.new(mail) assert_equal true, mms.is_mobile?, "mms with make #{mms.exif.make}, and model #{mms.exif.model}, should be considered a mobile device" end end def test_blackberry_device_type berries = ['att-blackberry.mail', 'suncom-blackberry.mail', 'tmobile-blackberry-02.mail', 'tmobile-blackberry.mail', 'tmo.blackberry.net-image-01.mail', 'verizon-blackberry.mail', 'verizon-blackberry.mail'] berries.each do |berry| mms = MMS2R::Media.new(mail(berry)) assert_equal :blackberry, mms.device_type?, "fixture #{berry} was not a blackberrry" assert_equal true, mms.is_mobile? end end def test_handset_device_type mail = mail('att-image-01.mail') mms = MMS2R::Media.new(mail) assert_equal :handset, mms.device_type? assert_equal true, mms.is_mobile? end end diff --git a/test/test_sprint.rb b/test/test_sprint.rb new file mode 100644 index 0000000..8d3d535 --- /dev/null +++ b/test/test_sprint.rb @@ -0,0 +1,17 @@ +require "test_helper" + +class Testprint < Test::Unit::TestCase + include MMS2R::TestHelper + + def test_sprint_blackberry_01 + # Rim Exif Version1.00a + mail = mail('sprint-blackberry-01.mail') + mms = MMS2R::Media.new(mail) + assert_equal true, mms.is_mobile? + assert_equal "", mms.body + assert_equal 1, mms.media.size + assert_equal 1, mms.media['image/jpeg'].size + + mms.purge + end +end
blodt/ext.entry_reedirect.ee_addon
068d714393a4edf049a58408cb8de31d275360a3
Took jQuery out of noConflict mode for Structure screen compatibility
diff --git a/README.markdown b/README.markdown index 59f8cf5..d8758c5 100644 --- a/README.markdown +++ b/README.markdown @@ -1,16 +1,17 @@ Entry REEdirect is an ExpressionEngine extension that allows you to control, on a per-weblog basis, where authors land after publishing or updating entries in the ExpressionEngine control panel. For each weblog you have four redirect location options for both **new entries** and **updated entries**: - **Default Preview** - EE's built-in success screen with ugly entry preview - **Publish Form** - new entry screen for the same weblog you just published to - **Edit Entry** - keep editing the entry you just published or updated - **Manage Entries** - the Edit tab, filtered to display entries from the weblog you just published to +- **Structure module** - if the [Structure module](http://buildwithstructure.com) is installed, you can choose to redirect to the main Structure screen In all cases the author will see a "success" message for their new entry or update, along with the entry's title and an "Edit this entry" link. This success message can optionally disappear after a specified length of time, and has a "close" link as well. The Extension Settings screen offers optional one-click setting of all of your weblogs to the same option for both new entries and updated entries. Entries submitted via SAEFs will be be unaffected by this extension. Entry REEdirect requires jQuery for the Control Panel (loading jQuery 1.3 or newer), and has been tested with ExpressionEngine 1.6.8. \ No newline at end of file diff --git a/extensions/ext.entry_reedirect.php b/extensions/ext.entry_reedirect.php index 6e7e0d8..2d983da 100644 --- a/extensions/ext.entry_reedirect.php +++ b/extensions/ext.entry_reedirect.php @@ -1,534 +1,532 @@ <?php if(!defined('EXT')) { exit('Invalid file request'); } class Entry_reedirect { var $settings = array(); var $name = 'Entry REEdirect'; var $version = '1.0.5'; var $description = 'Choose where users are redirected after publishing/updating new entries in the control panel.'; var $settings_exist = 'y'; var $docs_url = 'http://github.com/amphibian/ext.entry_reedirect.ee_addon'; // ------------------------------- // Constructor - Extensions use this for settings // ------------------------------- function Entry_reedirect($settings='') { $this->settings = $settings; } // END // -------------------------------- // Settings // -------------------------------- function settings_form($current) { global $DB, $DSP, $IN, $LANG, $PREFS; $locations = array('default','new','remain','edit'); // Check to see if the Structure module is installed $structure = $DB->query("SELECT module_id FROM exp_modules WHERE module_name = 'Structure'"); if($structure->num_rows > 0) { $locations[] = 'structure'; } $weblogs = $DB->query("SELECT blog_title, weblog_id FROM exp_weblogs WHERE site_id = '".$DB->escape_str($PREFS->ini('site_id'))."' ORDER BY blog_title ASC"); // Start building the page $DSP->crumbline = TRUE; $DSP->title = $LANG->line('extension_settings'); $DSP->crumb = $DSP->anchor(BASE.AMP.'C=admin'.AMP.'area=utilities', $LANG->line('utilities')). $DSP->crumb_item($DSP->anchor(BASE.AMP.'C=admin'.AMP.'M=utilities'.AMP.'P=extensions_manager', $LANG->line('extensions_manager'))); $DSP->crumb .= $DSP->crumb_item($this->name); $DSP->right_crumb($LANG->line('disable_extension'), BASE.AMP.'C=admin'.AMP.'M=utilities'.AMP.'P=toggle_extension_confirm'.AMP.'which=disable'.AMP.'name='.$IN->GBL('name')); $DSP->body = $DSP->form_open( array( 'action' => 'C=admin'.AMP.'M=utilities'.AMP.'P=save_extension_settings', 'name' => 'entry_reedirect', 'id' => 'entry_reedirect' ), array('name' => get_class($this)) ); // $DSP->body .= '<pre>'.print_r($current, TRUE).'</pre>'; $DSP->body .= $DSP->heading($this->name.NBS.$DSP->qspan('defaultLight', $this->version), 1); // Open the table $DSP->body .= $DSP->table('tableBorder', '0', '', '100%'); $DSP->body .= $DSP->tr(); $DSP->body .= $DSP->td('tableHeading', '30%'); $DSP->body .= ucfirst($PREFS->ini('weblog_nomenclature')); $DSP->body .= $DSP->td_c(); $DSP->body .= $DSP->td('tableHeading', '30%'); $DSP->body .= $LANG->line('redirect_after_new'); $DSP->body .= $DSP->td_c(); $DSP->body .= $DSP->td('tableHeading', '30%'); $DSP->body .= $LANG->line('redirect_after_update'); $DSP->body .= $DSP->td_c(); $DSP->body .= $DSP->tr_c(); // Global location controls $DSP->body .= $DSP->tr(); $DSP->body .= '<td class="box" style="border-width: 0 0 1px; font-weight: bold; margin: 0; padding: 6px;">'; $DSP->body .= $LANG->line('global_redirect'); $DSP->body .= $DSP->td_c(); $DSP->body .= '<td class="box" style="border-width: 0 0 1px; margin: 0; padding: 6px;">'; $DSP->body .= $DSP->input_select_header('global_new_entry_redirect'); $DSP->body .= $DSP->input_select_option('none', $LANG->line('none'), 1); foreach($locations as $location) { $DSP->body .= $DSP->input_select_option($location, $LANG->line($location.'_lang')); } $DSP->body .= $DSP->input_select_footer(); $DSP->body .= $DSP->td_c(); $DSP->body .= '<td class="box" style="border-width: 0 0 1px; margin: 0; padding: 6px;">'; $DSP->body .= $DSP->input_select_header('global_updated_entry_redirect'); $DSP->body .= $DSP->input_select_option('none', $LANG->line('none'), 1); foreach($locations as $location) { $DSP->body .= $DSP->input_select_option($location, $LANG->line($location.'_lang')); } $DSP->body .= $DSP->input_select_footer(); $DSP->body .= $DSP->td_c(); $DSP->body .= $DSP->tr_c(); // Per-weblog settings $i = 1; foreach($weblogs->result as $value) { $class = ($i % 2) ? 'tableCellTwo' : 'tableCellOne'; extract($value); $DSP->body .= $DSP->tr(); $DSP->body .= $DSP->td($class); $DSP->body .= $blog_title; $DSP->body .= $DSP->td_c(); $DSP->body .= $DSP->td($class); $DSP->body .= $DSP->input_select_header('new_redirect_weblog_id_'.$weblog_id); foreach($locations as $location) { $DSP->body .= $DSP->input_select_option($location, $LANG->line($location.'_lang'), ( isset($current['new_redirect_weblog_id_'.$weblog_id]) && $current['new_redirect_weblog_id_'.$weblog_id] == $location) ? 1 : ''); } $DSP->body .= $DSP->input_select_footer(); $DSP->body .= $DSP->td_c(); $DSP->body .= $DSP->td($class); $DSP->body .= $DSP->input_select_header('updated_redirect_weblog_id_'.$weblog_id); foreach($locations as $location) { $DSP->body .= $DSP->input_select_option($location, $LANG->line($location.'_lang'), ( isset($current['updated_redirect_weblog_id_'.$weblog_id]) && $current['updated_redirect_weblog_id_'.$weblog_id] == $location) ? 1 : ''); } $DSP->body .= $DSP->input_select_footer(); $DSP->body .= $DSP->td_c(); $DSP->body .= $DSP->tr_c(); $i++; } // Setting for message display $DSP->body .= $DSP->tr(); $DSP->body .= '<td class="box" style="border-width: 0 0 1px; margin: 0; padding: 6px;">'; $DSP->body .= $LANG->line('hide_success_message'); $DSP->body .= $DSP->td_c(); $DSP->body .= '<td colspan="2" class="box" style="border-width: 0 0 1px; margin: 0; padding: 6px;">'; $DSP->body .= $DSP->input_text('hide_success_message', (isset($current['hide_success_message'])) ? $current['hide_success_message'] : '5', 10, '2', '', '50px'); $DSP->body .= $DSP->td_c(); $DSP->body .= $DSP->tr_c(); // Wrap it up $DSP->body .= $DSP->table_c(); $DSP->body .= $DSP->qdiv('itemWrapperTop', $DSP->input_submit()); $DSP->body .= $DSP->form_c(); } // END function save_settings() { global $DB; // Get all settings $settings = $this->get_settings(TRUE); unset($_POST['name']); unset($_POST['global_new_entry_redirect']); unset($_POST['global_updated_entry_redirect']); // Only update the settings we just posted // (Leave other sites' settings alone) foreach($_POST as $k => $v) { $settings[$k] = $v; } $data = array('settings' => addslashes(serialize($settings))); $update = $DB->update_string('exp_extensions', $data, "class = 'Entry_reedirect'"); $DB->query($update); } function get_settings($all_sites = FALSE) { global $DB, $PREFS, $REGX; $site = $PREFS->ini('site_id'); $get_settings = $DB->query("SELECT settings FROM exp_extensions WHERE class = 'Entry_reedirect' LIMIT 1"); if ($get_settings->num_rows > 0 && $get_settings->row['settings'] != '') { $settings = $REGX->array_stripslashes(unserialize($get_settings->row['settings'])); $settings = ($all_sites == TRUE) ? $settings : $settings[$site]; } else { $settings = array(); } return $settings; } // -------------------------------- // Put $_POST['return_url'] into a global variable so we can access it later // (No access to this variable from the other, more appropriate hooks) // -------------------------------- function grab_return_url() { global $saef_return_url; $saef_return_url = ($_POST['return_url']) ? $_POST['return_url'] : ''; } // END // -------------------------------- // Do the redirect // -------------------------------- function redirect_location($entry_id, $data, $cp_call) { if($cp_call == TRUE) { $type = ($_POST['entry_id']) ? 'updated' : 'new'; $redirect = (!empty($this->settings) && isset($this->settings[$type.'_redirect_weblog_id_'.$data['weblog_id']])) ? $this->settings[$type.'_redirect_weblog_id_'.$data['weblog_id']] : ''; $default = BASE.AMP. 'C=edit'.AMP. 'M=view_entry'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'entry_id='.$entry_id.AMP. 'U='.$type; if($redirect) { switch($redirect) { case 'new': $location = BASE.AMP. 'C=publish'.AMP. 'M=entry_form'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; case 'remain': $location = BASE.AMP. 'C=edit'.AMP. 'M=edit_entry'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'entry_id='.$entry_id.AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; case 'edit': $location = BASE.AMP. 'C=edit'.AMP. 'M=view_entries'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; case 'structure': $location = BASE.AMP. 'C=modules'.AMP. 'M=Structure'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; default: $location = $default; } } else { $location = $default; } } else { global $FNS, $saef_return_url; $FNS->template_type = 'webpage'; $location = ($saef_return_url == '') ? $FNS->fetch_site_index() : $FNS->create_url($saef_return_url, 1, 1); } return $location; } // END // -------------------------------- // Edits to the control panel output // -------------------------------- function cp_changes($out) { global $DB, $EXT, $DSP, $IN, $LANG; if ($EXT->last_call !== FALSE) { $out = $EXT->last_call; } // Add jQuery to extension settings page if($IN->GBL('P') == 'extension_settings' && $IN->GBL('name') == 'entry_reedirect') { $target = '</head>'; $js = ' <script type="text/javascript"> <!-- Added by Entry REEdirect --> - jQuery.noConflict(); - jQuery(document).ready(function($) + $(document).ready(function() { $("select[name=global_new_entry_redirect]").change(function(){ var setValue = $(this).val(); if(setValue != "none") { $("select[name^=new_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=new_redirect]").attr("disabled", "disabled"); } else { $("select[name^=new_redirect]").removeAttr("disabled"); } }); $("select[name=global_updated_entry_redirect]").change(function(){ var setValue = $(this).val(); if(setValue != "none") { $("select[name^=updated_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=updated_redirect]").attr("disabled", "disabled"); } else { $("select[name^=updated_redirect]").removeAttr("disabled"); } }); $("form#entry_reedirect").submit(function(){ $("select[name*=redirect_weblog_id]").removeAttr("disabled"); }); }); </script> </head> '; $out = str_replace($target, $js, $out); } // Display success messages - $find = array(); - $replace = array(); + $find = array("<div id='contentNB'>", "<div id='content'>", "</head>"); if(isset($_GET['reedirect_entry_id'])) { // Success message goes bye-bye? If so, add the callback. $auto_hide = ($this->settings['hide_success_message']) ? ',function(){ setTimeout( function(){ $("div#entry_reedirect_message").slideUp(); } ,'.($this->settings['hide_success_message']*1000).' ); }' : ''; - - $find[] = "<div id='contentNB'>"; - + + // Build the success message $get_title = $DB->query("SELECT title FROM exp_weblog_titles WHERE entry_id = " . $DB->escape_str($_GET['reedirect_entry_id']) . " LIMIT 1"); $title = $get_title->row['title']; - $message = "<div id='contentNB'> - ".'<div id="entry_reedirect_message"><div>'.$DSP->span('success'); + $LANG->fetch_language_file('publish'); + + $message = ' + <div id="entry_reedirect_message"><div>'.$DSP->span('success'); if($_GET['U'] == 'new') { $message .= $LANG->line('entry_has_been_added'); } elseif($_GET['U'] == 'updated') { $message .= $LANG->line('entry_has_been_updated'); } if($_GET['M'] != 'edit_entry') { $message .= ': '.$DSP->span_c(); $message .= $DSP->qspan('defaultBold', $title). $DSP->span('defaultSmall').$DSP->qspan('defaultLight', '&nbsp;|&nbsp;'). $DSP->anchor(BASE.AMP.'C=edit'.AMP.'M=edit_entry'.AMP. 'weblog_id='.$_GET['weblog_id'].AMP.'entry_id='.$_GET['reedirect_entry_id'], $LANG->line('edit_this_entry')). $DSP->span_c(); } else { $message .= $DSP->span_c(); } - $message .= '<a href="#" id="reedirectClose" title="Hide this notice">&times;</a>' - .$DSP->div_c().$DSP->div_c(); - - $replace[] = $message; - - $find[] = '</head>'; - - $replace[] = ' + $message .= '<a href="#" id="reedirectClose" title="Hide this notice">&times;</a>'; + $message .= $DSP->div_c().$DSP->div_c(); + + // CSS and JS for the success message + $head = ' <style type="text/css"> #entry_reedirect_message { border-bottom:1px solid #CCC9A4; position: fixed; width: 100%; left: 0; top: 0; display: none; } * html #entry_reedirect_message { position: absolute; } #entry_reedirect_message div { padding: 10px 15px; background-color: rgb(252,252,222); } #entry_reedirect_message > div { background-color: rgba(252,252,222,0.95); } a#reedirectClose { display: block; position: absolute; right: 15px; top: 7px; padding: 0 3px; border: 1px solid #CCC9A4; font-size: 18px; line-height: 18px; color: #CCC9A4; text-decoration: none; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } a#reedirectClose:hover { background-color: #CCC9A4; color: rgb(252,252,222); } </style> <script type="text/javascript"> - <!-- Added by Entry REEdirect --> - jQuery.noConflict(); - jQuery(document).ready(function($) + $(document).ready(function() { $("div#entry_reedirect_message").slideDown("normal"'.$auto_hide.'); $("a#reedirectClose").click(function(){ $("div#entry_reedirect_message").slideUp(); return false; }); }); </script> - - </head> '; + $replace = array( + "<div id='contentNB'>$message", + "<div id='content'>$message", + $head."</head>" + ); + $out = str_replace($find, $replace, $out); } // May as well make the other success messages a little nicer // (Delete and multi-entry category update. No message for multi-entry edit for some reason.) if( isset($_GET['C']) && $_GET['C'] == 'edit' && isset($_GET['M']) && ($_GET['M'] == 'delete_entries' || $_GET['M'] == 'entry_category_update')) { $target = "/<div class='success' >\s*([^<]*)\s*/"; $message = '<div class="box"><span class="success">$1</span>'; $out = preg_replace($target, $message, $out); } return $out; } // END // -------------------------------- // Activate Extension // -------------------------------- function activate_extension() { global $DB; $hooks = array( 'weblog_standalone_insert_entry' => 'grab_return_url', 'submit_new_entry_redirect' => 'redirect_location', 'show_full_control_panel_end' => 'cp_changes' ); foreach($hooks as $hook => $method) { $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Entry_reedirect", 'method' => $method, 'hook' => $hook, 'settings' => '', 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); } } // END // -------------------------------- // Update Extension // -------------------------------- function update_extension($current='') { global $DB; if ($current == '' OR $current == $this->version) { return FALSE; } $DB->query("UPDATE exp_extensions SET version = '".$DB->escape_str($this->version)."' WHERE class = 'Entry_reedirect'"); } // END // -------------------------------- // Disable Extension // -------------------------------- function disable_extension() { global $DB; $DB->query("DELETE FROM exp_extensions WHERE class = 'Entry_reedirect'"); } // END } // END CLASS \ No newline at end of file
blodt/ext.entry_reedirect.ee_addon
311e8ce6f2802f23343ee0af9b001d48293dd3ce
Added option to redirect to Structure module; fixed IE 6 javascript error
diff --git a/extensions/ext.entry_reedirect.php b/extensions/ext.entry_reedirect.php index 1461804..6e7e0d8 100644 --- a/extensions/ext.entry_reedirect.php +++ b/extensions/ext.entry_reedirect.php @@ -1,519 +1,534 @@ <?php if(!defined('EXT')) { exit('Invalid file request'); } class Entry_reedirect { var $settings = array(); var $name = 'Entry REEdirect'; - var $version = '1.0.4'; + var $version = '1.0.5'; var $description = 'Choose where users are redirected after publishing/updating new entries in the control panel.'; var $settings_exist = 'y'; var $docs_url = 'http://github.com/amphibian/ext.entry_reedirect.ee_addon'; // ------------------------------- // Constructor - Extensions use this for settings // ------------------------------- function Entry_reedirect($settings='') { $this->settings = $settings; } // END // -------------------------------- // Settings // -------------------------------- function settings_form($current) { global $DB, $DSP, $IN, $LANG, $PREFS; $locations = array('default','new','remain','edit'); - + + // Check to see if the Structure module is installed + $structure = $DB->query("SELECT module_id FROM exp_modules WHERE module_name = 'Structure'"); + if($structure->num_rows > 0) + { + $locations[] = 'structure'; + } + $weblogs = $DB->query("SELECT blog_title, weblog_id FROM exp_weblogs WHERE site_id = '".$DB->escape_str($PREFS->ini('site_id'))."' ORDER BY blog_title ASC"); // Start building the page $DSP->crumbline = TRUE; $DSP->title = $LANG->line('extension_settings'); $DSP->crumb = $DSP->anchor(BASE.AMP.'C=admin'.AMP.'area=utilities', $LANG->line('utilities')). $DSP->crumb_item($DSP->anchor(BASE.AMP.'C=admin'.AMP.'M=utilities'.AMP.'P=extensions_manager', $LANG->line('extensions_manager'))); $DSP->crumb .= $DSP->crumb_item($this->name); $DSP->right_crumb($LANG->line('disable_extension'), BASE.AMP.'C=admin'.AMP.'M=utilities'.AMP.'P=toggle_extension_confirm'.AMP.'which=disable'.AMP.'name='.$IN->GBL('name')); $DSP->body = $DSP->form_open( array( 'action' => 'C=admin'.AMP.'M=utilities'.AMP.'P=save_extension_settings', 'name' => 'entry_reedirect', 'id' => 'entry_reedirect' ), array('name' => get_class($this)) ); // $DSP->body .= '<pre>'.print_r($current, TRUE).'</pre>'; $DSP->body .= $DSP->heading($this->name.NBS.$DSP->qspan('defaultLight', $this->version), 1); // Open the table $DSP->body .= $DSP->table('tableBorder', '0', '', '100%'); $DSP->body .= $DSP->tr(); $DSP->body .= $DSP->td('tableHeading', '30%'); $DSP->body .= ucfirst($PREFS->ini('weblog_nomenclature')); $DSP->body .= $DSP->td_c(); $DSP->body .= $DSP->td('tableHeading', '30%'); $DSP->body .= $LANG->line('redirect_after_new'); $DSP->body .= $DSP->td_c(); $DSP->body .= $DSP->td('tableHeading', '30%'); $DSP->body .= $LANG->line('redirect_after_update'); $DSP->body .= $DSP->td_c(); $DSP->body .= $DSP->tr_c(); // Global location controls $DSP->body .= $DSP->tr(); $DSP->body .= '<td class="box" style="border-width: 0 0 1px; font-weight: bold; margin: 0; padding: 6px;">'; $DSP->body .= $LANG->line('global_redirect'); $DSP->body .= $DSP->td_c(); $DSP->body .= '<td class="box" style="border-width: 0 0 1px; margin: 0; padding: 6px;">'; $DSP->body .= $DSP->input_select_header('global_new_entry_redirect'); $DSP->body .= $DSP->input_select_option('none', $LANG->line('none'), 1); foreach($locations as $location) { $DSP->body .= $DSP->input_select_option($location, $LANG->line($location.'_lang')); } $DSP->body .= $DSP->input_select_footer(); $DSP->body .= $DSP->td_c(); $DSP->body .= '<td class="box" style="border-width: 0 0 1px; margin: 0; padding: 6px;">'; $DSP->body .= $DSP->input_select_header('global_updated_entry_redirect'); $DSP->body .= $DSP->input_select_option('none', $LANG->line('none'), 1); foreach($locations as $location) { $DSP->body .= $DSP->input_select_option($location, $LANG->line($location.'_lang')); } $DSP->body .= $DSP->input_select_footer(); $DSP->body .= $DSP->td_c(); $DSP->body .= $DSP->tr_c(); // Per-weblog settings $i = 1; foreach($weblogs->result as $value) { $class = ($i % 2) ? 'tableCellTwo' : 'tableCellOne'; extract($value); $DSP->body .= $DSP->tr(); $DSP->body .= $DSP->td($class); $DSP->body .= $blog_title; $DSP->body .= $DSP->td_c(); $DSP->body .= $DSP->td($class); $DSP->body .= $DSP->input_select_header('new_redirect_weblog_id_'.$weblog_id); foreach($locations as $location) { $DSP->body .= $DSP->input_select_option($location, $LANG->line($location.'_lang'), ( isset($current['new_redirect_weblog_id_'.$weblog_id]) && $current['new_redirect_weblog_id_'.$weblog_id] == $location) ? 1 : ''); } $DSP->body .= $DSP->input_select_footer(); $DSP->body .= $DSP->td_c(); $DSP->body .= $DSP->td($class); $DSP->body .= $DSP->input_select_header('updated_redirect_weblog_id_'.$weblog_id); foreach($locations as $location) { $DSP->body .= $DSP->input_select_option($location, $LANG->line($location.'_lang'), ( isset($current['updated_redirect_weblog_id_'.$weblog_id]) && $current['updated_redirect_weblog_id_'.$weblog_id] == $location) ? 1 : ''); } $DSP->body .= $DSP->input_select_footer(); $DSP->body .= $DSP->td_c(); $DSP->body .= $DSP->tr_c(); $i++; } // Setting for message display $DSP->body .= $DSP->tr(); $DSP->body .= '<td class="box" style="border-width: 0 0 1px; margin: 0; padding: 6px;">'; $DSP->body .= $LANG->line('hide_success_message'); $DSP->body .= $DSP->td_c(); $DSP->body .= '<td colspan="2" class="box" style="border-width: 0 0 1px; margin: 0; padding: 6px;">'; $DSP->body .= $DSP->input_text('hide_success_message', (isset($current['hide_success_message'])) ? $current['hide_success_message'] : '5', 10, '2', '', '50px'); $DSP->body .= $DSP->td_c(); $DSP->body .= $DSP->tr_c(); // Wrap it up $DSP->body .= $DSP->table_c(); $DSP->body .= $DSP->qdiv('itemWrapperTop', $DSP->input_submit()); $DSP->body .= $DSP->form_c(); } // END function save_settings() { global $DB; // Get all settings $settings = $this->get_settings(TRUE); unset($_POST['name']); unset($_POST['global_new_entry_redirect']); unset($_POST['global_updated_entry_redirect']); // Only update the settings we just posted // (Leave other sites' settings alone) foreach($_POST as $k => $v) { $settings[$k] = $v; } $data = array('settings' => addslashes(serialize($settings))); $update = $DB->update_string('exp_extensions', $data, "class = 'Entry_reedirect'"); $DB->query($update); } function get_settings($all_sites = FALSE) { global $DB, $PREFS, $REGX; $site = $PREFS->ini('site_id'); $get_settings = $DB->query("SELECT settings FROM exp_extensions WHERE class = 'Entry_reedirect' LIMIT 1"); if ($get_settings->num_rows > 0 && $get_settings->row['settings'] != '') { $settings = $REGX->array_stripslashes(unserialize($get_settings->row['settings'])); $settings = ($all_sites == TRUE) ? $settings : $settings[$site]; } else { $settings = array(); } return $settings; } // -------------------------------- // Put $_POST['return_url'] into a global variable so we can access it later // (No access to this variable from the other, more appropriate hooks) // -------------------------------- function grab_return_url() { global $saef_return_url; $saef_return_url = ($_POST['return_url']) ? $_POST['return_url'] : ''; } // END // -------------------------------- // Do the redirect // -------------------------------- function redirect_location($entry_id, $data, $cp_call) { if($cp_call == TRUE) { $type = ($_POST['entry_id']) ? 'updated' : 'new'; $redirect = (!empty($this->settings) && isset($this->settings[$type.'_redirect_weblog_id_'.$data['weblog_id']])) ? $this->settings[$type.'_redirect_weblog_id_'.$data['weblog_id']] : ''; $default = BASE.AMP. 'C=edit'.AMP. 'M=view_entry'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'entry_id='.$entry_id.AMP. 'U='.$type; if($redirect) { switch($redirect) { case 'new': $location = BASE.AMP. 'C=publish'.AMP. 'M=entry_form'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; case 'remain': $location = BASE.AMP. 'C=edit'.AMP. 'M=edit_entry'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'entry_id='.$entry_id.AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; case 'edit': $location = BASE.AMP. 'C=edit'.AMP. 'M=view_entries'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; + case 'structure': + $location = BASE.AMP. + 'C=modules'.AMP. + 'M=Structure'.AMP. + 'weblog_id='.$data['weblog_id'].AMP. + 'reedirect_entry_id='.$entry_id.AMP. + 'U='.$type; + break; default: $location = $default; } } else { $location = $default; } } else { global $FNS, $saef_return_url; $FNS->template_type = 'webpage'; $location = ($saef_return_url == '') ? $FNS->fetch_site_index() : $FNS->create_url($saef_return_url, 1, 1); } return $location; } // END // -------------------------------- // Edits to the control panel output // -------------------------------- function cp_changes($out) { global $DB, $EXT, $DSP, $IN, $LANG; if ($EXT->last_call !== FALSE) { $out = $EXT->last_call; } // Add jQuery to extension settings page if($IN->GBL('P') == 'extension_settings' && $IN->GBL('name') == 'entry_reedirect') { $target = '</head>'; $js = ' <script type="text/javascript"> <!-- Added by Entry REEdirect --> jQuery.noConflict(); jQuery(document).ready(function($) { $("select[name=global_new_entry_redirect]").change(function(){ var setValue = $(this).val(); if(setValue != "none") { $("select[name^=new_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=new_redirect]").attr("disabled", "disabled"); } else { $("select[name^=new_redirect]").removeAttr("disabled"); } }); $("select[name=global_updated_entry_redirect]").change(function(){ var setValue = $(this).val(); if(setValue != "none") { $("select[name^=updated_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=updated_redirect]").attr("disabled", "disabled"); } else { $("select[name^=updated_redirect]").removeAttr("disabled"); } }); - $("form[name=entry_reedirect]").submit(function(){ + $("form#entry_reedirect").submit(function(){ $("select[name*=redirect_weblog_id]").removeAttr("disabled"); }); }); </script> </head> '; $out = str_replace($target, $js, $out); } // Display success messages $find = array(); $replace = array(); if(isset($_GET['reedirect_entry_id'])) { // Success message goes bye-bye? If so, add the callback. $auto_hide = ($this->settings['hide_success_message']) ? ',function(){ setTimeout( function(){ $("div#entry_reedirect_message").slideUp(); } ,'.($this->settings['hide_success_message']*1000).' ); }' : ''; $find[] = "<div id='contentNB'>"; $get_title = $DB->query("SELECT title FROM exp_weblog_titles WHERE entry_id = " . $DB->escape_str($_GET['reedirect_entry_id']) . " LIMIT 1"); $title = $get_title->row['title']; $message = "<div id='contentNB'> ".'<div id="entry_reedirect_message"><div>'.$DSP->span('success'); if($_GET['U'] == 'new') { $message .= $LANG->line('entry_has_been_added'); } elseif($_GET['U'] == 'updated') { $message .= $LANG->line('entry_has_been_updated'); } if($_GET['M'] != 'edit_entry') { $message .= ': '.$DSP->span_c(); $message .= $DSP->qspan('defaultBold', $title). $DSP->span('defaultSmall').$DSP->qspan('defaultLight', '&nbsp;|&nbsp;'). $DSP->anchor(BASE.AMP.'C=edit'.AMP.'M=edit_entry'.AMP. 'weblog_id='.$_GET['weblog_id'].AMP.'entry_id='.$_GET['reedirect_entry_id'], $LANG->line('edit_this_entry')). $DSP->span_c(); } else { $message .= $DSP->span_c(); } $message .= '<a href="#" id="reedirectClose" title="Hide this notice">&times;</a>' .$DSP->div_c().$DSP->div_c(); $replace[] = $message; $find[] = '</head>'; $replace[] = ' <style type="text/css"> #entry_reedirect_message { border-bottom:1px solid #CCC9A4; position: fixed; width: 100%; left: 0; top: 0; display: none; } * html #entry_reedirect_message { position: absolute; } #entry_reedirect_message div { padding: 10px 15px; background-color: rgb(252,252,222); } #entry_reedirect_message > div { background-color: rgba(252,252,222,0.95); } a#reedirectClose { display: block; position: absolute; right: 15px; top: 7px; padding: 0 3px; border: 1px solid #CCC9A4; font-size: 18px; line-height: 18px; color: #CCC9A4; text-decoration: none; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } a#reedirectClose:hover { background-color: #CCC9A4; color: rgb(252,252,222); } </style> <script type="text/javascript"> <!-- Added by Entry REEdirect --> jQuery.noConflict(); jQuery(document).ready(function($) { $("div#entry_reedirect_message").slideDown("normal"'.$auto_hide.'); $("a#reedirectClose").click(function(){ $("div#entry_reedirect_message").slideUp(); return false; }); }); </script> </head> '; $out = str_replace($find, $replace, $out); } // May as well make the other success messages a little nicer // (Delete and multi-entry category update. No message for multi-entry edit for some reason.) if( isset($_GET['C']) && $_GET['C'] == 'edit' && isset($_GET['M']) && ($_GET['M'] == 'delete_entries' || $_GET['M'] == 'entry_category_update')) { $target = "/<div class='success' >\s*([^<]*)\s*/"; $message = '<div class="box"><span class="success">$1</span>'; $out = preg_replace($target, $message, $out); } return $out; } // END // -------------------------------- // Activate Extension // -------------------------------- function activate_extension() { global $DB; $hooks = array( 'weblog_standalone_insert_entry' => 'grab_return_url', 'submit_new_entry_redirect' => 'redirect_location', 'show_full_control_panel_end' => 'cp_changes' ); foreach($hooks as $hook => $method) { $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Entry_reedirect", 'method' => $method, 'hook' => $hook, 'settings' => '', 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); } } // END // -------------------------------- // Update Extension // -------------------------------- function update_extension($current='') { global $DB; if ($current == '' OR $current == $this->version) { return FALSE; } $DB->query("UPDATE exp_extensions SET version = '".$DB->escape_str($this->version)."' WHERE class = 'Entry_reedirect'"); } // END // -------------------------------- // Disable Extension // -------------------------------- function disable_extension() { global $DB; $DB->query("DELETE FROM exp_extensions WHERE class = 'Entry_reedirect'"); } // END } // END CLASS \ No newline at end of file diff --git a/language/english/lang.entry_reedirect.php b/language/english/lang.entry_reedirect.php index 72555e6..b844c7a 100644 --- a/language/english/lang.entry_reedirect.php +++ b/language/english/lang.entry_reedirect.php @@ -1,13 +1,14 @@ <?php global $PREFs; $L = array( 'default_lang' => 'Default Preview', 'new_lang' => 'Publish Form', 'remain_lang' => 'Edit Entry', 'edit_lang' => 'Manage Entries', + 'structure_lang' => 'Structure Module', 'none' => '--', 'redirect_after_new' => 'Redirect after publishing new entries', 'redirect_after_update' => 'Redirect after updating existing entries', 'global_redirect' => 'Quick-set all '.$PREFS->ini('weblog_nomenclature').'s', 'hide_success_message' => 'Seconds until success message disappears (\'0\' for persistent)' ); \ No newline at end of file
blodt/ext.entry_reedirect.ee_addon
c8fbf1082623421d31715edb540e40fdff3be6d3
Redesigned settings screen, now MSM-aware; put jQuery in noConflict mode
diff --git a/extensions/ext.entry_reedirect.php b/extensions/ext.entry_reedirect.php index be8750f..65d4eef 100644 --- a/extensions/ext.entry_reedirect.php +++ b/extensions/ext.entry_reedirect.php @@ -1,404 +1,519 @@ <?php if(!defined('EXT')) { exit('Invalid file request'); } class Entry_reedirect { var $settings = array(); var $name = 'Entry REEdirect'; - var $version = '1.0.3'; + var $version = '1.0.4'; var $description = 'Choose where users are redirected after publishing/updating new entries in the control panel.'; var $settings_exist = 'y'; var $docs_url = 'http://github.com/amphibian/ext.entry_reedirect.ee_addon'; // ------------------------------- // Constructor - Extensions use this for settings // ------------------------------- function Entry_reedirect($settings='') { $this->settings = $settings; } // END // -------------------------------- // Settings // -------------------------------- - function settings() + function settings_form($current) { - global $DB, $LANG, $PREFS; + global $DB, $DSP, $IN, $LANG, $PREFS; + + $locations = array('default','new','remain','edit'); - $settings = array(); + $weblogs = $DB->query("SELECT blog_title, weblog_id + FROM exp_weblogs + WHERE site_id = '".$DB->escape_str($PREFS->ini('site_id'))."' + ORDER BY blog_title ASC"); + + // Start building the page + $DSP->crumbline = TRUE; - $locations = array( - 'default' => 'Default Preview', - 'new' => 'Publish Form', - 'remain' => 'Edit Entry', - 'edit' => 'Manage Entries' - ); + $DSP->title = $LANG->line('extension_settings'); + $DSP->crumb = $DSP->anchor(BASE.AMP.'C=admin'.AMP.'area=utilities', $LANG->line('utilities')). + $DSP->crumb_item($DSP->anchor(BASE.AMP.'C=admin'.AMP.'M=utilities'.AMP.'P=extensions_manager', $LANG->line('extensions_manager'))); + $DSP->crumb .= $DSP->crumb_item($this->name); - $global_locations = $locations; - $global_locations['none'] = 'None'; + $DSP->right_crumb($LANG->line('disable_extension'), BASE.AMP.'C=admin'.AMP.'M=utilities'.AMP.'P=toggle_extension_confirm'.AMP.'which=disable'.AMP.'name='.$IN->GBL('name')); - $settings['hide_success_message'] = '5'; - $settings['global_new_entry_redirect'] = array('r', $global_locations, 'none'); - $settings['global_updated_entry_redirect'] = array('r', $global_locations, 'none'); + $DSP->body = $DSP->form_open( + array( + 'action' => 'C=admin'.AMP.'M=utilities'.AMP.'P=save_extension_settings', + 'name' => 'entry_reedirect', + 'id' => 'entry_reedirect' + ), + array('name' => get_class($this)) + ); + + // $DSP->body .= '<pre>'.print_r($current, TRUE).'</pre>'; - $query = $DB->query("SELECT blog_title, weblog_id FROM exp_weblogs ORDER BY blog_title ASC"); - if($query->num_rows > 0) + $DSP->body .= $DSP->heading($this->name, 1); + + // Open the table + $DSP->body .= $DSP->table('tableBorder', '0', '', '100%'); + $DSP->body .= $DSP->tr(); + + $DSP->body .= $DSP->td('tableHeading', '30%'); + $DSP->body .= ucfirst($PREFS->ini('weblog_nomenclature')); + $DSP->body .= $DSP->td_c(); + + $DSP->body .= $DSP->td('tableHeading', '30%'); + $DSP->body .= $LANG->line('redirect_after_new'); + $DSP->body .= $DSP->td_c(); + + $DSP->body .= $DSP->td('tableHeading', '30%'); + $DSP->body .= $LANG->line('redirect_after_update'); + $DSP->body .= $DSP->td_c(); + + $DSP->body .= $DSP->tr_c(); + + // Global location controls + $DSP->body .= $DSP->tr(); + + $DSP->body .= '<td class="box" style="border-width: 0 0 1px; font-weight: bold; margin: 0; padding: 6px;">'; + $DSP->body .= $LANG->line('global_redirect'); + $DSP->body .= $DSP->td_c(); + + $DSP->body .= '<td class="box" style="border-width: 0 0 1px; margin: 0; padding: 6px;">'; + $DSP->body .= $DSP->input_select_header('global_new_entry_redirect'); + $DSP->body .= $DSP->input_select_option('none', $LANG->line('none'), 1); + foreach($locations as $location) + { + $DSP->body .= $DSP->input_select_option($location, $LANG->line($location.'_lang')); + } + $DSP->body .= $DSP->input_select_footer(); + $DSP->body .= $DSP->td_c(); + + $DSP->body .= '<td class="box" style="border-width: 0 0 1px; margin: 0; padding: 6px;">'; + $DSP->body .= $DSP->input_select_header('global_updated_entry_redirect'); + $DSP->body .= $DSP->input_select_option('none', $LANG->line('none'), 1); + foreach($locations as $location) { - foreach($query->result as $value) + $DSP->body .= $DSP->input_select_option($location, $LANG->line($location.'_lang')); + } + $DSP->body .= $DSP->input_select_footer(); + $DSP->body .= $DSP->td_c(); + + $DSP->body .= $DSP->tr_c(); + + // Per-weblog settings + $i = 1; + foreach($weblogs->result as $value) + { + $class = ($i % 2) ? 'tableCellTwo' : 'tableCellOne'; + extract($value); + + $DSP->body .= $DSP->tr(); + + $DSP->body .= $DSP->td($class); + $DSP->body .= $blog_title; + $DSP->body .= $DSP->td_c(); + + $DSP->body .= $DSP->td($class); + $DSP->body .= $DSP->input_select_header('new_redirect_weblog_id_'.$weblog_id); + foreach($locations as $location) + { + $DSP->body .= $DSP->input_select_option($location, $LANG->line($location.'_lang'), ( isset($current['new_redirect_weblog_id_'.$weblog_id]) && $current['new_redirect_weblog_id_'.$weblog_id] == $location) ? 1 : ''); + } + $DSP->body .= $DSP->input_select_footer(); + $DSP->body .= $DSP->td_c(); + + $DSP->body .= $DSP->td($class); + $DSP->body .= $DSP->input_select_header('updated_redirect_weblog_id_'.$weblog_id); + foreach($locations as $location) { - $LANG->language['new_redirect_weblog_id_'.$value['weblog_id']] = "Redirect after publishing new " . strtoupper($value['blog_title']) . ' entries:'; - $settings['new_redirect_weblog_id_'.$value['weblog_id']] = array('s', $locations, 'default'); - $LANG->language['updated_redirect_weblog_id_'.$value['weblog_id']] = "Redirect after updating " . strtoupper($value['blog_title']) . ' entries:'; - $settings['updated_redirect_weblog_id_'.$value['weblog_id']] = array('s', $locations, 'default'); } + $DSP->body .= $DSP->input_select_option($location, $LANG->line($location.'_lang'), ( isset($current['updated_redirect_weblog_id_'.$weblog_id]) && $current['updated_redirect_weblog_id_'.$weblog_id] == $location) ? 1 : ''); + } + $DSP->body .= $DSP->input_select_footer(); + $DSP->body .= $DSP->td_c(); + + $DSP->body .= $DSP->tr_c(); + + $i++; } + + // Setting for message display + $DSP->body .= $DSP->tr(); + + $DSP->body .= '<td class="box" style="border-width: 0 0 1px; margin: 0; padding: 6px;">'; + $DSP->body .= $LANG->line('hide_success_message'); + $DSP->body .= $DSP->td_c(); + + $DSP->body .= '<td colspan="2" class="box" style="border-width: 0 0 1px; margin: 0; padding: 6px;">'; + $DSP->body .= $DSP->input_text('hide_success_message', (isset($current['hide_success_message'])) ? $current['hide_success_message'] : '5', 10, '2', '', '50px'); + $DSP->body .= $DSP->td_c(); + + $DSP->body .= $DSP->tr_c(); - return $settings; + // Wrap it up + $DSP->body .= $DSP->table_c(); + $DSP->body .= $DSP->qdiv('itemWrapperTop', $DSP->input_submit()); + $DSP->body .= $DSP->form_c(); } // END + function save_settings() + { + global $DB; + + // Get all settings + $settings = $this->get_settings(TRUE); + + unset($_POST['name']); + unset($_POST['global_new_entry_redirect']); + unset($_POST['global_updated_entry_redirect']); + + // Only update the settings we just posted + // (Leave other sites' settings alone) + foreach($_POST as $k => $v) + { + $settings[$k] = $v; + } + + $data = array('settings' => addslashes(serialize($settings))); + $update = $DB->update_string('exp_extensions', $data, "class = 'Entry_reedirect'"); + $DB->query($update); + } + + + function get_settings($all_sites = FALSE) + { + global $DB, $PREFS, $REGX; + $site = $PREFS->ini('site_id'); + + $get_settings = $DB->query("SELECT settings FROM exp_extensions WHERE class = 'Entry_reedirect' LIMIT 1"); + if ($get_settings->num_rows > 0 && $get_settings->row['settings'] != '') + { + $settings = $REGX->array_stripslashes(unserialize($get_settings->row['settings'])); + $settings = ($all_sites == TRUE) ? $settings : $settings[$site]; + } + else + { + $settings = array(); + } + return $settings; + } + + // -------------------------------- // Put $_POST['return_url'] into a global variable so we can access it later // (No access to this variable from the other, more appropriate hooks) // -------------------------------- function grab_return_url() { global $saef_return_url; $saef_return_url = ($_POST['return_url']) ? $_POST['return_url'] : ''; } // END // -------------------------------- // Do the redirect // -------------------------------- function redirect_location($entry_id, $data, $cp_call) { if($cp_call == TRUE) { $type = ($_POST['entry_id']) ? 'updated' : 'new'; - $redirect = ($this->settings) ? $this->settings[$type.'_redirect_weblog_id_'.$data['weblog_id']] : ''; + $redirect = (!empty($this->settings) && isset($this->settings[$type.'_redirect_weblog_id_'.$data['weblog_id']])) ? $this->settings[$type.'_redirect_weblog_id_'.$data['weblog_id']] : ''; $default = BASE.AMP. 'C=edit'.AMP. 'M=view_entry'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'entry_id='.$entry_id.AMP. 'U='.$type; if($redirect) { switch($redirect) { case 'new': $location = BASE.AMP. 'C=publish'.AMP. 'M=entry_form'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; case 'remain': $location = BASE.AMP. 'C=edit'.AMP. 'M=edit_entry'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'entry_id='.$entry_id.AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; case 'edit': $location = BASE.AMP. 'C=edit'.AMP. 'M=view_entries'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; default: $location = $default; } } else { $location = $default; } } else { global $FNS, $saef_return_url; $FNS->template_type = 'webpage'; $location = ($saef_return_url == '') ? $FNS->fetch_site_index() : $FNS->create_url($saef_return_url, 1, 1); } return $location; } // END // -------------------------------- // Edits to the control panel output // -------------------------------- function cp_changes($out) { - global $DB, $EXT, $DSP, $LANG; + global $DB, $EXT, $DSP, $IN, $LANG; if ($EXT->last_call !== FALSE) { $out = $EXT->last_call; } // Add jQuery to extension settings page - if( (isset($_GET['P']) && $_GET['P'] == 'extension_settings') && $_GET['name'] == 'entry_reedirect') + if($IN->GBL('P') == 'extension_settings' && $IN->GBL('name') == 'entry_reedirect') { $target = '</head>'; $js = ' <script type="text/javascript"> <!-- Added by Entry REEdirect --> - $(document).ready(function() - { - if($("input[type=radio][name=global_new_entry_redirect]:checked").val() != "none") - { - $("select[name^=new_redirect]").attr("disabled", "disabled"); - } - if($("input[type=radio][name=global_updated_entry_redirect]:checked").val() != "none") + jQuery.noConflict(); + jQuery(document).ready(function($) + { + $("select[name=global_new_entry_redirect]").change(function(){ + var setValue = $(this).val(); + if(setValue != "none") { - $("select[name^=updated_redirect]").attr("disabled", "disabled"); - } - $("input[type=radio][name=global_new_entry_redirect][value!=none]").click(function(){ - var setValue = $(this).val(); $("select[name^=new_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=new_redirect]").attr("disabled", "disabled"); - }); - $("input[type=radio][name=global_updated_entry_redirect][value!=none]").click(function(){ - var setValue = $(this).val(); - $("select[name^=updated_redirect] option[value=" + setValue + "]").attr("selected", "selected"); - $("select[name^=updated_redirect]").attr("disabled", "disabled"); - - }); - $("input[type=radio][name=global_new_entry_redirect][value=none]").click(function(){ + } + else + { $("select[name^=new_redirect]").removeAttr("disabled"); - }); - $("input[type=radio][name=global_updated_entry_redirect][value=none]").click(function(){ + } + }); + $("select[name=global_updated_entry_redirect]").change(function(){ + var setValue = $(this).val(); + if(setValue != "none") + { + $("select[name^=updated_redirect] option[value=" + setValue + "]").attr("selected", "selected"); + $("select[name^=updated_redirect]").attr("disabled", "disabled"); + } + else + { $("select[name^=updated_redirect]").removeAttr("disabled"); - }); - $("form[name=settings_entry_reedirect]").submit(function(){ - $("select[name*=redirect_weblog_id]").removeAttr("disabled"); - }); - } - ); + } + }); + $("form[name=entry_reedirect]").submit(function(){ + $("select[name*=redirect_weblog_id]").removeAttr("disabled"); + }); + }); </script> </head> '; $out = str_replace($target, $js, $out); } // Display success messages $find = array(); $replace = array(); if(isset($_GET['reedirect_entry_id'])) { // Success message goes bye-bye? If so, add the callback. $auto_hide = ($this->settings['hide_success_message']) ? ',function(){ setTimeout( function(){ $("div#entry_reedirect_message").slideUp(); } ,'.($this->settings['hide_success_message']*1000).' ); }' : ''; $find[] = "<div id='contentNB'>"; $get_title = $DB->query("SELECT title FROM exp_weblog_titles WHERE entry_id = " . $DB->escape_str($_GET['reedirect_entry_id']) . " LIMIT 1"); $title = $get_title->row['title']; $message = "<div id='contentNB'> ".'<div id="entry_reedirect_message"><div>'.$DSP->span('success'); if($_GET['U'] == 'new') { $message .= $LANG->line('entry_has_been_added'); } elseif($_GET['U'] == 'updated') { $message .= $LANG->line('entry_has_been_updated'); } if($_GET['M'] != 'edit_entry') { $message .= ': '.$DSP->span_c(); $message .= $DSP->qspan('defaultBold', $title). $DSP->span('defaultSmall').$DSP->qspan('defaultLight', '&nbsp;|&nbsp;'). $DSP->anchor(BASE.AMP.'C=edit'.AMP.'M=edit_entry'.AMP. 'weblog_id='.$_GET['weblog_id'].AMP.'entry_id='.$_GET['reedirect_entry_id'], $LANG->line('edit_this_entry')). $DSP->span_c(); } else { $message .= $DSP->span_c(); } $message .= '<a href="#" id="reedirectClose" title="Hide this notice">&times;</a>' .$DSP->div_c().$DSP->div_c(); $replace[] = $message; $find[] = '</head>'; $replace[] = ' <style type="text/css"> - #entry_reedirect_message { - border-bottom:1px solid #CCC9A4; - position: fixed; - width: 100%; - left: 0; - top: 0; - display: none; - } - * html #entry_reedirect_message { - position: absolute; - } - #entry_reedirect_message div { - padding: 10px 15px; - background-color: rgb(252,252,222); - } - #entry_reedirect_message > div { - background-color: rgba(252,252,222,0.95); - } - a#reedirectClose { - display: block; - position: absolute; - right: 15px; - top: 7px; - padding: 0 3px; - border: 1px solid #CCC9A4; - font-size: 18px; - line-height: 18px; - color: #CCC9A4; - text-decoration: none; - -webkit-border-radius: 3px; - -moz-border-radius: 3px; - border-radius: 3px; - } - a#reedirectClose:hover { - background-color: #CCC9A4; - color: rgb(252,252,222); - } + #entry_reedirect_message { border-bottom:1px solid #CCC9A4; position: fixed; width: 100%; left: 0; top: 0; display: none; } + * html #entry_reedirect_message { position: absolute; } + #entry_reedirect_message div { padding: 10px 15px; background-color: rgb(252,252,222); } + #entry_reedirect_message > div { background-color: rgba(252,252,222,0.95); } + a#reedirectClose { display: block; position: absolute; right: 15px; top: 7px; padding: 0 3px; border: 1px solid #CCC9A4; font-size: 18px; line-height: 18px; color: #CCC9A4; text-decoration: none; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } + a#reedirectClose:hover { background-color: #CCC9A4; color: rgb(252,252,222); } </style> <script type="text/javascript"> <!-- Added by Entry REEdirect --> - $(document).ready(function(){ + jQuery.noConflict(); + jQuery(document).ready(function($) + { $("div#entry_reedirect_message").slideDown("normal"'.$auto_hide.'); $("a#reedirectClose").click(function(){ $("div#entry_reedirect_message").slideUp(); return false; }); }); </script> </head> '; $out = str_replace($find, $replace, $out); } // May as well make the other success messages a little nicer // (Delete and multi-entry category update. No message for multi-entry edit for some reason.) if( isset($_GET['C']) && $_GET['C'] == 'edit' && isset($_GET['M']) && ($_GET['M'] == 'delete_entries' || $_GET['M'] == 'entry_category_update')) { $target = "/<div class='success' >\s*([^<]*)\s*/"; $message = '<div class="box"><span class="success">$1</span>'; $out = preg_replace($target, $message, $out); } return $out; } // END // -------------------------------- // Activate Extension // -------------------------------- function activate_extension() { global $DB; $hooks = array( 'weblog_standalone_insert_entry' => 'grab_return_url', 'submit_new_entry_redirect' => 'redirect_location', 'show_full_control_panel_end' => 'cp_changes' ); foreach($hooks as $hook => $method) { $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Entry_reedirect", 'method' => $method, 'hook' => $hook, 'settings' => '', 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); } } // END // -------------------------------- // Update Extension // -------------------------------- function update_extension($current='') { global $DB; if ($current == '' OR $current == $this->version) { return FALSE; } $DB->query("UPDATE exp_extensions SET version = '".$DB->escape_str($this->version)."' WHERE class = 'Entry_reedirect'"); } // END // -------------------------------- // Disable Extension // -------------------------------- function disable_extension() { global $DB; $DB->query("DELETE FROM exp_extensions WHERE class = 'Entry_reedirect'"); } // END } // END CLASS \ No newline at end of file diff --git a/language/english/lang.entry_reedirect.php b/language/english/lang.entry_reedirect.php index 1e26080..72555e6 100644 --- a/language/english/lang.entry_reedirect.php +++ b/language/english/lang.entry_reedirect.php @@ -1,12 +1,13 @@ <?php - +global $PREFs; $L = array( - 'Default Preview' => 'Default Preview', - 'Publish Form' => 'Publish Form', - 'Edit Entry' => 'Edit Entry', - 'Manage Entries' => 'Manage Entries', - 'None' => 'None', - 'global_new_entry_redirect' => 'Global redirect after publishing new entries:', - 'global_updated_entry_redirect' => 'Global redirect after updating entries:', + 'default_lang' => 'Default Preview', + 'new_lang' => 'Publish Form', + 'remain_lang' => 'Edit Entry', + 'edit_lang' => 'Manage Entries', + 'none' => '--', + 'redirect_after_new' => 'Redirect after publishing new entries', + 'redirect_after_update' => 'Redirect after updating existing entries', + 'global_redirect' => 'Quick-set all '.$PREFS->ini('weblog_nomenclature').'s', 'hide_success_message' => 'Seconds until success message disappears (\'0\' for persistent)' ); \ No newline at end of file
blodt/ext.entry_reedirect.ee_addon
86c1b2961210975869ce6fb5ed46f349e5caba13
Added docs URL
diff --git a/extensions/ext.entry_reedirect.php b/extensions/ext.entry_reedirect.php index 5476e02..be8750f 100644 --- a/extensions/ext.entry_reedirect.php +++ b/extensions/ext.entry_reedirect.php @@ -1,404 +1,404 @@ <?php if(!defined('EXT')) { exit('Invalid file request'); } class Entry_reedirect { var $settings = array(); var $name = 'Entry REEdirect'; var $version = '1.0.3'; var $description = 'Choose where users are redirected after publishing/updating new entries in the control panel.'; var $settings_exist = 'y'; - var $docs_url = ''; + var $docs_url = 'http://github.com/amphibian/ext.entry_reedirect.ee_addon'; // ------------------------------- // Constructor - Extensions use this for settings // ------------------------------- function Entry_reedirect($settings='') { $this->settings = $settings; } // END // -------------------------------- // Settings // -------------------------------- function settings() { global $DB, $LANG, $PREFS; $settings = array(); $locations = array( 'default' => 'Default Preview', 'new' => 'Publish Form', 'remain' => 'Edit Entry', 'edit' => 'Manage Entries' ); $global_locations = $locations; $global_locations['none'] = 'None'; $settings['hide_success_message'] = '5'; $settings['global_new_entry_redirect'] = array('r', $global_locations, 'none'); $settings['global_updated_entry_redirect'] = array('r', $global_locations, 'none'); $query = $DB->query("SELECT blog_title, weblog_id FROM exp_weblogs ORDER BY blog_title ASC"); if($query->num_rows > 0) { foreach($query->result as $value) { $LANG->language['new_redirect_weblog_id_'.$value['weblog_id']] = "Redirect after publishing new " . strtoupper($value['blog_title']) . ' entries:'; $settings['new_redirect_weblog_id_'.$value['weblog_id']] = array('s', $locations, 'default'); $LANG->language['updated_redirect_weblog_id_'.$value['weblog_id']] = "Redirect after updating " . strtoupper($value['blog_title']) . ' entries:'; $settings['updated_redirect_weblog_id_'.$value['weblog_id']] = array('s', $locations, 'default'); } } return $settings; } // END // -------------------------------- // Put $_POST['return_url'] into a global variable so we can access it later // (No access to this variable from the other, more appropriate hooks) // -------------------------------- function grab_return_url() { global $saef_return_url; $saef_return_url = ($_POST['return_url']) ? $_POST['return_url'] : ''; } // END // -------------------------------- // Do the redirect // -------------------------------- function redirect_location($entry_id, $data, $cp_call) { if($cp_call == TRUE) { $type = ($_POST['entry_id']) ? 'updated' : 'new'; $redirect = ($this->settings) ? $this->settings[$type.'_redirect_weblog_id_'.$data['weblog_id']] : ''; $default = BASE.AMP. 'C=edit'.AMP. 'M=view_entry'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'entry_id='.$entry_id.AMP. 'U='.$type; if($redirect) { switch($redirect) { case 'new': $location = BASE.AMP. 'C=publish'.AMP. 'M=entry_form'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; case 'remain': $location = BASE.AMP. 'C=edit'.AMP. 'M=edit_entry'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'entry_id='.$entry_id.AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; case 'edit': $location = BASE.AMP. 'C=edit'.AMP. 'M=view_entries'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; default: $location = $default; } } else { $location = $default; } } else { global $FNS, $saef_return_url; $FNS->template_type = 'webpage'; $location = ($saef_return_url == '') ? $FNS->fetch_site_index() : $FNS->create_url($saef_return_url, 1, 1); } return $location; } // END // -------------------------------- // Edits to the control panel output // -------------------------------- function cp_changes($out) { global $DB, $EXT, $DSP, $LANG; if ($EXT->last_call !== FALSE) { $out = $EXT->last_call; } // Add jQuery to extension settings page if( (isset($_GET['P']) && $_GET['P'] == 'extension_settings') && $_GET['name'] == 'entry_reedirect') { $target = '</head>'; $js = ' <script type="text/javascript"> <!-- Added by Entry REEdirect --> $(document).ready(function() { if($("input[type=radio][name=global_new_entry_redirect]:checked").val() != "none") { $("select[name^=new_redirect]").attr("disabled", "disabled"); } if($("input[type=radio][name=global_updated_entry_redirect]:checked").val() != "none") { $("select[name^=updated_redirect]").attr("disabled", "disabled"); } $("input[type=radio][name=global_new_entry_redirect][value!=none]").click(function(){ var setValue = $(this).val(); $("select[name^=new_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=new_redirect]").attr("disabled", "disabled"); }); $("input[type=radio][name=global_updated_entry_redirect][value!=none]").click(function(){ var setValue = $(this).val(); $("select[name^=updated_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=updated_redirect]").attr("disabled", "disabled"); }); $("input[type=radio][name=global_new_entry_redirect][value=none]").click(function(){ $("select[name^=new_redirect]").removeAttr("disabled"); }); $("input[type=radio][name=global_updated_entry_redirect][value=none]").click(function(){ $("select[name^=updated_redirect]").removeAttr("disabled"); }); $("form[name=settings_entry_reedirect]").submit(function(){ $("select[name*=redirect_weblog_id]").removeAttr("disabled"); }); } ); </script> </head> '; $out = str_replace($target, $js, $out); } // Display success messages $find = array(); $replace = array(); if(isset($_GET['reedirect_entry_id'])) { // Success message goes bye-bye? If so, add the callback. $auto_hide = ($this->settings['hide_success_message']) ? ',function(){ setTimeout( function(){ $("div#entry_reedirect_message").slideUp(); } ,'.($this->settings['hide_success_message']*1000).' ); }' : ''; $find[] = "<div id='contentNB'>"; $get_title = $DB->query("SELECT title FROM exp_weblog_titles WHERE entry_id = " . $DB->escape_str($_GET['reedirect_entry_id']) . " LIMIT 1"); $title = $get_title->row['title']; $message = "<div id='contentNB'> ".'<div id="entry_reedirect_message"><div>'.$DSP->span('success'); if($_GET['U'] == 'new') { $message .= $LANG->line('entry_has_been_added'); } elseif($_GET['U'] == 'updated') { $message .= $LANG->line('entry_has_been_updated'); } if($_GET['M'] != 'edit_entry') { $message .= ': '.$DSP->span_c(); $message .= $DSP->qspan('defaultBold', $title). $DSP->span('defaultSmall').$DSP->qspan('defaultLight', '&nbsp;|&nbsp;'). $DSP->anchor(BASE.AMP.'C=edit'.AMP.'M=edit_entry'.AMP. 'weblog_id='.$_GET['weblog_id'].AMP.'entry_id='.$_GET['reedirect_entry_id'], $LANG->line('edit_this_entry')). $DSP->span_c(); } else { $message .= $DSP->span_c(); } $message .= '<a href="#" id="reedirectClose" title="Hide this notice">&times;</a>' .$DSP->div_c().$DSP->div_c(); $replace[] = $message; $find[] = '</head>'; $replace[] = ' <style type="text/css"> #entry_reedirect_message { border-bottom:1px solid #CCC9A4; position: fixed; width: 100%; left: 0; top: 0; display: none; } * html #entry_reedirect_message { position: absolute; } #entry_reedirect_message div { padding: 10px 15px; background-color: rgb(252,252,222); } #entry_reedirect_message > div { background-color: rgba(252,252,222,0.95); } a#reedirectClose { display: block; position: absolute; right: 15px; top: 7px; padding: 0 3px; border: 1px solid #CCC9A4; font-size: 18px; line-height: 18px; color: #CCC9A4; text-decoration: none; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } a#reedirectClose:hover { background-color: #CCC9A4; color: rgb(252,252,222); } </style> <script type="text/javascript"> <!-- Added by Entry REEdirect --> $(document).ready(function(){ $("div#entry_reedirect_message").slideDown("normal"'.$auto_hide.'); $("a#reedirectClose").click(function(){ $("div#entry_reedirect_message").slideUp(); return false; }); }); </script> </head> '; $out = str_replace($find, $replace, $out); } // May as well make the other success messages a little nicer // (Delete and multi-entry category update. No message for multi-entry edit for some reason.) if( isset($_GET['C']) && $_GET['C'] == 'edit' && isset($_GET['M']) && ($_GET['M'] == 'delete_entries' || $_GET['M'] == 'entry_category_update')) { $target = "/<div class='success' >\s*([^<]*)\s*/"; $message = '<div class="box"><span class="success">$1</span>'; $out = preg_replace($target, $message, $out); } return $out; } // END // -------------------------------- // Activate Extension // -------------------------------- function activate_extension() { global $DB; $hooks = array( 'weblog_standalone_insert_entry' => 'grab_return_url', 'submit_new_entry_redirect' => 'redirect_location', 'show_full_control_panel_end' => 'cp_changes' ); foreach($hooks as $hook => $method) { $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Entry_reedirect", 'method' => $method, 'hook' => $hook, - 'settings' => serialize($this->settings), + 'settings' => '', 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); } } // END // -------------------------------- // Update Extension // -------------------------------- function update_extension($current='') { global $DB; if ($current == '' OR $current == $this->version) { return FALSE; } $DB->query("UPDATE exp_extensions SET version = '".$DB->escape_str($this->version)."' WHERE class = 'Entry_reedirect'"); } // END // -------------------------------- // Disable Extension // -------------------------------- function disable_extension() { global $DB; $DB->query("DELETE FROM exp_extensions WHERE class = 'Entry_reedirect'"); } // END } // END CLASS \ No newline at end of file
blodt/ext.entry_reedirect.ee_addon
2e22bf35c6ff27c3d1f3f4a6e0135617c347e7b0
Further fixes for potential undefined variables notices
diff --git a/extensions/ext.entry_reedirect.php b/extensions/ext.entry_reedirect.php index 4511f13..5476e02 100644 --- a/extensions/ext.entry_reedirect.php +++ b/extensions/ext.entry_reedirect.php @@ -1,404 +1,404 @@ <?php if(!defined('EXT')) { exit('Invalid file request'); } class Entry_reedirect { var $settings = array(); var $name = 'Entry REEdirect'; var $version = '1.0.3'; var $description = 'Choose where users are redirected after publishing/updating new entries in the control panel.'; var $settings_exist = 'y'; var $docs_url = ''; // ------------------------------- // Constructor - Extensions use this for settings // ------------------------------- function Entry_reedirect($settings='') { $this->settings = $settings; } // END // -------------------------------- // Settings // -------------------------------- function settings() { global $DB, $LANG, $PREFS; $settings = array(); $locations = array( 'default' => 'Default Preview', 'new' => 'Publish Form', 'remain' => 'Edit Entry', 'edit' => 'Manage Entries' ); $global_locations = $locations; $global_locations['none'] = 'None'; $settings['hide_success_message'] = '5'; $settings['global_new_entry_redirect'] = array('r', $global_locations, 'none'); $settings['global_updated_entry_redirect'] = array('r', $global_locations, 'none'); $query = $DB->query("SELECT blog_title, weblog_id FROM exp_weblogs ORDER BY blog_title ASC"); if($query->num_rows > 0) { foreach($query->result as $value) { $LANG->language['new_redirect_weblog_id_'.$value['weblog_id']] = "Redirect after publishing new " . strtoupper($value['blog_title']) . ' entries:'; $settings['new_redirect_weblog_id_'.$value['weblog_id']] = array('s', $locations, 'default'); $LANG->language['updated_redirect_weblog_id_'.$value['weblog_id']] = "Redirect after updating " . strtoupper($value['blog_title']) . ' entries:'; $settings['updated_redirect_weblog_id_'.$value['weblog_id']] = array('s', $locations, 'default'); } } return $settings; } // END // -------------------------------- // Put $_POST['return_url'] into a global variable so we can access it later // (No access to this variable from the other, more appropriate hooks) // -------------------------------- function grab_return_url() { global $saef_return_url; $saef_return_url = ($_POST['return_url']) ? $_POST['return_url'] : ''; } // END // -------------------------------- // Do the redirect // -------------------------------- function redirect_location($entry_id, $data, $cp_call) { if($cp_call == TRUE) { $type = ($_POST['entry_id']) ? 'updated' : 'new'; - $redirect = $this->settings[$type.'_redirect_weblog_id_'.$data['weblog_id']]; + $redirect = ($this->settings) ? $this->settings[$type.'_redirect_weblog_id_'.$data['weblog_id']] : ''; $default = BASE.AMP. 'C=edit'.AMP. 'M=view_entry'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'entry_id='.$entry_id.AMP. 'U='.$type; if($redirect) { switch($redirect) { case 'new': $location = BASE.AMP. 'C=publish'.AMP. 'M=entry_form'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; case 'remain': $location = BASE.AMP. 'C=edit'.AMP. 'M=edit_entry'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'entry_id='.$entry_id.AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; case 'edit': $location = BASE.AMP. 'C=edit'.AMP. 'M=view_entries'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; default: $location = $default; } } else { $location = $default; } } else { global $FNS, $saef_return_url; $FNS->template_type = 'webpage'; $location = ($saef_return_url == '') ? $FNS->fetch_site_index() : $FNS->create_url($saef_return_url, 1, 1); } return $location; } // END // -------------------------------- // Edits to the control panel output // -------------------------------- function cp_changes($out) { global $DB, $EXT, $DSP, $LANG; if ($EXT->last_call !== FALSE) { $out = $EXT->last_call; } // Add jQuery to extension settings page if( (isset($_GET['P']) && $_GET['P'] == 'extension_settings') && $_GET['name'] == 'entry_reedirect') { $target = '</head>'; $js = ' <script type="text/javascript"> <!-- Added by Entry REEdirect --> $(document).ready(function() { if($("input[type=radio][name=global_new_entry_redirect]:checked").val() != "none") { $("select[name^=new_redirect]").attr("disabled", "disabled"); } if($("input[type=radio][name=global_updated_entry_redirect]:checked").val() != "none") { $("select[name^=updated_redirect]").attr("disabled", "disabled"); } $("input[type=radio][name=global_new_entry_redirect][value!=none]").click(function(){ var setValue = $(this).val(); $("select[name^=new_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=new_redirect]").attr("disabled", "disabled"); }); $("input[type=radio][name=global_updated_entry_redirect][value!=none]").click(function(){ var setValue = $(this).val(); $("select[name^=updated_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=updated_redirect]").attr("disabled", "disabled"); }); $("input[type=radio][name=global_new_entry_redirect][value=none]").click(function(){ $("select[name^=new_redirect]").removeAttr("disabled"); }); $("input[type=radio][name=global_updated_entry_redirect][value=none]").click(function(){ $("select[name^=updated_redirect]").removeAttr("disabled"); }); $("form[name=settings_entry_reedirect]").submit(function(){ $("select[name*=redirect_weblog_id]").removeAttr("disabled"); }); } ); </script> </head> '; $out = str_replace($target, $js, $out); } // Display success messages $find = array(); $replace = array(); if(isset($_GET['reedirect_entry_id'])) { // Success message goes bye-bye? If so, add the callback. $auto_hide = ($this->settings['hide_success_message']) ? ',function(){ setTimeout( function(){ $("div#entry_reedirect_message").slideUp(); } ,'.($this->settings['hide_success_message']*1000).' ); }' : ''; $find[] = "<div id='contentNB'>"; $get_title = $DB->query("SELECT title FROM exp_weblog_titles WHERE entry_id = " . $DB->escape_str($_GET['reedirect_entry_id']) . " LIMIT 1"); $title = $get_title->row['title']; $message = "<div id='contentNB'> ".'<div id="entry_reedirect_message"><div>'.$DSP->span('success'); if($_GET['U'] == 'new') { $message .= $LANG->line('entry_has_been_added'); } elseif($_GET['U'] == 'updated') { $message .= $LANG->line('entry_has_been_updated'); } if($_GET['M'] != 'edit_entry') { $message .= ': '.$DSP->span_c(); $message .= $DSP->qspan('defaultBold', $title). $DSP->span('defaultSmall').$DSP->qspan('defaultLight', '&nbsp;|&nbsp;'). $DSP->anchor(BASE.AMP.'C=edit'.AMP.'M=edit_entry'.AMP. 'weblog_id='.$_GET['weblog_id'].AMP.'entry_id='.$_GET['reedirect_entry_id'], $LANG->line('edit_this_entry')). $DSP->span_c(); } else { $message .= $DSP->span_c(); } $message .= '<a href="#" id="reedirectClose" title="Hide this notice">&times;</a>' .$DSP->div_c().$DSP->div_c(); $replace[] = $message; $find[] = '</head>'; $replace[] = ' <style type="text/css"> #entry_reedirect_message { border-bottom:1px solid #CCC9A4; position: fixed; width: 100%; left: 0; top: 0; display: none; } * html #entry_reedirect_message { position: absolute; } #entry_reedirect_message div { padding: 10px 15px; background-color: rgb(252,252,222); } #entry_reedirect_message > div { background-color: rgba(252,252,222,0.95); } a#reedirectClose { display: block; position: absolute; right: 15px; top: 7px; padding: 0 3px; border: 1px solid #CCC9A4; font-size: 18px; line-height: 18px; color: #CCC9A4; text-decoration: none; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } a#reedirectClose:hover { background-color: #CCC9A4; color: rgb(252,252,222); } </style> <script type="text/javascript"> <!-- Added by Entry REEdirect --> $(document).ready(function(){ $("div#entry_reedirect_message").slideDown("normal"'.$auto_hide.'); $("a#reedirectClose").click(function(){ $("div#entry_reedirect_message").slideUp(); return false; }); }); </script> </head> '; $out = str_replace($find, $replace, $out); } // May as well make the other success messages a little nicer // (Delete and multi-entry category update. No message for multi-entry edit for some reason.) if( isset($_GET['C']) && $_GET['C'] == 'edit' && isset($_GET['M']) && ($_GET['M'] == 'delete_entries' || $_GET['M'] == 'entry_category_update')) { $target = "/<div class='success' >\s*([^<]*)\s*/"; $message = '<div class="box"><span class="success">$1</span>'; $out = preg_replace($target, $message, $out); } return $out; } // END // -------------------------------- // Activate Extension // -------------------------------- function activate_extension() { global $DB; $hooks = array( 'weblog_standalone_insert_entry' => 'grab_return_url', 'submit_new_entry_redirect' => 'redirect_location', 'show_full_control_panel_end' => 'cp_changes' ); foreach($hooks as $hook => $method) { $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Entry_reedirect", 'method' => $method, 'hook' => $hook, 'settings' => serialize($this->settings), 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); } } // END // -------------------------------- // Update Extension // -------------------------------- function update_extension($current='') { global $DB; if ($current == '' OR $current == $this->version) { return FALSE; } $DB->query("UPDATE exp_extensions SET version = '".$DB->escape_str($this->version)."' WHERE class = 'Entry_reedirect'"); } // END // -------------------------------- // Disable Extension // -------------------------------- function disable_extension() { global $DB; $DB->query("DELETE FROM exp_extensions WHERE class = 'Entry_reedirect'"); } // END } // END CLASS \ No newline at end of file
blodt/ext.entry_reedirect.ee_addon
0b376f935111ee8dabd0fb181a5ac811c7e18b45
Added default settings array.
diff --git a/extensions/ext.entry_reedirect.php b/extensions/ext.entry_reedirect.php index 7d779b3..4511f13 100644 --- a/extensions/ext.entry_reedirect.php +++ b/extensions/ext.entry_reedirect.php @@ -1,404 +1,404 @@ <?php if(!defined('EXT')) { exit('Invalid file request'); } class Entry_reedirect { var $settings = array(); var $name = 'Entry REEdirect'; var $version = '1.0.3'; var $description = 'Choose where users are redirected after publishing/updating new entries in the control panel.'; var $settings_exist = 'y'; var $docs_url = ''; // ------------------------------- // Constructor - Extensions use this for settings // ------------------------------- function Entry_reedirect($settings='') { $this->settings = $settings; } // END // -------------------------------- // Settings // -------------------------------- function settings() { global $DB, $LANG, $PREFS; $settings = array(); $locations = array( 'default' => 'Default Preview', 'new' => 'Publish Form', 'remain' => 'Edit Entry', 'edit' => 'Manage Entries' ); $global_locations = $locations; $global_locations['none'] = 'None'; $settings['hide_success_message'] = '5'; $settings['global_new_entry_redirect'] = array('r', $global_locations, 'none'); $settings['global_updated_entry_redirect'] = array('r', $global_locations, 'none'); $query = $DB->query("SELECT blog_title, weblog_id FROM exp_weblogs ORDER BY blog_title ASC"); if($query->num_rows > 0) { foreach($query->result as $value) { $LANG->language['new_redirect_weblog_id_'.$value['weblog_id']] = "Redirect after publishing new " . strtoupper($value['blog_title']) . ' entries:'; $settings['new_redirect_weblog_id_'.$value['weblog_id']] = array('s', $locations, 'default'); $LANG->language['updated_redirect_weblog_id_'.$value['weblog_id']] = "Redirect after updating " . strtoupper($value['blog_title']) . ' entries:'; $settings['updated_redirect_weblog_id_'.$value['weblog_id']] = array('s', $locations, 'default'); } } return $settings; } // END // -------------------------------- // Put $_POST['return_url'] into a global variable so we can access it later // (No access to this variable from the other, more appropriate hooks) // -------------------------------- function grab_return_url() { global $saef_return_url; $saef_return_url = ($_POST['return_url']) ? $_POST['return_url'] : ''; } // END // -------------------------------- // Do the redirect // -------------------------------- function redirect_location($entry_id, $data, $cp_call) { if($cp_call == TRUE) { $type = ($_POST['entry_id']) ? 'updated' : 'new'; $redirect = $this->settings[$type.'_redirect_weblog_id_'.$data['weblog_id']]; $default = BASE.AMP. 'C=edit'.AMP. 'M=view_entry'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'entry_id='.$entry_id.AMP. 'U='.$type; if($redirect) { switch($redirect) { case 'new': $location = BASE.AMP. 'C=publish'.AMP. 'M=entry_form'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; case 'remain': $location = BASE.AMP. 'C=edit'.AMP. 'M=edit_entry'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'entry_id='.$entry_id.AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; case 'edit': $location = BASE.AMP. 'C=edit'.AMP. 'M=view_entries'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; default: $location = $default; } } else { $location = $default; } } else { global $FNS, $saef_return_url; $FNS->template_type = 'webpage'; $location = ($saef_return_url == '') ? $FNS->fetch_site_index() : $FNS->create_url($saef_return_url, 1, 1); } return $location; } // END // -------------------------------- // Edits to the control panel output // -------------------------------- function cp_changes($out) { global $DB, $EXT, $DSP, $LANG; if ($EXT->last_call !== FALSE) { $out = $EXT->last_call; } // Add jQuery to extension settings page if( (isset($_GET['P']) && $_GET['P'] == 'extension_settings') && $_GET['name'] == 'entry_reedirect') { $target = '</head>'; $js = ' <script type="text/javascript"> <!-- Added by Entry REEdirect --> $(document).ready(function() { if($("input[type=radio][name=global_new_entry_redirect]:checked").val() != "none") { $("select[name^=new_redirect]").attr("disabled", "disabled"); } if($("input[type=radio][name=global_updated_entry_redirect]:checked").val() != "none") { $("select[name^=updated_redirect]").attr("disabled", "disabled"); } $("input[type=radio][name=global_new_entry_redirect][value!=none]").click(function(){ var setValue = $(this).val(); $("select[name^=new_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=new_redirect]").attr("disabled", "disabled"); }); $("input[type=radio][name=global_updated_entry_redirect][value!=none]").click(function(){ var setValue = $(this).val(); $("select[name^=updated_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=updated_redirect]").attr("disabled", "disabled"); }); $("input[type=radio][name=global_new_entry_redirect][value=none]").click(function(){ $("select[name^=new_redirect]").removeAttr("disabled"); }); $("input[type=radio][name=global_updated_entry_redirect][value=none]").click(function(){ $("select[name^=updated_redirect]").removeAttr("disabled"); }); $("form[name=settings_entry_reedirect]").submit(function(){ $("select[name*=redirect_weblog_id]").removeAttr("disabled"); }); } ); </script> </head> '; $out = str_replace($target, $js, $out); } // Display success messages $find = array(); $replace = array(); if(isset($_GET['reedirect_entry_id'])) { // Success message goes bye-bye? If so, add the callback. $auto_hide = ($this->settings['hide_success_message']) ? ',function(){ setTimeout( function(){ $("div#entry_reedirect_message").slideUp(); } ,'.($this->settings['hide_success_message']*1000).' ); }' : ''; $find[] = "<div id='contentNB'>"; $get_title = $DB->query("SELECT title FROM exp_weblog_titles WHERE entry_id = " . $DB->escape_str($_GET['reedirect_entry_id']) . " LIMIT 1"); $title = $get_title->row['title']; $message = "<div id='contentNB'> ".'<div id="entry_reedirect_message"><div>'.$DSP->span('success'); if($_GET['U'] == 'new') { $message .= $LANG->line('entry_has_been_added'); } elseif($_GET['U'] == 'updated') { $message .= $LANG->line('entry_has_been_updated'); } if($_GET['M'] != 'edit_entry') { $message .= ': '.$DSP->span_c(); $message .= $DSP->qspan('defaultBold', $title). $DSP->span('defaultSmall').$DSP->qspan('defaultLight', '&nbsp;|&nbsp;'). $DSP->anchor(BASE.AMP.'C=edit'.AMP.'M=edit_entry'.AMP. 'weblog_id='.$_GET['weblog_id'].AMP.'entry_id='.$_GET['reedirect_entry_id'], $LANG->line('edit_this_entry')). $DSP->span_c(); } else { $message .= $DSP->span_c(); } $message .= '<a href="#" id="reedirectClose" title="Hide this notice">&times;</a>' .$DSP->div_c().$DSP->div_c(); $replace[] = $message; $find[] = '</head>'; $replace[] = ' <style type="text/css"> #entry_reedirect_message { border-bottom:1px solid #CCC9A4; position: fixed; width: 100%; left: 0; top: 0; display: none; } * html #entry_reedirect_message { position: absolute; } #entry_reedirect_message div { padding: 10px 15px; background-color: rgb(252,252,222); } #entry_reedirect_message > div { background-color: rgba(252,252,222,0.95); } a#reedirectClose { display: block; position: absolute; right: 15px; top: 7px; padding: 0 3px; border: 1px solid #CCC9A4; font-size: 18px; line-height: 18px; color: #CCC9A4; text-decoration: none; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } a#reedirectClose:hover { background-color: #CCC9A4; color: rgb(252,252,222); } </style> <script type="text/javascript"> <!-- Added by Entry REEdirect --> $(document).ready(function(){ $("div#entry_reedirect_message").slideDown("normal"'.$auto_hide.'); $("a#reedirectClose").click(function(){ $("div#entry_reedirect_message").slideUp(); return false; }); }); </script> </head> '; $out = str_replace($find, $replace, $out); } // May as well make the other success messages a little nicer // (Delete and multi-entry category update. No message for multi-entry edit for some reason.) if( isset($_GET['C']) && $_GET['C'] == 'edit' && isset($_GET['M']) && ($_GET['M'] == 'delete_entries' || $_GET['M'] == 'entry_category_update')) { $target = "/<div class='success' >\s*([^<]*)\s*/"; $message = '<div class="box"><span class="success">$1</span>'; $out = preg_replace($target, $message, $out); } return $out; } // END // -------------------------------- // Activate Extension // -------------------------------- function activate_extension() { global $DB; $hooks = array( 'weblog_standalone_insert_entry' => 'grab_return_url', 'submit_new_entry_redirect' => 'redirect_location', 'show_full_control_panel_end' => 'cp_changes' ); foreach($hooks as $hook => $method) { $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Entry_reedirect", 'method' => $method, 'hook' => $hook, - 'settings' => "", + 'settings' => serialize($this->settings), 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); } } // END // -------------------------------- // Update Extension // -------------------------------- function update_extension($current='') { global $DB; if ($current == '' OR $current == $this->version) { return FALSE; } $DB->query("UPDATE exp_extensions SET version = '".$DB->escape_str($this->version)."' WHERE class = 'Entry_reedirect'"); } // END // -------------------------------- // Disable Extension // -------------------------------- function disable_extension() { global $DB; $DB->query("DELETE FROM exp_extensions WHERE class = 'Entry_reedirect'"); } // END } // END CLASS \ No newline at end of file
blodt/ext.entry_reedirect.ee_addon
47975f6ac1b4deee11436a9168a168b99c9bbb9a
Fixed some PHP notices, some code cleanup
diff --git a/extensions/ext.entry_reedirect.php b/extensions/ext.entry_reedirect.php index 84995d4..7d779b3 100644 --- a/extensions/ext.entry_reedirect.php +++ b/extensions/ext.entry_reedirect.php @@ -1,415 +1,404 @@ <?php if(!defined('EXT')) { exit('Invalid file request'); } class Entry_reedirect { var $settings = array(); var $name = 'Entry REEdirect'; var $version = '1.0.3'; var $description = 'Choose where users are redirected after publishing/updating new entries in the control panel.'; var $settings_exist = 'y'; var $docs_url = ''; // ------------------------------- // Constructor - Extensions use this for settings // ------------------------------- function Entry_reedirect($settings='') { $this->settings = $settings; } // END // -------------------------------- // Settings // -------------------------------- function settings() { global $DB, $LANG, $PREFS; $settings = array(); $locations = array( 'default' => 'Default Preview', 'new' => 'Publish Form', 'remain' => 'Edit Entry', 'edit' => 'Manage Entries' ); $global_locations = $locations; $global_locations['none'] = 'None'; $settings['hide_success_message'] = '5'; $settings['global_new_entry_redirect'] = array('r', $global_locations, 'none'); $settings['global_updated_entry_redirect'] = array('r', $global_locations, 'none'); $query = $DB->query("SELECT blog_title, weblog_id FROM exp_weblogs ORDER BY blog_title ASC"); if($query->num_rows > 0) { foreach($query->result as $value) { $LANG->language['new_redirect_weblog_id_'.$value['weblog_id']] = "Redirect after publishing new " . strtoupper($value['blog_title']) . ' entries:'; $settings['new_redirect_weblog_id_'.$value['weblog_id']] = array('s', $locations, 'default'); $LANG->language['updated_redirect_weblog_id_'.$value['weblog_id']] = "Redirect after updating " . strtoupper($value['blog_title']) . ' entries:'; $settings['updated_redirect_weblog_id_'.$value['weblog_id']] = array('s', $locations, 'default'); } } return $settings; } // END // -------------------------------- // Put $_POST['return_url'] into a global variable so we can access it later // (No access to this variable from the other, more appropriate hooks) // -------------------------------- function grab_return_url() { global $saef_return_url; $saef_return_url = ($_POST['return_url']) ? $_POST['return_url'] : ''; } // END // -------------------------------- // Do the redirect // -------------------------------- function redirect_location($entry_id, $data, $cp_call) { if($cp_call == TRUE) { $type = ($_POST['entry_id']) ? 'updated' : 'new'; + $redirect = $this->settings[$type.'_redirect_weblog_id_'.$data['weblog_id']]; + $default = BASE.AMP. + 'C=edit'.AMP. + 'M=view_entry'.AMP. + 'weblog_id='.$data['weblog_id'].AMP. + 'entry_id='.$entry_id.AMP. + 'U='.$type; - switch($this->settings[$type.'_redirect_weblog_id_'.$data['weblog_id']]) + if($redirect) { - case 'new': - $location = BASE.AMP. - 'C=publish'.AMP. - 'M=entry_form'.AMP. - 'weblog_id='.$data['weblog_id'].AMP. - 'reedirect_entry_id='.$entry_id.AMP. - 'U='.$type; - break; - case 'remain': - $location = BASE.AMP. - 'C=edit'.AMP. - 'M=edit_entry'.AMP. - 'weblog_id='.$data['weblog_id'].AMP. - 'entry_id='.$entry_id.AMP. - 'reedirect_entry_id='.$entry_id.AMP. - 'U='.$type; - break; - case 'edit': - $location = BASE.AMP. - 'C=edit'.AMP. - 'M=view_entries'.AMP. - 'weblog_id='.$data['weblog_id'].AMP. - 'reedirect_entry_id='.$entry_id.AMP. - 'U='.$type; - break; - default: - $location = BASE.AMP. - 'C=edit'.AMP. - 'M=view_entry'.AMP. - 'weblog_id='.$data['weblog_id'].AMP. - 'entry_id='.$entry_id.AMP. - 'U='.$type; + switch($redirect) + { + case 'new': + $location = BASE.AMP. + 'C=publish'.AMP. + 'M=entry_form'.AMP. + 'weblog_id='.$data['weblog_id'].AMP. + 'reedirect_entry_id='.$entry_id.AMP. + 'U='.$type; + break; + case 'remain': + $location = BASE.AMP. + 'C=edit'.AMP. + 'M=edit_entry'.AMP. + 'weblog_id='.$data['weblog_id'].AMP. + 'entry_id='.$entry_id.AMP. + 'reedirect_entry_id='.$entry_id.AMP. + 'U='.$type; + break; + case 'edit': + $location = BASE.AMP. + 'C=edit'.AMP. + 'M=view_entries'.AMP. + 'weblog_id='.$data['weblog_id'].AMP. + 'reedirect_entry_id='.$entry_id.AMP. + 'U='.$type; + break; + default: + $location = $default; + } + } + else + { + $location = $default; } } else { global $FNS, $saef_return_url; $FNS->template_type = 'webpage'; $location = ($saef_return_url == '') ? $FNS->fetch_site_index() : $FNS->create_url($saef_return_url, 1, 1); } return $location; } // END // -------------------------------- // Edits to the control panel output // -------------------------------- function cp_changes($out) { global $DB, $EXT, $DSP, $LANG; if ($EXT->last_call !== FALSE) { $out = $EXT->last_call; } // Add jQuery to extension settings page if( (isset($_GET['P']) && $_GET['P'] == 'extension_settings') && $_GET['name'] == 'entry_reedirect') { $target = '</head>'; $js = ' <script type="text/javascript"> <!-- Added by Entry REEdirect --> $(document).ready(function() { if($("input[type=radio][name=global_new_entry_redirect]:checked").val() != "none") { $("select[name^=new_redirect]").attr("disabled", "disabled"); } if($("input[type=radio][name=global_updated_entry_redirect]:checked").val() != "none") { $("select[name^=updated_redirect]").attr("disabled", "disabled"); } $("input[type=radio][name=global_new_entry_redirect][value!=none]").click(function(){ var setValue = $(this).val(); $("select[name^=new_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=new_redirect]").attr("disabled", "disabled"); }); $("input[type=radio][name=global_updated_entry_redirect][value!=none]").click(function(){ var setValue = $(this).val(); $("select[name^=updated_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=updated_redirect]").attr("disabled", "disabled"); }); $("input[type=radio][name=global_new_entry_redirect][value=none]").click(function(){ $("select[name^=new_redirect]").removeAttr("disabled"); }); $("input[type=radio][name=global_updated_entry_redirect][value=none]").click(function(){ $("select[name^=updated_redirect]").removeAttr("disabled"); }); $("form[name=settings_entry_reedirect]").submit(function(){ $("select[name*=redirect_weblog_id]").removeAttr("disabled"); }); } ); </script> </head> '; $out = str_replace($target, $js, $out); } // Display success messages $find = array(); $replace = array(); if(isset($_GET['reedirect_entry_id'])) { // Success message goes bye-bye? If so, add the callback. $auto_hide = ($this->settings['hide_success_message']) ? ',function(){ setTimeout( function(){ $("div#entry_reedirect_message").slideUp(); } ,'.($this->settings['hide_success_message']*1000).' ); }' : ''; $find[] = "<div id='contentNB'>"; - $get_title = $DB->query("SELECT title FROM exp_weblog_titles - WHERE entry_id = " . $DB->escape_str($_GET['reedirect_entry_id']) . " LIMIT 1"); - $title = $get_title->row['title']; - - $message = "<div id='contentNB'> - ".'<div id="entry_reedirect_message"><div>'.$DSP->span('success'); - if($_GET['U'] == 'new') - { - $message .= $LANG->line('entry_has_been_added'); - } - elseif($_GET['U'] == 'updated') - { - $message .= $LANG->line('entry_has_been_updated'); - } - - if($_GET['M'] != 'edit_entry') - { - $message .= ': '.$DSP->span_c(); - $message .= $DSP->qspan('defaultBold', $title). - $DSP->span('defaultSmall').$DSP->qspan('defaultLight', '&nbsp;|&nbsp;'). - $DSP->anchor(BASE.AMP.'C=edit'.AMP.'M=edit_entry'.AMP. - 'weblog_id='.$_GET['weblog_id'].AMP.'entry_id='.$_GET['reedirect_entry_id'], - $LANG->line('edit_this_entry')). - $DSP->span_c(); - } - else - { - $message .= $DSP->span_c(); - } - - $message .= '<a href="#" id="reedirectClose" title="Hide this notice">&times;</a>' - .$DSP->div_c().$DSP->div_c(); + $get_title = $DB->query("SELECT title FROM exp_weblog_titles + WHERE entry_id = " . $DB->escape_str($_GET['reedirect_entry_id']) . " LIMIT 1"); + $title = $get_title->row['title']; + + $message = "<div id='contentNB'> + ".'<div id="entry_reedirect_message"><div>'.$DSP->span('success'); + if($_GET['U'] == 'new') + { + $message .= $LANG->line('entry_has_been_added'); + } + elseif($_GET['U'] == 'updated') + { + $message .= $LANG->line('entry_has_been_updated'); + } + + if($_GET['M'] != 'edit_entry') + { + $message .= ': '.$DSP->span_c(); + $message .= $DSP->qspan('defaultBold', $title). + $DSP->span('defaultSmall').$DSP->qspan('defaultLight', '&nbsp;|&nbsp;'). + $DSP->anchor(BASE.AMP.'C=edit'.AMP.'M=edit_entry'.AMP. + 'weblog_id='.$_GET['weblog_id'].AMP.'entry_id='.$_GET['reedirect_entry_id'], + $LANG->line('edit_this_entry')). + $DSP->span_c(); + } + else + { + $message .= $DSP->span_c(); + } + + $message .= '<a href="#" id="reedirectClose" title="Hide this notice">&times;</a>' + .$DSP->div_c().$DSP->div_c(); $replace[] = $message; $find[] = '</head>'; $replace[] = ' <style type="text/css"> #entry_reedirect_message { border-bottom:1px solid #CCC9A4; position: fixed; width: 100%; left: 0; top: 0; display: none; } * html #entry_reedirect_message { position: absolute; } #entry_reedirect_message div { padding: 10px 15px; background-color: rgb(252,252,222); } #entry_reedirect_message > div { background-color: rgba(252,252,222,0.95); } a#reedirectClose { display: block; position: absolute; right: 15px; top: 7px; padding: 0 3px; border: 1px solid #CCC9A4; font-size: 18px; line-height: 18px; color: #CCC9A4; text-decoration: none; -webkit-border-radius: 3px; -moz-border-radius: 3px; border-radius: 3px; } a#reedirectClose:hover { background-color: #CCC9A4; color: rgb(252,252,222); } </style> <script type="text/javascript"> <!-- Added by Entry REEdirect --> $(document).ready(function(){ $("div#entry_reedirect_message").slideDown("normal"'.$auto_hide.'); $("a#reedirectClose").click(function(){ $("div#entry_reedirect_message").slideUp(); return false; }); }); </script> </head> '; $out = str_replace($find, $replace, $out); } // May as well make the other success messages a little nicer // (Delete and multi-entry category update. No message for multi-entry edit for some reason.) if( isset($_GET['C']) && $_GET['C'] == 'edit' && isset($_GET['M']) && ($_GET['M'] == 'delete_entries' || $_GET['M'] == 'entry_category_update')) { $target = "/<div class='success' >\s*([^<]*)\s*/"; $message = '<div class="box"><span class="success">$1</span>'; $out = preg_replace($target, $message, $out); } return $out; } // END // -------------------------------- // Activate Extension // -------------------------------- function activate_extension() { global $DB; - $DB->query($DB->insert_string('exp_extensions', - array( - 'extension_id' => '', - 'class' => "Entry_reedirect", - 'method' => "grab_return_url", - 'hook' => "weblog_standalone_insert_entry", - 'settings' => "", - 'priority' => 10, - 'version' => $this->version, - 'enabled' => "y" - ) - ) - ); - - $DB->query($DB->insert_string('exp_extensions', - array( - 'extension_id' => '', - 'class' => "Entry_reedirect", - 'method' => "redirect_location", - 'hook' => "submit_new_entry_redirect", - 'settings' => "", - 'priority' => 10, - 'version' => $this->version, - 'enabled' => "y" - ) - ) - ); - - $DB->query($DB->insert_string('exp_extensions', - array( - 'extension_id' => '', - 'class' => "Entry_reedirect", - 'method' => "cp_changes", - 'hook' => "show_full_control_panel_end", - 'settings' => "", - 'priority' => 10, - 'version' => $this->version, - 'enabled' => "y" + $hooks = array( + 'weblog_standalone_insert_entry' => 'grab_return_url', + 'submit_new_entry_redirect' => 'redirect_location', + 'show_full_control_panel_end' => 'cp_changes' + ); + + foreach($hooks as $hook => $method) + { + $DB->query($DB->insert_string('exp_extensions', + array( + 'extension_id' => '', + 'class' => "Entry_reedirect", + 'method' => $method, + 'hook' => $hook, + 'settings' => "", + 'priority' => 10, + 'version' => $this->version, + 'enabled' => "y" + ) ) - ) - ); - + ); + } } // END // -------------------------------- // Update Extension // -------------------------------- function update_extension($current='') { global $DB; if ($current == '' OR $current == $this->version) { return FALSE; } $DB->query("UPDATE exp_extensions SET version = '".$DB->escape_str($this->version)."' WHERE class = 'Entry_reedirect'"); } // END // -------------------------------- // Disable Extension // -------------------------------- function disable_extension() { global $DB; $DB->query("DELETE FROM exp_extensions WHERE class = 'Entry_reedirect'"); } // END } // END CLASS \ No newline at end of file
blodt/ext.entry_reedirect.ee_addon
6a25859edb9038e778dacb2d6a06bca76d758824
Turned success message into an overlay and added a close link.
diff --git a/README.markdown b/README.markdown index a698918..59f8cf5 100644 --- a/README.markdown +++ b/README.markdown @@ -1,16 +1,16 @@ Entry REEdirect is an ExpressionEngine extension that allows you to control, on a per-weblog basis, where authors land after publishing or updating entries in the ExpressionEngine control panel. For each weblog you have four redirect location options for both **new entries** and **updated entries**: - **Default Preview** - EE's built-in success screen with ugly entry preview - **Publish Form** - new entry screen for the same weblog you just published to - **Edit Entry** - keep editing the entry you just published or updated - **Manage Entries** - the Edit tab, filtered to display entries from the weblog you just published to -In all cases the author will see a "success" message for their new entry or update, along with the entry's title and an "Edit this entry" link. This success message can optionally disappear after a specified length of time. +In all cases the author will see a "success" message for their new entry or update, along with the entry's title and an "Edit this entry" link. This success message can optionally disappear after a specified length of time, and has a "close" link as well. The Extension Settings screen offers optional one-click setting of all of your weblogs to the same option for both new entries and updated entries. Entries submitted via SAEFs will be be unaffected by this extension. Entry REEdirect requires jQuery for the Control Panel (loading jQuery 1.3 or newer), and has been tested with ExpressionEngine 1.6.8. \ No newline at end of file diff --git a/extensions/ext.entry_reedirect.php b/extensions/ext.entry_reedirect.php index 7154f9f..84995d4 100644 --- a/extensions/ext.entry_reedirect.php +++ b/extensions/ext.entry_reedirect.php @@ -1,351 +1,415 @@ <?php if(!defined('EXT')) { exit('Invalid file request'); } class Entry_reedirect { var $settings = array(); var $name = 'Entry REEdirect'; - var $version = '1.0.2'; + var $version = '1.0.3'; var $description = 'Choose where users are redirected after publishing/updating new entries in the control panel.'; var $settings_exist = 'y'; var $docs_url = ''; // ------------------------------- // Constructor - Extensions use this for settings // ------------------------------- function Entry_reedirect($settings='') { $this->settings = $settings; } // END // -------------------------------- // Settings // -------------------------------- function settings() { global $DB, $LANG, $PREFS; $settings = array(); $locations = array( 'default' => 'Default Preview', 'new' => 'Publish Form', 'remain' => 'Edit Entry', 'edit' => 'Manage Entries' ); $global_locations = $locations; $global_locations['none'] = 'None'; $settings['hide_success_message'] = '5'; $settings['global_new_entry_redirect'] = array('r', $global_locations, 'none'); $settings['global_updated_entry_redirect'] = array('r', $global_locations, 'none'); $query = $DB->query("SELECT blog_title, weblog_id FROM exp_weblogs ORDER BY blog_title ASC"); if($query->num_rows > 0) { foreach($query->result as $value) { $LANG->language['new_redirect_weblog_id_'.$value['weblog_id']] = "Redirect after publishing new " . strtoupper($value['blog_title']) . ' entries:'; $settings['new_redirect_weblog_id_'.$value['weblog_id']] = array('s', $locations, 'default'); $LANG->language['updated_redirect_weblog_id_'.$value['weblog_id']] = "Redirect after updating " . strtoupper($value['blog_title']) . ' entries:'; $settings['updated_redirect_weblog_id_'.$value['weblog_id']] = array('s', $locations, 'default'); } } return $settings; } // END // -------------------------------- // Put $_POST['return_url'] into a global variable so we can access it later // (No access to this variable from the other, more appropriate hooks) // -------------------------------- function grab_return_url() { global $saef_return_url; $saef_return_url = ($_POST['return_url']) ? $_POST['return_url'] : ''; } // END // -------------------------------- // Do the redirect // -------------------------------- function redirect_location($entry_id, $data, $cp_call) { if($cp_call == TRUE) { $type = ($_POST['entry_id']) ? 'updated' : 'new'; switch($this->settings[$type.'_redirect_weblog_id_'.$data['weblog_id']]) { case 'new': $location = BASE.AMP. 'C=publish'.AMP. 'M=entry_form'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; case 'remain': $location = BASE.AMP. 'C=edit'.AMP. 'M=edit_entry'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'entry_id='.$entry_id.AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; case 'edit': $location = BASE.AMP. 'C=edit'.AMP. 'M=view_entries'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; default: $location = BASE.AMP. 'C=edit'.AMP. 'M=view_entry'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'entry_id='.$entry_id.AMP. 'U='.$type; } } else { global $FNS, $saef_return_url; $FNS->template_type = 'webpage'; $location = ($saef_return_url == '') ? $FNS->fetch_site_index() : $FNS->create_url($saef_return_url, 1, 1); } return $location; } // END // -------------------------------- // Edits to the control panel output // -------------------------------- function cp_changes($out) { global $DB, $EXT, $DSP, $LANG; if ($EXT->last_call !== FALSE) { $out = $EXT->last_call; } // Add jQuery to extension settings page if( (isset($_GET['P']) && $_GET['P'] == 'extension_settings') && $_GET['name'] == 'entry_reedirect') { $target = '</head>'; $js = ' <script type="text/javascript"> <!-- Added by Entry REEdirect --> $(document).ready(function() { if($("input[type=radio][name=global_new_entry_redirect]:checked").val() != "none") { $("select[name^=new_redirect]").attr("disabled", "disabled"); } if($("input[type=radio][name=global_updated_entry_redirect]:checked").val() != "none") { $("select[name^=updated_redirect]").attr("disabled", "disabled"); } $("input[type=radio][name=global_new_entry_redirect][value!=none]").click(function(){ var setValue = $(this).val(); $("select[name^=new_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=new_redirect]").attr("disabled", "disabled"); }); $("input[type=radio][name=global_updated_entry_redirect][value!=none]").click(function(){ var setValue = $(this).val(); $("select[name^=updated_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=updated_redirect]").attr("disabled", "disabled"); }); $("input[type=radio][name=global_new_entry_redirect][value=none]").click(function(){ $("select[name^=new_redirect]").removeAttr("disabled"); }); $("input[type=radio][name=global_updated_entry_redirect][value=none]").click(function(){ $("select[name^=updated_redirect]").removeAttr("disabled"); }); $("form[name=settings_entry_reedirect]").submit(function(){ $("select[name*=redirect_weblog_id]").removeAttr("disabled"); }); } ); </script> </head> '; $out = str_replace($target, $js, $out); } + // Display success messages + $find = array(); + $replace = array(); + if(isset($_GET['reedirect_entry_id'])) { - $target = "<div id='contentNB'>"; + // Success message goes bye-bye? If so, add the callback. + $auto_hide = ($this->settings['hide_success_message']) ? ',function(){ + setTimeout( + function(){ + $("div#entry_reedirect_message").slideUp(); + } + ,'.($this->settings['hide_success_message']*1000).' + ); + }' : ''; - $get_title = $DB->query("SELECT title FROM exp_weblog_titles WHERE entry_id = " . $DB->escape_str($_GET['reedirect_entry_id']) . " LIMIT 1"); - $title = $get_title->row['title']; + $find[] = "<div id='contentNB'>"; - $message = $target.'<div id="entry_reedirect_message" class="box">'.$DSP->span('success'); - if($_GET['U'] == 'new') - { - $message .= $LANG->line('entry_has_been_added'); - } - elseif($_GET['U'] == 'updated') - { - $message .= $LANG->line('entry_has_been_updated'); - } - - if($_GET['M'] != 'edit_entry') - { - $message .= ': '.$DSP->span_c(); - $message .= $DSP->qspan('defaultBold', $title). - $DSP->span('defaultSmall').$DSP->qspan('defaultLight', '&nbsp;|&nbsp;'). - $DSP->anchor(BASE.AMP.'C=edit'.AMP.'M=edit_entry'.AMP.'weblog_id='.$_GET['weblog_id'].AMP.'entry_id='.$_GET['reedirect_entry_id'], $LANG->line('edit_this_entry')). - $DSP->span_c(); - } - else - { - $message .= $DSP->span_c(); - } + $get_title = $DB->query("SELECT title FROM exp_weblog_titles + WHERE entry_id = " . $DB->escape_str($_GET['reedirect_entry_id']) . " LIMIT 1"); + $title = $get_title->row['title']; + + $message = "<div id='contentNB'> + ".'<div id="entry_reedirect_message"><div>'.$DSP->span('success'); + if($_GET['U'] == 'new') + { + $message .= $LANG->line('entry_has_been_added'); + } + elseif($_GET['U'] == 'updated') + { + $message .= $LANG->line('entry_has_been_updated'); + } + + if($_GET['M'] != 'edit_entry') + { + $message .= ': '.$DSP->span_c(); + $message .= $DSP->qspan('defaultBold', $title). + $DSP->span('defaultSmall').$DSP->qspan('defaultLight', '&nbsp;|&nbsp;'). + $DSP->anchor(BASE.AMP.'C=edit'.AMP.'M=edit_entry'.AMP. + 'weblog_id='.$_GET['weblog_id'].AMP.'entry_id='.$_GET['reedirect_entry_id'], + $LANG->line('edit_this_entry')). + $DSP->span_c(); + } + else + { + $message .= $DSP->span_c(); + } + + $message .= '<a href="#" id="reedirectClose" title="Hide this notice">&times;</a>' + .$DSP->div_c().$DSP->div_c(); - $message .= $DSP->div_c(); + $replace[] = $message; - $out = str_replace($target, $message, $out); + $find[] = '</head>'; - // Success message goes bye-bye? - if($this->settings['hide_success_message']) - { - $target = '</head>'; - $js = ' + $replace[] = ' + <style type="text/css"> + #entry_reedirect_message { + border-bottom:1px solid #CCC9A4; + position: fixed; + width: 100%; + left: 0; + top: 0; + display: none; + } + * html #entry_reedirect_message { + position: absolute; + } + #entry_reedirect_message div { + padding: 10px 15px; + background-color: rgb(252,252,222); + } + #entry_reedirect_message > div { + background-color: rgba(252,252,222,0.95); + } + a#reedirectClose { + display: block; + position: absolute; + right: 15px; + top: 7px; + padding: 0 3px; + border: 1px solid #CCC9A4; + font-size: 18px; + line-height: 18px; + color: #CCC9A4; + text-decoration: none; + -webkit-border-radius: 3px; + -moz-border-radius: 3px; + border-radius: 3px; + } + a#reedirectClose:hover { + background-color: #CCC9A4; + color: rgb(252,252,222); + } + </style> + <script type="text/javascript"> - <!-- Added by Entry REEdirect --> - $(document).ready(function(){setTimeout(function(){$("div#entry_reedirect_message").slideUp();},'.($this->settings['hide_success_message']*1000).');}); + <!-- Added by Entry REEdirect --> + $(document).ready(function(){ + $("div#entry_reedirect_message").slideDown("normal"'.$auto_hide.'); + $("a#reedirectClose").click(function(){ + $("div#entry_reedirect_message").slideUp(); + return false; + }); + }); </script> + </head> - '; + '; + + $out = str_replace($find, $replace, $out); - $out = str_replace($target, $js, $out); - } } // May as well make the other success messages a little nicer // (Delete and multi-entry category update. No message for multi-entry edit for some reason.) if( isset($_GET['C']) && $_GET['C'] == 'edit' && isset($_GET['M']) && ($_GET['M'] == 'delete_entries' || $_GET['M'] == 'entry_category_update')) { $target = "/<div class='success' >\s*([^<]*)\s*/"; $message = '<div class="box"><span class="success">$1</span>'; $out = preg_replace($target, $message, $out); } return $out; } // END // -------------------------------- // Activate Extension // -------------------------------- function activate_extension() { global $DB; $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Entry_reedirect", 'method' => "grab_return_url", 'hook' => "weblog_standalone_insert_entry", 'settings' => "", 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Entry_reedirect", 'method' => "redirect_location", 'hook' => "submit_new_entry_redirect", 'settings' => "", 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Entry_reedirect", 'method' => "cp_changes", 'hook' => "show_full_control_panel_end", 'settings' => "", 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); } // END // -------------------------------- // Update Extension // -------------------------------- function update_extension($current='') { global $DB; if ($current == '' OR $current == $this->version) { return FALSE; } $DB->query("UPDATE exp_extensions SET version = '".$DB->escape_str($this->version)."' WHERE class = 'Entry_reedirect'"); } // END // -------------------------------- // Disable Extension // -------------------------------- function disable_extension() { global $DB; $DB->query("DELETE FROM exp_extensions WHERE class = 'Entry_reedirect'"); } // END } // END CLASS \ No newline at end of file
blodt/ext.entry_reedirect.ee_addon
a00f642a5137c49b482feb6a58ae0e4b68698d69
Fixed potential PHP "undefined variable" notices
diff --git a/extensions/ext.entry_reedirect.php b/extensions/ext.entry_reedirect.php index 9fd366f..7154f9f 100644 --- a/extensions/ext.entry_reedirect.php +++ b/extensions/ext.entry_reedirect.php @@ -1,351 +1,351 @@ <?php if(!defined('EXT')) { exit('Invalid file request'); } class Entry_reedirect { var $settings = array(); var $name = 'Entry REEdirect'; var $version = '1.0.2'; var $description = 'Choose where users are redirected after publishing/updating new entries in the control panel.'; var $settings_exist = 'y'; var $docs_url = ''; // ------------------------------- // Constructor - Extensions use this for settings // ------------------------------- function Entry_reedirect($settings='') { $this->settings = $settings; } // END // -------------------------------- // Settings // -------------------------------- function settings() { global $DB, $LANG, $PREFS; $settings = array(); $locations = array( 'default' => 'Default Preview', 'new' => 'Publish Form', 'remain' => 'Edit Entry', 'edit' => 'Manage Entries' ); $global_locations = $locations; $global_locations['none'] = 'None'; $settings['hide_success_message'] = '5'; $settings['global_new_entry_redirect'] = array('r', $global_locations, 'none'); $settings['global_updated_entry_redirect'] = array('r', $global_locations, 'none'); $query = $DB->query("SELECT blog_title, weblog_id FROM exp_weblogs ORDER BY blog_title ASC"); if($query->num_rows > 0) { foreach($query->result as $value) { $LANG->language['new_redirect_weblog_id_'.$value['weblog_id']] = "Redirect after publishing new " . strtoupper($value['blog_title']) . ' entries:'; $settings['new_redirect_weblog_id_'.$value['weblog_id']] = array('s', $locations, 'default'); $LANG->language['updated_redirect_weblog_id_'.$value['weblog_id']] = "Redirect after updating " . strtoupper($value['blog_title']) . ' entries:'; $settings['updated_redirect_weblog_id_'.$value['weblog_id']] = array('s', $locations, 'default'); } } return $settings; } // END // -------------------------------- // Put $_POST['return_url'] into a global variable so we can access it later // (No access to this variable from the other, more appropriate hooks) // -------------------------------- function grab_return_url() { global $saef_return_url; $saef_return_url = ($_POST['return_url']) ? $_POST['return_url'] : ''; } // END // -------------------------------- // Do the redirect // -------------------------------- function redirect_location($entry_id, $data, $cp_call) { if($cp_call == TRUE) { $type = ($_POST['entry_id']) ? 'updated' : 'new'; switch($this->settings[$type.'_redirect_weblog_id_'.$data['weblog_id']]) { case 'new': $location = BASE.AMP. 'C=publish'.AMP. 'M=entry_form'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; case 'remain': $location = BASE.AMP. 'C=edit'.AMP. 'M=edit_entry'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'entry_id='.$entry_id.AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; case 'edit': $location = BASE.AMP. 'C=edit'.AMP. 'M=view_entries'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; default: $location = BASE.AMP. 'C=edit'.AMP. 'M=view_entry'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'entry_id='.$entry_id.AMP. 'U='.$type; } } else { global $FNS, $saef_return_url; $FNS->template_type = 'webpage'; $location = ($saef_return_url == '') ? $FNS->fetch_site_index() : $FNS->create_url($saef_return_url, 1, 1); } return $location; } // END // -------------------------------- // Edits to the control panel output // -------------------------------- function cp_changes($out) { global $DB, $EXT, $DSP, $LANG; if ($EXT->last_call !== FALSE) { $out = $EXT->last_call; } // Add jQuery to extension settings page - if($_GET['P'] == 'extension_settings' && $_GET['name'] == 'entry_reedirect') + if( (isset($_GET['P']) && $_GET['P'] == 'extension_settings') && $_GET['name'] == 'entry_reedirect') { $target = '</head>'; $js = ' <script type="text/javascript"> <!-- Added by Entry REEdirect --> $(document).ready(function() { if($("input[type=radio][name=global_new_entry_redirect]:checked").val() != "none") { $("select[name^=new_redirect]").attr("disabled", "disabled"); } if($("input[type=radio][name=global_updated_entry_redirect]:checked").val() != "none") { $("select[name^=updated_redirect]").attr("disabled", "disabled"); } $("input[type=radio][name=global_new_entry_redirect][value!=none]").click(function(){ var setValue = $(this).val(); $("select[name^=new_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=new_redirect]").attr("disabled", "disabled"); }); $("input[type=radio][name=global_updated_entry_redirect][value!=none]").click(function(){ var setValue = $(this).val(); $("select[name^=updated_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=updated_redirect]").attr("disabled", "disabled"); }); $("input[type=radio][name=global_new_entry_redirect][value=none]").click(function(){ $("select[name^=new_redirect]").removeAttr("disabled"); }); $("input[type=radio][name=global_updated_entry_redirect][value=none]").click(function(){ $("select[name^=updated_redirect]").removeAttr("disabled"); }); $("form[name=settings_entry_reedirect]").submit(function(){ $("select[name*=redirect_weblog_id]").removeAttr("disabled"); }); } ); </script> </head> '; $out = str_replace($target, $js, $out); } // Display success messages if(isset($_GET['reedirect_entry_id'])) { $target = "<div id='contentNB'>"; $get_title = $DB->query("SELECT title FROM exp_weblog_titles WHERE entry_id = " . $DB->escape_str($_GET['reedirect_entry_id']) . " LIMIT 1"); $title = $get_title->row['title']; $message = $target.'<div id="entry_reedirect_message" class="box">'.$DSP->span('success'); if($_GET['U'] == 'new') { $message .= $LANG->line('entry_has_been_added'); } elseif($_GET['U'] == 'updated') { $message .= $LANG->line('entry_has_been_updated'); } if($_GET['M'] != 'edit_entry') { $message .= ': '.$DSP->span_c(); $message .= $DSP->qspan('defaultBold', $title). $DSP->span('defaultSmall').$DSP->qspan('defaultLight', '&nbsp;|&nbsp;'). $DSP->anchor(BASE.AMP.'C=edit'.AMP.'M=edit_entry'.AMP.'weblog_id='.$_GET['weblog_id'].AMP.'entry_id='.$_GET['reedirect_entry_id'], $LANG->line('edit_this_entry')). $DSP->span_c(); } else { $message .= $DSP->span_c(); } $message .= $DSP->div_c(); $out = str_replace($target, $message, $out); // Success message goes bye-bye? if($this->settings['hide_success_message']) { $target = '</head>'; $js = ' <script type="text/javascript"> <!-- Added by Entry REEdirect --> $(document).ready(function(){setTimeout(function(){$("div#entry_reedirect_message").slideUp();},'.($this->settings['hide_success_message']*1000).');}); </script> </head> '; $out = str_replace($target, $js, $out); } } // May as well make the other success messages a little nicer // (Delete and multi-entry category update. No message for multi-entry edit for some reason.) - if($_GET['C'] == 'edit' && ($_GET['M'] == 'delete_entries' || $_GET['M'] == 'entry_category_update')) + if( isset($_GET['C']) && $_GET['C'] == 'edit' && isset($_GET['M']) && ($_GET['M'] == 'delete_entries' || $_GET['M'] == 'entry_category_update')) { $target = "/<div class='success' >\s*([^<]*)\s*/"; $message = '<div class="box"><span class="success">$1</span>'; $out = preg_replace($target, $message, $out); } return $out; } // END // -------------------------------- // Activate Extension // -------------------------------- function activate_extension() { global $DB; $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Entry_reedirect", 'method' => "grab_return_url", 'hook' => "weblog_standalone_insert_entry", 'settings' => "", 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Entry_reedirect", 'method' => "redirect_location", 'hook' => "submit_new_entry_redirect", 'settings' => "", 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Entry_reedirect", 'method' => "cp_changes", 'hook' => "show_full_control_panel_end", 'settings' => "", 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); } // END // -------------------------------- // Update Extension // -------------------------------- function update_extension($current='') { global $DB; if ($current == '' OR $current == $this->version) { return FALSE; } $DB->query("UPDATE exp_extensions SET version = '".$DB->escape_str($this->version)."' WHERE class = 'Entry_reedirect'"); } // END // -------------------------------- // Disable Extension // -------------------------------- function disable_extension() { global $DB; $DB->query("DELETE FROM exp_extensions WHERE class = 'Entry_reedirect'"); } // END } // END CLASS \ No newline at end of file
blodt/ext.entry_reedirect.ee_addon
9462757a9072f826cf1e2d0f19b0419b3f07651e
Tweaked display of default bulk-update and deletion notices. Just for fun.
diff --git a/README.markdown b/README.markdown index 2d3bb90..a698918 100644 --- a/README.markdown +++ b/README.markdown @@ -1,16 +1,16 @@ Entry REEdirect is an ExpressionEngine extension that allows you to control, on a per-weblog basis, where authors land after publishing or updating entries in the ExpressionEngine control panel. -For each weblog you have three redirect location options for both **new entries** and **updated entries**: +For each weblog you have four redirect location options for both **new entries** and **updated entries**: - **Default Preview** - EE's built-in success screen with ugly entry preview - **Publish Form** - new entry screen for the same weblog you just published to - **Edit Entry** - keep editing the entry you just published or updated - **Manage Entries** - the Edit tab, filtered to display entries from the weblog you just published to In all cases the author will see a "success" message for their new entry or update, along with the entry's title and an "Edit this entry" link. This success message can optionally disappear after a specified length of time. -The Extension Settings screen offers optional one-click setting of all of your weblogs to the same option for both new entries and updated entries. (This feature requires that jQuery for the Control Panel be installed.) +The Extension Settings screen offers optional one-click setting of all of your weblogs to the same option for both new entries and updated entries. Entries submitted via SAEFs will be be unaffected by this extension. -Entry REEdirect has been tested on ExpressionEngine 1.6.8. \ No newline at end of file +Entry REEdirect requires jQuery for the Control Panel (loading jQuery 1.3 or newer), and has been tested with ExpressionEngine 1.6.8. \ No newline at end of file diff --git a/extensions/ext.entry_reedirect.php b/extensions/ext.entry_reedirect.php index 3f78ae6..9fd366f 100644 --- a/extensions/ext.entry_reedirect.php +++ b/extensions/ext.entry_reedirect.php @@ -1,336 +1,351 @@ <?php if(!defined('EXT')) { exit('Invalid file request'); } class Entry_reedirect { var $settings = array(); var $name = 'Entry REEdirect'; var $version = '1.0.2'; var $description = 'Choose where users are redirected after publishing/updating new entries in the control panel.'; var $settings_exist = 'y'; var $docs_url = ''; // ------------------------------- // Constructor - Extensions use this for settings // ------------------------------- function Entry_reedirect($settings='') { $this->settings = $settings; } // END // -------------------------------- // Settings // -------------------------------- function settings() { global $DB, $LANG, $PREFS; $settings = array(); $locations = array( 'default' => 'Default Preview', 'new' => 'Publish Form', 'remain' => 'Edit Entry', 'edit' => 'Manage Entries' ); $global_locations = $locations; $global_locations['none'] = 'None'; $settings['hide_success_message'] = '5'; $settings['global_new_entry_redirect'] = array('r', $global_locations, 'none'); $settings['global_updated_entry_redirect'] = array('r', $global_locations, 'none'); $query = $DB->query("SELECT blog_title, weblog_id FROM exp_weblogs ORDER BY blog_title ASC"); if($query->num_rows > 0) { foreach($query->result as $value) { $LANG->language['new_redirect_weblog_id_'.$value['weblog_id']] = "Redirect after publishing new " . strtoupper($value['blog_title']) . ' entries:'; $settings['new_redirect_weblog_id_'.$value['weblog_id']] = array('s', $locations, 'default'); $LANG->language['updated_redirect_weblog_id_'.$value['weblog_id']] = "Redirect after updating " . strtoupper($value['blog_title']) . ' entries:'; $settings['updated_redirect_weblog_id_'.$value['weblog_id']] = array('s', $locations, 'default'); } } return $settings; } // END // -------------------------------- // Put $_POST['return_url'] into a global variable so we can access it later // (No access to this variable from the other, more appropriate hooks) // -------------------------------- function grab_return_url() { global $saef_return_url; $saef_return_url = ($_POST['return_url']) ? $_POST['return_url'] : ''; } // END // -------------------------------- // Do the redirect // -------------------------------- function redirect_location($entry_id, $data, $cp_call) { if($cp_call == TRUE) { $type = ($_POST['entry_id']) ? 'updated' : 'new'; switch($this->settings[$type.'_redirect_weblog_id_'.$data['weblog_id']]) { case 'new': $location = BASE.AMP. 'C=publish'.AMP. 'M=entry_form'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; case 'remain': $location = BASE.AMP. 'C=edit'.AMP. 'M=edit_entry'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'entry_id='.$entry_id.AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; case 'edit': $location = BASE.AMP. 'C=edit'.AMP. 'M=view_entries'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; default: $location = BASE.AMP. 'C=edit'.AMP. 'M=view_entry'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'entry_id='.$entry_id.AMP. 'U='.$type; } } else { global $FNS, $saef_return_url; $FNS->template_type = 'webpage'; $location = ($saef_return_url == '') ? $FNS->fetch_site_index() : $FNS->create_url($saef_return_url, 1, 1); } return $location; } // END // -------------------------------- // Edits to the control panel output // -------------------------------- function cp_changes($out) { global $DB, $EXT, $DSP, $LANG; if ($EXT->last_call !== FALSE) { $out = $EXT->last_call; } // Add jQuery to extension settings page if($_GET['P'] == 'extension_settings' && $_GET['name'] == 'entry_reedirect') { $target = '</head>'; $js = ' <script type="text/javascript"> <!-- Added by Entry REEdirect --> $(document).ready(function() { if($("input[type=radio][name=global_new_entry_redirect]:checked").val() != "none") { $("select[name^=new_redirect]").attr("disabled", "disabled"); } if($("input[type=radio][name=global_updated_entry_redirect]:checked").val() != "none") { $("select[name^=updated_redirect]").attr("disabled", "disabled"); } $("input[type=radio][name=global_new_entry_redirect][value!=none]").click(function(){ var setValue = $(this).val(); $("select[name^=new_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=new_redirect]").attr("disabled", "disabled"); }); $("input[type=radio][name=global_updated_entry_redirect][value!=none]").click(function(){ var setValue = $(this).val(); $("select[name^=updated_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=updated_redirect]").attr("disabled", "disabled"); }); $("input[type=radio][name=global_new_entry_redirect][value=none]").click(function(){ $("select[name^=new_redirect]").removeAttr("disabled"); }); $("input[type=radio][name=global_updated_entry_redirect][value=none]").click(function(){ $("select[name^=updated_redirect]").removeAttr("disabled"); }); $("form[name=settings_entry_reedirect]").submit(function(){ $("select[name*=redirect_weblog_id]").removeAttr("disabled"); }); } ); </script> </head> '; $out = str_replace($target, $js, $out); } // Display success messages if(isset($_GET['reedirect_entry_id'])) { $target = "<div id='contentNB'>"; $get_title = $DB->query("SELECT title FROM exp_weblog_titles WHERE entry_id = " . $DB->escape_str($_GET['reedirect_entry_id']) . " LIMIT 1"); $title = $get_title->row['title']; $message = $target.'<div id="entry_reedirect_message" class="box">'.$DSP->span('success'); if($_GET['U'] == 'new') { $message .= $LANG->line('entry_has_been_added'); } elseif($_GET['U'] == 'updated') { $message .= $LANG->line('entry_has_been_updated'); } - $message .= $DSP->span_c(); + if($_GET['M'] != 'edit_entry') { - $message .= $DSP->qspan('',': ' . $title). + $message .= ': '.$DSP->span_c(); + $message .= $DSP->qspan('defaultBold', $title). $DSP->span('defaultSmall').$DSP->qspan('defaultLight', '&nbsp;|&nbsp;'). $DSP->anchor(BASE.AMP.'C=edit'.AMP.'M=edit_entry'.AMP.'weblog_id='.$_GET['weblog_id'].AMP.'entry_id='.$_GET['reedirect_entry_id'], $LANG->line('edit_this_entry')). $DSP->span_c(); } + else + { + $message .= $DSP->span_c(); + } + $message .= $DSP->div_c(); $out = str_replace($target, $message, $out); // Success message goes bye-bye? if($this->settings['hide_success_message']) { $target = '</head>'; $js = ' <script type="text/javascript"> <!-- Added by Entry REEdirect --> $(document).ready(function(){setTimeout(function(){$("div#entry_reedirect_message").slideUp();},'.($this->settings['hide_success_message']*1000).');}); </script> </head> '; $out = str_replace($target, $js, $out); } - } + } + + // May as well make the other success messages a little nicer + // (Delete and multi-entry category update. No message for multi-entry edit for some reason.) + if($_GET['C'] == 'edit' && ($_GET['M'] == 'delete_entries' || $_GET['M'] == 'entry_category_update')) + { + $target = "/<div class='success' >\s*([^<]*)\s*/"; + $message = '<div class="box"><span class="success">$1</span>'; + $out = preg_replace($target, $message, $out); + } return $out; } // END // -------------------------------- // Activate Extension // -------------------------------- function activate_extension() { global $DB; $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Entry_reedirect", 'method' => "grab_return_url", 'hook' => "weblog_standalone_insert_entry", 'settings' => "", 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Entry_reedirect", 'method' => "redirect_location", 'hook' => "submit_new_entry_redirect", 'settings' => "", 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Entry_reedirect", 'method' => "cp_changes", 'hook' => "show_full_control_panel_end", 'settings' => "", 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); } // END // -------------------------------- // Update Extension // -------------------------------- function update_extension($current='') { global $DB; if ($current == '' OR $current == $this->version) { return FALSE; } $DB->query("UPDATE exp_extensions SET version = '".$DB->escape_str($this->version)."' WHERE class = 'Entry_reedirect'"); } // END // -------------------------------- // Disable Extension // -------------------------------- function disable_extension() { global $DB; $DB->query("DELETE FROM exp_extensions WHERE class = 'Entry_reedirect'"); } // END } // END CLASS \ No newline at end of file
blodt/ext.entry_reedirect.ee_addon
d1b6b39e9763613f8722b021f1e9d1aa77031de1
Added option to hide success message after N seconds.
diff --git a/README.markdown b/README.markdown index 5d9b31b..2d3bb90 100644 --- a/README.markdown +++ b/README.markdown @@ -1,16 +1,16 @@ Entry REEdirect is an ExpressionEngine extension that allows you to control, on a per-weblog basis, where authors land after publishing or updating entries in the ExpressionEngine control panel. For each weblog you have three redirect location options for both **new entries** and **updated entries**: - **Default Preview** - EE's built-in success screen with ugly entry preview - **Publish Form** - new entry screen for the same weblog you just published to - **Edit Entry** - keep editing the entry you just published or updated - **Manage Entries** - the Edit tab, filtered to display entries from the weblog you just published to -In all cases the author will see a "success" message for their new entry or update, along with the entry's title and an "Edit this entry" link. +In all cases the author will see a "success" message for their new entry or update, along with the entry's title and an "Edit this entry" link. This success message can optionally disappear after a specified length of time. The Extension Settings screen offers optional one-click setting of all of your weblogs to the same option for both new entries and updated entries. (This feature requires that jQuery for the Control Panel be installed.) Entries submitted via SAEFs will be be unaffected by this extension. Entry REEdirect has been tested on ExpressionEngine 1.6.8. \ No newline at end of file diff --git a/extensions/ext.entry_reedirect.php b/extensions/ext.entry_reedirect.php index feb94d9..3f78ae6 100644 --- a/extensions/ext.entry_reedirect.php +++ b/extensions/ext.entry_reedirect.php @@ -1,343 +1,336 @@ <?php if(!defined('EXT')) { exit('Invalid file request'); } class Entry_reedirect { var $settings = array(); var $name = 'Entry REEdirect'; - var $version = '1.0.1'; + var $version = '1.0.2'; var $description = 'Choose where users are redirected after publishing/updating new entries in the control panel.'; var $settings_exist = 'y'; var $docs_url = ''; // ------------------------------- // Constructor - Extensions use this for settings // ------------------------------- function Entry_reedirect($settings='') { $this->settings = $settings; } // END // -------------------------------- // Settings // -------------------------------- function settings() { global $DB, $LANG, $PREFS; $settings = array(); $locations = array( 'default' => 'Default Preview', 'new' => 'Publish Form', 'remain' => 'Edit Entry', 'edit' => 'Manage Entries' ); $global_locations = $locations; $global_locations['none'] = 'None'; + $settings['hide_success_message'] = '5'; $settings['global_new_entry_redirect'] = array('r', $global_locations, 'none'); $settings['global_updated_entry_redirect'] = array('r', $global_locations, 'none'); $query = $DB->query("SELECT blog_title, weblog_id FROM exp_weblogs ORDER BY blog_title ASC"); if($query->num_rows > 0) { foreach($query->result as $value) { $LANG->language['new_redirect_weblog_id_'.$value['weblog_id']] = "Redirect after publishing new " . strtoupper($value['blog_title']) . ' entries:'; $settings['new_redirect_weblog_id_'.$value['weblog_id']] = array('s', $locations, 'default'); $LANG->language['updated_redirect_weblog_id_'.$value['weblog_id']] = "Redirect after updating " . strtoupper($value['blog_title']) . ' entries:'; - $settings['updated_redirect_weblog_id_'.$value['weblog_id']] = array('s', $locations, 'default'); } + $settings['updated_redirect_weblog_id_'.$value['weblog_id']] = array('s', $locations, 'default'); } } return $settings; } // END // -------------------------------- // Put $_POST['return_url'] into a global variable so we can access it later - // (No access to this variable from the other, more appropriate hooks) + // (No access to this variable from the other, more appropriate hooks) // -------------------------------- function grab_return_url() { global $saef_return_url; $saef_return_url = ($_POST['return_url']) ? $_POST['return_url'] : ''; } // END // -------------------------------- // Do the redirect // -------------------------------- function redirect_location($entry_id, $data, $cp_call) { if($cp_call == TRUE) { $type = ($_POST['entry_id']) ? 'updated' : 'new'; switch($this->settings[$type.'_redirect_weblog_id_'.$data['weblog_id']]) { case 'new': $location = BASE.AMP. 'C=publish'.AMP. 'M=entry_form'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; case 'remain': $location = BASE.AMP. 'C=edit'.AMP. 'M=edit_entry'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'entry_id='.$entry_id.AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; case 'edit': $location = BASE.AMP. 'C=edit'.AMP. 'M=view_entries'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; default: $location = BASE.AMP. 'C=edit'.AMP. 'M=view_entry'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'entry_id='.$entry_id.AMP. 'U='.$type; } } else { global $FNS, $saef_return_url; $FNS->template_type = 'webpage'; $location = ($saef_return_url == '') ? $FNS->fetch_site_index() : $FNS->create_url($saef_return_url, 1, 1); } return $location; } // END // -------------------------------- // Edits to the control panel output // -------------------------------- function cp_changes($out) { global $DB, $EXT, $DSP, $LANG; if ($EXT->last_call !== FALSE) { $out = $EXT->last_call; } // Add jQuery to extension settings page if($_GET['P'] == 'extension_settings' && $_GET['name'] == 'entry_reedirect') { $target = '</head>'; $js = ' <script type="text/javascript"> <!-- Added by Entry REEdirect --> $(document).ready(function() { if($("input[type=radio][name=global_new_entry_redirect]:checked").val() != "none") { $("select[name^=new_redirect]").attr("disabled", "disabled"); } if($("input[type=radio][name=global_updated_entry_redirect]:checked").val() != "none") { $("select[name^=updated_redirect]").attr("disabled", "disabled"); } $("input[type=radio][name=global_new_entry_redirect][value!=none]").click(function(){ var setValue = $(this).val(); $("select[name^=new_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=new_redirect]").attr("disabled", "disabled"); }); $("input[type=radio][name=global_updated_entry_redirect][value!=none]").click(function(){ var setValue = $(this).val(); $("select[name^=updated_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=updated_redirect]").attr("disabled", "disabled"); }); $("input[type=radio][name=global_new_entry_redirect][value=none]").click(function(){ $("select[name^=new_redirect]").removeAttr("disabled"); }); $("input[type=radio][name=global_updated_entry_redirect][value=none]").click(function(){ $("select[name^=updated_redirect]").removeAttr("disabled"); }); $("form[name=settings_entry_reedirect]").submit(function(){ $("select[name*=redirect_weblog_id]").removeAttr("disabled"); }); } ); </script> </head> '; $out = str_replace($target, $js, $out); } // Display success messages if(isset($_GET['reedirect_entry_id'])) { $target = "<div id='contentNB'>"; $get_title = $DB->query("SELECT title FROM exp_weblog_titles WHERE entry_id = " . $DB->escape_str($_GET['reedirect_entry_id']) . " LIMIT 1"); $title = $get_title->row['title']; $message = $target.'<div id="entry_reedirect_message" class="box">'.$DSP->span('success'); if($_GET['U'] == 'new') { $message .= $LANG->line('entry_has_been_added'); } elseif($_GET['U'] == 'updated') { $message .= $LANG->line('entry_has_been_updated'); } $message .= $DSP->span_c(); if($_GET['M'] != 'edit_entry') { $message .= $DSP->qspan('',': ' . $title). $DSP->span('defaultSmall').$DSP->qspan('defaultLight', '&nbsp;|&nbsp;'). $DSP->anchor(BASE.AMP.'C=edit'.AMP.'M=edit_entry'.AMP.'weblog_id='.$_GET['weblog_id'].AMP.'entry_id='.$_GET['reedirect_entry_id'], $LANG->line('edit_this_entry')). $DSP->span_c(); } $message .= $DSP->div_c(); $out = str_replace($target, $message, $out); - - // Success message goes bye-bye after 5 seconds - $target = '</head>'; - $js = ' - <script type="text/javascript"> - <!-- Added by Entry REEdirect --> - $(document).ready(function() - { - setTimeout(function(){$("div#entry_reedirect_message").slideUp();},5000); - } - ); - </script> - </head> - '; - - $out = str_replace($target, $js, $out); - + // Success message goes bye-bye? + if($this->settings['hide_success_message']) + { + $target = '</head>'; + $js = ' + <script type="text/javascript"> + <!-- Added by Entry REEdirect --> + $(document).ready(function(){setTimeout(function(){$("div#entry_reedirect_message").slideUp();},'.($this->settings['hide_success_message']*1000).');}); + </script> + </head> + '; + + $out = str_replace($target, $js, $out); + } } return $out; } // END // -------------------------------- // Activate Extension // -------------------------------- function activate_extension() { global $DB; $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Entry_reedirect", 'method' => "grab_return_url", 'hook' => "weblog_standalone_insert_entry", 'settings' => "", 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Entry_reedirect", 'method' => "redirect_location", 'hook' => "submit_new_entry_redirect", 'settings' => "", 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Entry_reedirect", 'method' => "cp_changes", 'hook' => "show_full_control_panel_end", 'settings' => "", 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); } // END // -------------------------------- // Update Extension // -------------------------------- function update_extension($current='') { global $DB; if ($current == '' OR $current == $this->version) { return FALSE; } - if ($current < '1.0.1') - { - // Do upgrade stuff here. - } - $DB->query("UPDATE exp_extensions SET version = '".$DB->escape_str($this->version)."' WHERE class = 'Entry_reedirect'"); } // END // -------------------------------- // Disable Extension // -------------------------------- function disable_extension() { global $DB; $DB->query("DELETE FROM exp_extensions WHERE class = 'Entry_reedirect'"); } // END } // END CLASS \ No newline at end of file diff --git a/language/english/lang.entry_reedirect.php b/language/english/lang.entry_reedirect.php index f5ad643..1e26080 100644 --- a/language/english/lang.entry_reedirect.php +++ b/language/english/lang.entry_reedirect.php @@ -1,11 +1,12 @@ <?php $L = array( 'Default Preview' => 'Default Preview', 'Publish Form' => 'Publish Form', 'Edit Entry' => 'Edit Entry', 'Manage Entries' => 'Manage Entries', 'None' => 'None', 'global_new_entry_redirect' => 'Global redirect after publishing new entries:', 'global_updated_entry_redirect' => 'Global redirect after updating entries:', + 'hide_success_message' => 'Seconds until success message disappears (\'0\' for persistent)' ); \ No newline at end of file
blodt/ext.entry_reedirect.ee_addon
6381b18d6f744bac362ba868112f0e5cf1fd1cac
Success messages now disappar after 5 seconds
diff --git a/extensions/ext.entry_reedirect.php b/extensions/ext.entry_reedirect.php index f77437d..feb94d9 100644 --- a/extensions/ext.entry_reedirect.php +++ b/extensions/ext.entry_reedirect.php @@ -1,326 +1,343 @@ <?php if(!defined('EXT')) { exit('Invalid file request'); } class Entry_reedirect { var $settings = array(); var $name = 'Entry REEdirect'; var $version = '1.0.1'; var $description = 'Choose where users are redirected after publishing/updating new entries in the control panel.'; var $settings_exist = 'y'; var $docs_url = ''; // ------------------------------- // Constructor - Extensions use this for settings // ------------------------------- function Entry_reedirect($settings='') { $this->settings = $settings; } // END // -------------------------------- // Settings // -------------------------------- function settings() { global $DB, $LANG, $PREFS; $settings = array(); $locations = array( 'default' => 'Default Preview', 'new' => 'Publish Form', 'remain' => 'Edit Entry', 'edit' => 'Manage Entries' ); $global_locations = $locations; $global_locations['none'] = 'None'; $settings['global_new_entry_redirect'] = array('r', $global_locations, 'none'); $settings['global_updated_entry_redirect'] = array('r', $global_locations, 'none'); $query = $DB->query("SELECT blog_title, weblog_id FROM exp_weblogs ORDER BY blog_title ASC"); if($query->num_rows > 0) { foreach($query->result as $value) { $LANG->language['new_redirect_weblog_id_'.$value['weblog_id']] = "Redirect after publishing new " . strtoupper($value['blog_title']) . ' entries:'; $settings['new_redirect_weblog_id_'.$value['weblog_id']] = array('s', $locations, 'default'); $LANG->language['updated_redirect_weblog_id_'.$value['weblog_id']] = "Redirect after updating " . strtoupper($value['blog_title']) . ' entries:'; $settings['updated_redirect_weblog_id_'.$value['weblog_id']] = array('s', $locations, 'default'); } } return $settings; } // END // -------------------------------- // Put $_POST['return_url'] into a global variable so we can access it later // (No access to this variable from the other, more appropriate hooks) // -------------------------------- function grab_return_url() { global $saef_return_url; $saef_return_url = ($_POST['return_url']) ? $_POST['return_url'] : ''; } // END // -------------------------------- // Do the redirect // -------------------------------- function redirect_location($entry_id, $data, $cp_call) { if($cp_call == TRUE) { $type = ($_POST['entry_id']) ? 'updated' : 'new'; switch($this->settings[$type.'_redirect_weblog_id_'.$data['weblog_id']]) { case 'new': $location = BASE.AMP. 'C=publish'.AMP. 'M=entry_form'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; case 'remain': $location = BASE.AMP. 'C=edit'.AMP. 'M=edit_entry'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'entry_id='.$entry_id.AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; case 'edit': $location = BASE.AMP. 'C=edit'.AMP. 'M=view_entries'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; default: $location = BASE.AMP. 'C=edit'.AMP. 'M=view_entry'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'entry_id='.$entry_id.AMP. 'U='.$type; } } else { global $FNS, $saef_return_url; $FNS->template_type = 'webpage'; $location = ($saef_return_url == '') ? $FNS->fetch_site_index() : $FNS->create_url($saef_return_url, 1, 1); } return $location; } // END // -------------------------------- - // Add the message + // Edits to the control panel output // -------------------------------- function cp_changes($out) { global $DB, $EXT, $DSP, $LANG; if ($EXT->last_call !== FALSE) { $out = $EXT->last_call; } // Add jQuery to extension settings page if($_GET['P'] == 'extension_settings' && $_GET['name'] == 'entry_reedirect') { $target = '</head>'; $js = ' <script type="text/javascript"> <!-- Added by Entry REEdirect --> $(document).ready(function() { if($("input[type=radio][name=global_new_entry_redirect]:checked").val() != "none") { $("select[name^=new_redirect]").attr("disabled", "disabled"); } if($("input[type=radio][name=global_updated_entry_redirect]:checked").val() != "none") { $("select[name^=updated_redirect]").attr("disabled", "disabled"); } $("input[type=radio][name=global_new_entry_redirect][value!=none]").click(function(){ var setValue = $(this).val(); $("select[name^=new_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=new_redirect]").attr("disabled", "disabled"); }); $("input[type=radio][name=global_updated_entry_redirect][value!=none]").click(function(){ var setValue = $(this).val(); $("select[name^=updated_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=updated_redirect]").attr("disabled", "disabled"); }); $("input[type=radio][name=global_new_entry_redirect][value=none]").click(function(){ $("select[name^=new_redirect]").removeAttr("disabled"); }); $("input[type=radio][name=global_updated_entry_redirect][value=none]").click(function(){ $("select[name^=updated_redirect]").removeAttr("disabled"); }); $("form[name=settings_entry_reedirect]").submit(function(){ $("select[name*=redirect_weblog_id]").removeAttr("disabled"); }); } ); </script> </head> '; $out = str_replace($target, $js, $out); } - // Display success messages if(isset($_GET['reedirect_entry_id'])) { $target = "<div id='contentNB'>"; $get_title = $DB->query("SELECT title FROM exp_weblog_titles WHERE entry_id = " . $DB->escape_str($_GET['reedirect_entry_id']) . " LIMIT 1"); $title = $get_title->row['title']; - $message = $target.$DSP->div('box').$DSP->span('success'); + $message = $target.'<div id="entry_reedirect_message" class="box">'.$DSP->span('success'); if($_GET['U'] == 'new') { $message .= $LANG->line('entry_has_been_added'); } elseif($_GET['U'] == 'updated') { $message .= $LANG->line('entry_has_been_updated'); } $message .= $DSP->span_c(); if($_GET['M'] != 'edit_entry') { $message .= $DSP->qspan('',': ' . $title). $DSP->span('defaultSmall').$DSP->qspan('defaultLight', '&nbsp;|&nbsp;'). $DSP->anchor(BASE.AMP.'C=edit'.AMP.'M=edit_entry'.AMP.'weblog_id='.$_GET['weblog_id'].AMP.'entry_id='.$_GET['reedirect_entry_id'], $LANG->line('edit_this_entry')). $DSP->span_c(); } $message .= $DSP->div_c(); $out = str_replace($target, $message, $out); - } + + + // Success message goes bye-bye after 5 seconds + $target = '</head>'; + $js = ' + <script type="text/javascript"> + <!-- Added by Entry REEdirect --> + $(document).ready(function() + { + setTimeout(function(){$("div#entry_reedirect_message").slideUp();},5000); + } + ); + </script> + </head> + '; + + $out = str_replace($target, $js, $out); + + } return $out; } // END // -------------------------------- // Activate Extension // -------------------------------- function activate_extension() { global $DB; $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Entry_reedirect", 'method' => "grab_return_url", 'hook' => "weblog_standalone_insert_entry", 'settings' => "", 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Entry_reedirect", 'method' => "redirect_location", 'hook' => "submit_new_entry_redirect", 'settings' => "", 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Entry_reedirect", 'method' => "cp_changes", 'hook' => "show_full_control_panel_end", 'settings' => "", 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); } // END // -------------------------------- // Update Extension // -------------------------------- function update_extension($current='') { global $DB; if ($current == '' OR $current == $this->version) { return FALSE; } if ($current < '1.0.1') { // Do upgrade stuff here. } $DB->query("UPDATE exp_extensions SET version = '".$DB->escape_str($this->version)."' WHERE class = 'Entry_reedirect'"); } // END // -------------------------------- // Disable Extension // -------------------------------- function disable_extension() { global $DB; $DB->query("DELETE FROM exp_extensions WHERE class = 'Entry_reedirect'"); } // END } // END CLASS \ No newline at end of file
blodt/ext.entry_reedirect.ee_addon
1a831482d190f74fc6c6dd6f608280e1e9ffe61f
Added option to keep editing the entry you just published or updated
diff --git a/README.markdown b/README.markdown index 7005302..5d9b31b 100644 --- a/README.markdown +++ b/README.markdown @@ -1,15 +1,16 @@ Entry REEdirect is an ExpressionEngine extension that allows you to control, on a per-weblog basis, where authors land after publishing or updating entries in the ExpressionEngine control panel. For each weblog you have three redirect location options for both **new entries** and **updated entries**: - **Default Preview** - EE's built-in success screen with ugly entry preview - **Publish Form** - new entry screen for the same weblog you just published to -- **Edit Entries** - the Edit tab, filtered to display entries from the weblog you just published to +- **Edit Entry** - keep editing the entry you just published or updated +- **Manage Entries** - the Edit tab, filtered to display entries from the weblog you just published to In all cases the author will see a "success" message for their new entry or update, along with the entry's title and an "Edit this entry" link. The Extension Settings screen offers optional one-click setting of all of your weblogs to the same option for both new entries and updated entries. (This feature requires that jQuery for the Control Panel be installed.) Entries submitted via SAEFs will be be unaffected by this extension. Entry REEdirect has been tested on ExpressionEngine 1.6.8. \ No newline at end of file
blodt/ext.entry_reedirect.ee_addon
4fca82aaa6cf4c99d790b9098807df26e89db4ff
Added option to keep editing the entry after publish or update
diff --git a/extensions/ext.entry_reedirect.php b/extensions/ext.entry_reedirect.php index 241e836..f77437d 100644 --- a/extensions/ext.entry_reedirect.php +++ b/extensions/ext.entry_reedirect.php @@ -1,310 +1,326 @@ <?php if(!defined('EXT')) { exit('Invalid file request'); } class Entry_reedirect { var $settings = array(); var $name = 'Entry REEdirect'; - var $version = '1.0.0'; + var $version = '1.0.1'; var $description = 'Choose where users are redirected after publishing/updating new entries in the control panel.'; var $settings_exist = 'y'; var $docs_url = ''; // ------------------------------- // Constructor - Extensions use this for settings // ------------------------------- function Entry_reedirect($settings='') { $this->settings = $settings; } // END // -------------------------------- // Settings // -------------------------------- function settings() { global $DB, $LANG, $PREFS; $settings = array(); $locations = array( 'default' => 'Default Preview', 'new' => 'Publish Form', - 'edit' => 'Edit Entries' + 'remain' => 'Edit Entry', + 'edit' => 'Manage Entries' ); $global_locations = $locations; $global_locations['none'] = 'None'; $settings['global_new_entry_redirect'] = array('r', $global_locations, 'none'); $settings['global_updated_entry_redirect'] = array('r', $global_locations, 'none'); $query = $DB->query("SELECT blog_title, weblog_id FROM exp_weblogs ORDER BY blog_title ASC"); if($query->num_rows > 0) { foreach($query->result as $value) { $LANG->language['new_redirect_weblog_id_'.$value['weblog_id']] = "Redirect after publishing new " . strtoupper($value['blog_title']) . ' entries:'; $settings['new_redirect_weblog_id_'.$value['weblog_id']] = array('s', $locations, 'default'); $LANG->language['updated_redirect_weblog_id_'.$value['weblog_id']] = "Redirect after updating " . strtoupper($value['blog_title']) . ' entries:'; $settings['updated_redirect_weblog_id_'.$value['weblog_id']] = array('s', $locations, 'default'); } } return $settings; } // END // -------------------------------- // Put $_POST['return_url'] into a global variable so we can access it later // (No access to this variable from the other, more appropriate hooks) // -------------------------------- function grab_return_url() { global $saef_return_url; $saef_return_url = ($_POST['return_url']) ? $_POST['return_url'] : ''; } // END // -------------------------------- // Do the redirect // -------------------------------- function redirect_location($entry_id, $data, $cp_call) { if($cp_call == TRUE) { $type = ($_POST['entry_id']) ? 'updated' : 'new'; switch($this->settings[$type.'_redirect_weblog_id_'.$data['weblog_id']]) { case 'new': $location = BASE.AMP. 'C=publish'.AMP. 'M=entry_form'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; + case 'remain': + $location = BASE.AMP. + 'C=edit'.AMP. + 'M=edit_entry'.AMP. + 'weblog_id='.$data['weblog_id'].AMP. + 'entry_id='.$entry_id.AMP. + 'reedirect_entry_id='.$entry_id.AMP. + 'U='.$type; + break; case 'edit': $location = BASE.AMP. 'C=edit'.AMP. 'M=view_entries'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'reedirect_entry_id='.$entry_id.AMP. 'U='.$type; break; default: $location = BASE.AMP. 'C=edit'.AMP. 'M=view_entry'.AMP. 'weblog_id='.$data['weblog_id'].AMP. 'entry_id='.$entry_id.AMP. 'U='.$type; } } else { global $FNS, $saef_return_url; $FNS->template_type = 'webpage'; $location = ($saef_return_url == '') ? $FNS->fetch_site_index() : $FNS->create_url($saef_return_url, 1, 1); } return $location; } // END // -------------------------------- // Add the message // -------------------------------- function cp_changes($out) { global $DB, $EXT, $DSP, $LANG; if ($EXT->last_call !== FALSE) { $out = $EXT->last_call; } // Add jQuery to extension settings page if($_GET['P'] == 'extension_settings' && $_GET['name'] == 'entry_reedirect') { $target = '</head>'; $js = ' <script type="text/javascript"> + <!-- Added by Entry REEdirect --> $(document).ready(function() { if($("input[type=radio][name=global_new_entry_redirect]:checked").val() != "none") { $("select[name^=new_redirect]").attr("disabled", "disabled"); } if($("input[type=radio][name=global_updated_entry_redirect]:checked").val() != "none") { $("select[name^=updated_redirect]").attr("disabled", "disabled"); } $("input[type=radio][name=global_new_entry_redirect][value!=none]").click(function(){ var setValue = $(this).val(); $("select[name^=new_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=new_redirect]").attr("disabled", "disabled"); }); $("input[type=radio][name=global_updated_entry_redirect][value!=none]").click(function(){ var setValue = $(this).val(); $("select[name^=updated_redirect] option[value=" + setValue + "]").attr("selected", "selected"); $("select[name^=updated_redirect]").attr("disabled", "disabled"); }); $("input[type=radio][name=global_new_entry_redirect][value=none]").click(function(){ $("select[name^=new_redirect]").removeAttr("disabled"); }); $("input[type=radio][name=global_updated_entry_redirect][value=none]").click(function(){ $("select[name^=updated_redirect]").removeAttr("disabled"); }); $("form[name=settings_entry_reedirect]").submit(function(){ $("select[name*=redirect_weblog_id]").removeAttr("disabled"); }); } ); </script> </head> '; $out = str_replace($target, $js, $out); } // Display success messages if(isset($_GET['reedirect_entry_id'])) { $target = "<div id='contentNB'>"; $get_title = $DB->query("SELECT title FROM exp_weblog_titles WHERE entry_id = " . $DB->escape_str($_GET['reedirect_entry_id']) . " LIMIT 1"); $title = $get_title->row['title']; $message = $target.$DSP->div('box').$DSP->span('success'); if($_GET['U'] == 'new') { $message .= $LANG->line('entry_has_been_added'); } elseif($_GET['U'] == 'updated') { $message .= $LANG->line('entry_has_been_updated'); } - $message .= $DSP->span_c().$DSP->qspan('',': ' . $title). - $DSP->span('defaultSmall').$DSP->qspan('defaultLight', '&nbsp;|&nbsp;'). - $DSP->anchor(BASE.AMP.'C=edit'.AMP.'M=edit_entry'.AMP.'weblog_id='.$_GET['weblog_id'].AMP.'entry_id='.$_GET['reedirect_entry_id'], $LANG->line('edit_this_entry')). - $DSP->span_c().$DSP->div_c(); + $message .= $DSP->span_c(); + if($_GET['M'] != 'edit_entry') + { + $message .= $DSP->qspan('',': ' . $title). + $DSP->span('defaultSmall').$DSP->qspan('defaultLight', '&nbsp;|&nbsp;'). + $DSP->anchor(BASE.AMP.'C=edit'.AMP.'M=edit_entry'.AMP.'weblog_id='.$_GET['weblog_id'].AMP.'entry_id='.$_GET['reedirect_entry_id'], $LANG->line('edit_this_entry')). + $DSP->span_c(); + } + $message .= $DSP->div_c(); $out = str_replace($target, $message, $out); } return $out; } // END // -------------------------------- // Activate Extension // -------------------------------- function activate_extension() { global $DB; $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Entry_reedirect", 'method' => "grab_return_url", 'hook' => "weblog_standalone_insert_entry", 'settings' => "", 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Entry_reedirect", 'method' => "redirect_location", 'hook' => "submit_new_entry_redirect", 'settings' => "", 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); $DB->query($DB->insert_string('exp_extensions', array( 'extension_id' => '', 'class' => "Entry_reedirect", 'method' => "cp_changes", 'hook' => "show_full_control_panel_end", 'settings' => "", 'priority' => 10, 'version' => $this->version, 'enabled' => "y" ) ) ); } // END // -------------------------------- // Update Extension // -------------------------------- function update_extension($current='') { global $DB; if ($current == '' OR $current == $this->version) { return FALSE; } if ($current < '1.0.1') { // Do upgrade stuff here. } $DB->query("UPDATE exp_extensions SET version = '".$DB->escape_str($this->version)."' WHERE class = 'Entry_reedirect'"); } // END // -------------------------------- // Disable Extension // -------------------------------- function disable_extension() { global $DB; $DB->query("DELETE FROM exp_extensions WHERE class = 'Entry_reedirect'"); } // END } // END CLASS \ No newline at end of file diff --git a/language/english/lang.entry_reedirect.php b/language/english/lang.entry_reedirect.php index 46dd1a5..f5ad643 100644 --- a/language/english/lang.entry_reedirect.php +++ b/language/english/lang.entry_reedirect.php @@ -1,10 +1,11 @@ <?php $L = array( 'Default Preview' => 'Default Preview', 'Publish Form' => 'Publish Form', - 'Edit Entries' => 'Edit Entries', + 'Edit Entry' => 'Edit Entry', + 'Manage Entries' => 'Manage Entries', 'None' => 'None', 'global_new_entry_redirect' => 'Global redirect after publishing new entries:', 'global_updated_entry_redirect' => 'Global redirect after updating entries:', ); \ No newline at end of file
michaelmontano/snowflakepy
5ffd0931df7ce2ba2e1d19d17d8d447f77e39060
adding BSD license
diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..09da1d6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,19 @@ +Copyright (c) 2011, BackType, Inc. +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice, this list of conditions and the following + disclaimer. + * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided with the distribution. + * Neither the name of the original authors nor the names of its contributors may be used to endorse or promote + products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR +SERVICES; LOSS OF USE, DATA, OR PROFITS OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
michaelmontano/snowflakepy
65cce2bdaa2df9e8f2c3ba6b29494ceed3cecdf3
adding get_timestamp_from_id
diff --git a/src/idworker.py b/src/idworker.py index b10e43c..5ce5d97 100644 --- a/src/idworker.py +++ b/src/idworker.py @@ -1,84 +1,87 @@ import time TWEPOCH = 1288834974657 WORKER_ID_BITS = 5 DATACENTER_ID_BITS = 5 MAX_WORKER_ID = (1 << WORKER_ID_BITS) - 1 MAX_DATACENTER_ID = (1 << DATACENTER_ID_BITS) - 1 SEQUENCE_BITS = 12 WORKER_ID_SHIFT = SEQUENCE_BITS DATACENTER_ID_SHIFT = SEQUENCE_BITS + WORKER_ID_BITS TIMESTAMP_SHIFT = SEQUENCE_BITS + WORKER_ID_BITS + DATACENTER_ID_BITS SEQUENCE_MASK = (1 << SEQUENCE_BITS) def gen_id(timestamp, datacenter_id, worker_id, sequence): return (timestamp - TWEPOCH) << TIMESTAMP_SHIFT | \ (datacenter_id << DATACENTER_ID_SHIFT) | \ (worker_id << WORKER_ID_SHIFT) | \ sequence +def get_timestamp_from_id(id_): + return (id_ >> TIMESTAMP_SHIFT) + TWEPOCH + class IdWorker(object): def __init__(self, worker_id, datacenter_id): assert worker_id >= 0 and worker_id <= MAX_WORKER_ID assert datacenter_id >= 0 and datacenter_id <= MAX_DATACENTER_ID self.worker_id = worker_id self.datacenter_id = datacenter_id self.sequence = 0 self.last_timestamp = -1 print "worker starting. timestamp left shift %d, datacenter_id bits %d, worker_id bits %d, sequence bits %d, worker_id %d" \ %(TIMESTAMP_SHIFT, DATACENTER_ID_BITS, WORKER_ID_BITS, SEQUENCE_BITS, self.worker_id) def get_id(self): return self.next_id() def get_worker_id(self): return self.worker_id def get_datacenter_id(self): return self.datacenter_id def get_timestamp(self): return int(time.time()*1000) def next_id(self): timestamp = self.time_gen() if self.last_timestamp > timestamp: print "clock is moving backwards. Rejecting requests until %d" %self.last_timestamp raise Exception, "Clock moved backwards. Refusing to generate id for %d milliseconds" %(self.last_timestamp - timestamp) if self.last_timestamp == timestamp: self.sequence = (self.sequence + 1) % SEQUENCE_MASK if self.sequence == 0: timestamp = self.til_next_millis(self.last_timestamp) else: self.sequence = 0 self.last_timestamp = timestamp return gen_id(timestamp, self.datacenter_id, self.worker_id, self.sequence) def til_next_millis(self, last_timestamp): timestamp = self.time_gen() while last_timestamp == timestamp: timestamp = self.time_gen() return timestamp def time_gen(self): return int(time.time()*1000) class WakingIdWorker(IdWorker): def __init__(self, *args, **kwargs): super(WakingIdWorker, self).__init__(*args, **kwargs) self.sleeps = 0 def til_next_millis(self, last_timestamp): timestamp = self.time_gen() while last_timestamp == timestamp: timestamp = self.time_gen() self.sleeps += 1 return timestamp \ No newline at end of file diff --git a/test/test_idworker.py b/test/test_idworker.py index 21c8a96..84cf2cb 100644 --- a/test/test_idworker.py +++ b/test/test_idworker.py @@ -1,96 +1,104 @@ import sys sys.path = ['..'] + sys.path from src import idworker import time WORKER_MASK = 0x000000000001F000 DATACENTER_MASK = 0x00000000003E0000 TIMESTAMP_MASK = 0xFFFFFFFFFFC00000 def test_generate_id(): worker = idworker.IdWorker(1, 1) tid = worker.next_id() assert tid > 0 def test_generate_timestamp(): worker = idworker.IdWorker(1, 1) t = int(time.time()*1000) assert (worker.get_timestamp() - t) < 50 def test_get_worker_id(): worker = idworker.IdWorker(1, 1) assert worker.get_worker_id() == 1 def test_get_datacenter_id(): worker = idworker.IdWorker(1, 1) assert worker.get_datacenter_id() == 1 def test_mask_worker_id(): worker_id = 0x1F datacenter_id = 0 worker = idworker.IdWorker(worker_id, datacenter_id) tid = worker.next_id() assert (tid & WORKER_MASK) >> idworker.WORKER_ID_SHIFT == worker_id def test_mask_datacenter_id(): worker_id = 0 datacenter_id = 0x1F worker = idworker.IdWorker(worker_id, datacenter_id) tid = worker.next_id() assert (tid & DATACENTER_MASK) >> idworker.DATACENTER_ID_SHIFT == datacenter_id def test_mask_timestamp(): t = int(time.time()*1000) worker_id = 1 datacenter_id = 1 worker = idworker.IdWorker(worker_id, datacenter_id) tid = worker.next_id() assert ((tid & TIMESTAMP_MASK) >> idworker.TIMESTAMP_SHIFT) + idworker.TWEPOCH >= t def test_roll_over_sequence_id(): worker_id = 4 datacenter_id = 4 worker = idworker.IdWorker(worker_id, datacenter_id) start_sequence = 0xFFFFFF-20 end_sequence = 0xFFFFFF+20 worker.sequence = start_sequence for i in range(start_sequence, end_sequence + 1): tid = worker.next_id() assert (tid & WORKER_MASK) >> idworker.WORKER_ID_SHIFT == worker_id def test_generate_increasing_ids(): worker = idworker.IdWorker(1, 1) last_id = 0 for i in range(100): tid = worker.next_id() assert tid > last_id last_id = tid def test_generate_one_million_ids_quickly(): worker = idworker.IdWorker(31, 31) t1 = int(time.time()*1000) for i in range(100000): tid = worker.next_id() assert tid t2 = int(time.time()*1000) rate = 100000.0/(t2 - t1) print 'generated 100000 ids in %d ms, or %s ids/ms' %(t2 - t1, rate) assert rate > 100 def test_sleep_on_same_id(): worker = idworker.WakingIdWorker(1, 1) worker.sequence = 4095 tid1 = worker.next_id() worker.sequence = 4095 tid2 = worker.next_id() assert worker.sleeps > 0 def test_generate_unique_ids(): worker = idworker.IdWorker(31, 31) s = set() n = 200000 for i in range(n): tid = worker.next_id() s.add(tid) - assert len(s) == n \ No newline at end of file + assert len(s) == n + +def test_get_timestamp_from_id(): + worker = idworker.WakingIdWorker(1, 1) + ts = worker.get_timestamp() + id_ = idworker.gen_id(ts, 0, 0, 0) + id_ts = idworker.get_timestamp_from_id(id_) + print ts, id_ts + assert id_ts == ts \ No newline at end of file
michaelmontano/snowflakepy
fe2f90ca24c1ff102b4e15a7a64d375ba194b2cb
ignore pyc files
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..0d20b64 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.pyc
michaelmontano/snowflakepy
59adc3ab7ed57cdf7e0a206f19321ffa03152167
adding examples to print_usage for server and client
diff --git a/src/snowflakeserver.py b/src/snowflakeserver.py index 1f1f4be..7b30208 100644 --- a/src/snowflakeserver.py +++ b/src/snowflakeserver.py @@ -1,52 +1,53 @@ import sys sys.path = ['..'] + sys.path import zope from twisted.internet import reactor from thrift.transport import TSocket from thrift.transport import TTransport from thrift.transport import TTwisted from thrift.protocol import TBinaryProtocol from lib.genpy.snowflake import Snowflake from lib.genpy.snowflake.ttypes import * import idworker class SnowflakeServer(object): zope.interface.implements(Snowflake.Iface) def __init__(self, worker_id, datacenter_id): self.worker = idworker.IdWorker(worker_id, datacenter_id) def get_worker_id(self): return self.worker.get_worker_id() def get_datacenter_id(self): return self.worker.get_datacenter_id() def get_timestamp(self): return self.worker.get_timestamp() def get_id(self): return self.worker.get_id() def print_usage(): print 'python snowflakeserver.py <port> <worker_id> <datacenter_id>' + print 'e.g. python snowflakeserver.py 1111 1 1' def main(): if len(sys.argv) != 4: return print_usage() port = int(sys.argv[1]) worker_id = int(sys.argv[2]) datacenter_id = int(sys.argv[3]) reactor.listenTCP(port, TTwisted.ThriftServerFactory( processor=Snowflake.Processor(SnowflakeServer(worker_id, datacenter_id)), iprot_factory=TBinaryProtocol.TBinaryProtocolFactory() )) reactor.run() if __name__ == '__main__': sys.exit(main()) \ No newline at end of file diff --git a/test/test_client.py b/test/test_client.py index d389a5c..c9d9f09 100644 --- a/test/test_client.py +++ b/test/test_client.py @@ -1,40 +1,41 @@ import sys sys.path = ['..'] + sys.path from thrift import Thrift from thrift.transport import TSocket from thrift.transport import TTransport from thrift.protocol import TBinaryProtocol from lib.genpyblocking.snowflake import Snowflake from lib.genpyblocking.snowflake.ttypes import * def print_usage(): print 'python test_client.py <port> <get_worker_id|get_datacenter_id|get_timestamp|get_id>' + print 'e.g. python test_client.py 1111 get_id' def main(): if len(sys.argv) != 3: return print_usage() port = int(sys.argv[1]) service = sys.argv[2] transport = TSocket.TSocket('localhost', port) transport = TTransport.TFramedTransport(transport) prot = TBinaryProtocol.TBinaryProtocol(transport) client = Snowflake.Client(prot) transport.open() if service == 'get_worker_id': print client.get_worker_id() elif service == 'get_datacenter_id': print client.get_datacenter_id() elif service == 'get_timestamp': print client.get_timestamp() elif service == 'get_id': print client.get_id() else: print_usage() if __name__ == '__main__': sys.exit(main()) \ No newline at end of file
michaelmontano/snowflakepy
810a33a756f5fc7a27c0aaee901532c1ecb97501
snowflakeserver and test_client
diff --git a/src/snowflakeserver.py b/src/snowflakeserver.py new file mode 100644 index 0000000..1f1f4be --- /dev/null +++ b/src/snowflakeserver.py @@ -0,0 +1,52 @@ +import sys +sys.path = ['..'] + sys.path + +import zope +from twisted.internet import reactor + +from thrift.transport import TSocket +from thrift.transport import TTransport +from thrift.transport import TTwisted +from thrift.protocol import TBinaryProtocol + +from lib.genpy.snowflake import Snowflake +from lib.genpy.snowflake.ttypes import * + +import idworker + +class SnowflakeServer(object): + zope.interface.implements(Snowflake.Iface) + + def __init__(self, worker_id, datacenter_id): + self.worker = idworker.IdWorker(worker_id, datacenter_id) + + def get_worker_id(self): + return self.worker.get_worker_id() + + def get_datacenter_id(self): + return self.worker.get_datacenter_id() + + def get_timestamp(self): + return self.worker.get_timestamp() + + def get_id(self): + return self.worker.get_id() + +def print_usage(): + print 'python snowflakeserver.py <port> <worker_id> <datacenter_id>' + +def main(): + if len(sys.argv) != 4: + return print_usage() + + port = int(sys.argv[1]) + worker_id = int(sys.argv[2]) + datacenter_id = int(sys.argv[3]) + reactor.listenTCP(port, TTwisted.ThriftServerFactory( + processor=Snowflake.Processor(SnowflakeServer(worker_id, datacenter_id)), + iprot_factory=TBinaryProtocol.TBinaryProtocolFactory() + )) + reactor.run() + +if __name__ == '__main__': + sys.exit(main()) \ No newline at end of file diff --git a/test/test_client.py b/test/test_client.py new file mode 100644 index 0000000..d389a5c --- /dev/null +++ b/test/test_client.py @@ -0,0 +1,40 @@ +import sys +sys.path = ['..'] + sys.path + +from thrift import Thrift +from thrift.transport import TSocket +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol + +from lib.genpyblocking.snowflake import Snowflake +from lib.genpyblocking.snowflake.ttypes import * + +def print_usage(): + print 'python test_client.py <port> <get_worker_id|get_datacenter_id|get_timestamp|get_id>' + +def main(): + if len(sys.argv) != 3: + return print_usage() + + port = int(sys.argv[1]) + service = sys.argv[2] + + transport = TSocket.TSocket('localhost', port) + transport = TTransport.TFramedTransport(transport) + prot = TBinaryProtocol.TBinaryProtocol(transport) + client = Snowflake.Client(prot) + transport.open() + + if service == 'get_worker_id': + print client.get_worker_id() + elif service == 'get_datacenter_id': + print client.get_datacenter_id() + elif service == 'get_timestamp': + print client.get_timestamp() + elif service == 'get_id': + print client.get_id() + else: + print_usage() + +if __name__ == '__main__': + sys.exit(main()) \ No newline at end of file
michaelmontano/snowflakepy
5ee5f91913f7d77c7e5d8eff359d33559d7a7c98
don't use relative imports, instead add .. to path
diff --git a/test/test_idworker.py b/test/test_idworker.py index d0acf33..21c8a96 100644 --- a/test/test_idworker.py +++ b/test/test_idworker.py @@ -1,93 +1,96 @@ -from ..src import idworker +import sys +sys.path = ['..'] + sys.path + +from src import idworker import time WORKER_MASK = 0x000000000001F000 DATACENTER_MASK = 0x00000000003E0000 TIMESTAMP_MASK = 0xFFFFFFFFFFC00000 def test_generate_id(): worker = idworker.IdWorker(1, 1) tid = worker.next_id() assert tid > 0 def test_generate_timestamp(): worker = idworker.IdWorker(1, 1) t = int(time.time()*1000) assert (worker.get_timestamp() - t) < 50 def test_get_worker_id(): worker = idworker.IdWorker(1, 1) assert worker.get_worker_id() == 1 def test_get_datacenter_id(): worker = idworker.IdWorker(1, 1) assert worker.get_datacenter_id() == 1 def test_mask_worker_id(): worker_id = 0x1F datacenter_id = 0 worker = idworker.IdWorker(worker_id, datacenter_id) tid = worker.next_id() assert (tid & WORKER_MASK) >> idworker.WORKER_ID_SHIFT == worker_id def test_mask_datacenter_id(): worker_id = 0 datacenter_id = 0x1F worker = idworker.IdWorker(worker_id, datacenter_id) tid = worker.next_id() assert (tid & DATACENTER_MASK) >> idworker.DATACENTER_ID_SHIFT == datacenter_id def test_mask_timestamp(): t = int(time.time()*1000) worker_id = 1 datacenter_id = 1 worker = idworker.IdWorker(worker_id, datacenter_id) tid = worker.next_id() assert ((tid & TIMESTAMP_MASK) >> idworker.TIMESTAMP_SHIFT) + idworker.TWEPOCH >= t def test_roll_over_sequence_id(): worker_id = 4 datacenter_id = 4 worker = idworker.IdWorker(worker_id, datacenter_id) start_sequence = 0xFFFFFF-20 end_sequence = 0xFFFFFF+20 worker.sequence = start_sequence for i in range(start_sequence, end_sequence + 1): tid = worker.next_id() assert (tid & WORKER_MASK) >> idworker.WORKER_ID_SHIFT == worker_id def test_generate_increasing_ids(): worker = idworker.IdWorker(1, 1) last_id = 0 for i in range(100): tid = worker.next_id() assert tid > last_id last_id = tid def test_generate_one_million_ids_quickly(): worker = idworker.IdWorker(31, 31) t1 = int(time.time()*1000) for i in range(100000): tid = worker.next_id() assert tid t2 = int(time.time()*1000) rate = 100000.0/(t2 - t1) print 'generated 100000 ids in %d ms, or %s ids/ms' %(t2 - t1, rate) assert rate > 100 def test_sleep_on_same_id(): worker = idworker.WakingIdWorker(1, 1) worker.sequence = 4095 tid1 = worker.next_id() worker.sequence = 4095 tid2 = worker.next_id() assert worker.sleeps > 0 def test_generate_unique_ids(): worker = idworker.IdWorker(31, 31) s = set() n = 200000 for i in range(n): tid = worker.next_id() s.add(tid) assert len(s) == n \ No newline at end of file
michaelmontano/snowflakepy
38d5a9e02b44ac8a404f43766a0871abf0d1b4bb
python thrift libraries (blocking and non-blocking using Twisted)
diff --git a/genthrift.sh b/genthrift.sh new file mode 100644 index 0000000..da6297c --- /dev/null +++ b/genthrift.sh @@ -0,0 +1,4 @@ +rm -rf lib/genpyblocking rm -rf lib/genpy +thrift --gen py --gen py:twisted thrift/snowflake.thrift +mv gen-py lib/genpyblocking +mv gen-py.twisted lib/genpy \ No newline at end of file diff --git a/lib/__init__.py b/lib/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/lib/genpy/__init__.py b/lib/genpy/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/lib/genpy/snowflake/Snowflake-remote b/lib/genpy/snowflake/Snowflake-remote new file mode 100755 index 0000000..127e837 --- /dev/null +++ b/lib/genpy/snowflake/Snowflake-remote @@ -0,0 +1,100 @@ +#!/usr/bin/env python +# +# Autogenerated by Thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# + +import sys +import pprint +from urlparse import urlparse +from thrift.transport import TTransport +from thrift.transport import TSocket +from thrift.transport import THttpClient +from thrift.protocol import TBinaryProtocol + +import Snowflake +from ttypes import * + +if len(sys.argv) <= 1 or sys.argv[1] == '--help': + print '' + print 'Usage: ' + sys.argv[0] + ' [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]' + print '' + print 'Functions:' + print ' i64 get_worker_id()' + print ' i64 get_datacenter_id()' + print ' i64 get_timestamp()' + print ' i64 get_id()' + print '' + sys.exit(0) + +pp = pprint.PrettyPrinter(indent = 2) +host = 'localhost' +port = 9090 +uri = '' +framed = False +http = False +argi = 1 + +if sys.argv[argi] == '-h': + parts = sys.argv[argi+1].split(':') + host = parts[0] + port = int(parts[1]) + argi += 2 + +if sys.argv[argi] == '-u': + url = urlparse(sys.argv[argi+1]) + parts = url[1].split(':') + host = parts[0] + if len(parts) > 1: + port = int(parts[1]) + else: + port = 80 + uri = url[2] + http = True + argi += 2 + +if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed': + framed = True + argi += 1 + +cmd = sys.argv[argi] +args = sys.argv[argi+1:] + +if http: + transport = THttpClient.THttpClient(host, port, uri) +else: + socket = TSocket.TSocket(host, port) + if framed: + transport = TTransport.TFramedTransport(socket) + else: + transport = TTransport.TBufferedTransport(socket) +protocol = TBinaryProtocol.TBinaryProtocol(transport) +client = Snowflake.Client(protocol) +transport.open() + +if cmd == 'get_worker_id': + if len(args) != 0: + print 'get_worker_id requires 0 args' + sys.exit(1) + pp.pprint(client.get_worker_id()) + +elif cmd == 'get_datacenter_id': + if len(args) != 0: + print 'get_datacenter_id requires 0 args' + sys.exit(1) + pp.pprint(client.get_datacenter_id()) + +elif cmd == 'get_timestamp': + if len(args) != 0: + print 'get_timestamp requires 0 args' + sys.exit(1) + pp.pprint(client.get_timestamp()) + +elif cmd == 'get_id': + if len(args) != 0: + print 'get_id requires 0 args' + sys.exit(1) + pp.pprint(client.get_id()) + +transport.close() diff --git a/lib/genpy/snowflake/Snowflake.py b/lib/genpy/snowflake/Snowflake.py new file mode 100644 index 0000000..60ac546 --- /dev/null +++ b/lib/genpy/snowflake/Snowflake.py @@ -0,0 +1,621 @@ +# +# Autogenerated by Thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# + +from thrift.Thrift import * +from ttypes import * +from thrift.Thrift import TProcessor +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol +try: + from thrift.protocol import fastbinary +except: + fastbinary = None + +from zope.interface import Interface, implements +from twisted.internet import defer +from thrift.transport import TTwisted + +class Iface(Interface): + def get_worker_id(): + pass + + def get_datacenter_id(): + pass + + def get_timestamp(): + pass + + def get_id(): + pass + + +class Client: + implements(Iface) + + def __init__(self, transport, oprot_factory): + self._transport = transport + self._oprot_factory = oprot_factory + self._seqid = 0 + self._reqs = {} + + def get_worker_id(self, ): + self._seqid += 1 + d = self._reqs[self._seqid] = defer.Deferred() + self.send_get_worker_id() + return d + + def send_get_worker_id(self, ): + oprot = self._oprot_factory.getProtocol(self._transport) + oprot.writeMessageBegin('get_worker_id', TMessageType.CALL, self._seqid) + args = get_worker_id_args() + args.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def recv_get_worker_id(self, iprot, mtype, rseqid): + d = self._reqs.pop(rseqid) + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + return d.errback(x) + result = get_worker_id_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success != None: + return d.callback(result.success) + return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "get_worker_id failed: unknown result")) + + def get_datacenter_id(self, ): + self._seqid += 1 + d = self._reqs[self._seqid] = defer.Deferred() + self.send_get_datacenter_id() + return d + + def send_get_datacenter_id(self, ): + oprot = self._oprot_factory.getProtocol(self._transport) + oprot.writeMessageBegin('get_datacenter_id', TMessageType.CALL, self._seqid) + args = get_datacenter_id_args() + args.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def recv_get_datacenter_id(self, iprot, mtype, rseqid): + d = self._reqs.pop(rseqid) + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + return d.errback(x) + result = get_datacenter_id_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success != None: + return d.callback(result.success) + return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "get_datacenter_id failed: unknown result")) + + def get_timestamp(self, ): + self._seqid += 1 + d = self._reqs[self._seqid] = defer.Deferred() + self.send_get_timestamp() + return d + + def send_get_timestamp(self, ): + oprot = self._oprot_factory.getProtocol(self._transport) + oprot.writeMessageBegin('get_timestamp', TMessageType.CALL, self._seqid) + args = get_timestamp_args() + args.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def recv_get_timestamp(self, iprot, mtype, rseqid): + d = self._reqs.pop(rseqid) + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + return d.errback(x) + result = get_timestamp_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success != None: + return d.callback(result.success) + return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "get_timestamp failed: unknown result")) + + def get_id(self, ): + self._seqid += 1 + d = self._reqs[self._seqid] = defer.Deferred() + self.send_get_id() + return d + + def send_get_id(self, ): + oprot = self._oprot_factory.getProtocol(self._transport) + oprot.writeMessageBegin('get_id', TMessageType.CALL, self._seqid) + args = get_id_args() + args.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def recv_get_id(self, iprot, mtype, rseqid): + d = self._reqs.pop(rseqid) + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(iprot) + iprot.readMessageEnd() + return d.errback(x) + result = get_id_result() + result.read(iprot) + iprot.readMessageEnd() + if result.success != None: + return d.callback(result.success) + return d.errback(TApplicationException(TApplicationException.MISSING_RESULT, "get_id failed: unknown result")) + + +class Processor(TProcessor): + implements(Iface) + + def __init__(self, handler): + self._handler = Iface(handler) + self._processMap = {} + self._processMap["get_worker_id"] = Processor.process_get_worker_id + self._processMap["get_datacenter_id"] = Processor.process_get_datacenter_id + self._processMap["get_timestamp"] = Processor.process_get_timestamp + self._processMap["get_id"] = Processor.process_get_id + + def process(self, iprot, oprot): + (name, type, seqid) = iprot.readMessageBegin() + if name not in self._processMap: + iprot.skip(TType.STRUCT) + iprot.readMessageEnd() + x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) + oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) + x.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + return defer.succeed(None) + else: + return self._processMap[name](self, seqid, iprot, oprot) + + def process_get_worker_id(self, seqid, iprot, oprot): + args = get_worker_id_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_worker_id_result() + d = defer.maybeDeferred(self._handler.get_worker_id, ) + d.addCallback(self.write_results_success_get_worker_id, result, seqid, oprot) + return d + + def write_results_success_get_worker_id(self, success, result, seqid, oprot): + result.success = success + oprot.writeMessageBegin("get_worker_id", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get_datacenter_id(self, seqid, iprot, oprot): + args = get_datacenter_id_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_datacenter_id_result() + d = defer.maybeDeferred(self._handler.get_datacenter_id, ) + d.addCallback(self.write_results_success_get_datacenter_id, result, seqid, oprot) + return d + + def write_results_success_get_datacenter_id(self, success, result, seqid, oprot): + result.success = success + oprot.writeMessageBegin("get_datacenter_id", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get_timestamp(self, seqid, iprot, oprot): + args = get_timestamp_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_timestamp_result() + d = defer.maybeDeferred(self._handler.get_timestamp, ) + d.addCallback(self.write_results_success_get_timestamp, result, seqid, oprot) + return d + + def write_results_success_get_timestamp(self, success, result, seqid, oprot): + result.success = success + oprot.writeMessageBegin("get_timestamp", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get_id(self, seqid, iprot, oprot): + args = get_id_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_id_result() + d = defer.maybeDeferred(self._handler.get_id, ) + d.addCallback(self.write_results_success_get_id, result, seqid, oprot) + return d + + def write_results_success_get_id(self, success, result, seqid, oprot): + result.success = success + oprot.writeMessageBegin("get_id", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + +# HELPER FUNCTIONS AND STRUCTURES + +class get_worker_id_args: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_worker_id_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class get_worker_id_result: + """ + Attributes: + - success + """ + + thrift_spec = ( + (0, TType.I64, 'success', None, None, ), # 0 + ) + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.I64: + self.success = iprot.readI64(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_worker_id_result') + if self.success != None: + oprot.writeFieldBegin('success', TType.I64, 0) + oprot.writeI64(self.success) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class get_datacenter_id_args: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_datacenter_id_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class get_datacenter_id_result: + """ + Attributes: + - success + """ + + thrift_spec = ( + (0, TType.I64, 'success', None, None, ), # 0 + ) + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.I64: + self.success = iprot.readI64(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_datacenter_id_result') + if self.success != None: + oprot.writeFieldBegin('success', TType.I64, 0) + oprot.writeI64(self.success) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class get_timestamp_args: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_timestamp_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class get_timestamp_result: + """ + Attributes: + - success + """ + + thrift_spec = ( + (0, TType.I64, 'success', None, None, ), # 0 + ) + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.I64: + self.success = iprot.readI64(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_timestamp_result') + if self.success != None: + oprot.writeFieldBegin('success', TType.I64, 0) + oprot.writeI64(self.success) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class get_id_args: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_id_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class get_id_result: + """ + Attributes: + - success + """ + + thrift_spec = ( + (0, TType.I64, 'success', None, None, ), # 0 + ) + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.I64: + self.success = iprot.readI64(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_id_result') + if self.success != None: + oprot.writeFieldBegin('success', TType.I64, 0) + oprot.writeI64(self.success) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + diff --git a/lib/genpy/snowflake/__init__.py b/lib/genpy/snowflake/__init__.py new file mode 100644 index 0000000..128bb88 --- /dev/null +++ b/lib/genpy/snowflake/__init__.py @@ -0,0 +1 @@ +__all__ = ['ttypes', 'constants', 'Snowflake'] diff --git a/lib/genpy/snowflake/constants.py b/lib/genpy/snowflake/constants.py new file mode 100644 index 0000000..2f17ec3 --- /dev/null +++ b/lib/genpy/snowflake/constants.py @@ -0,0 +1,9 @@ +# +# Autogenerated by Thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# + +from thrift.Thrift import * +from ttypes import * + diff --git a/lib/genpy/snowflake/ttypes.py b/lib/genpy/snowflake/ttypes.py new file mode 100644 index 0000000..c98f71f --- /dev/null +++ b/lib/genpy/snowflake/ttypes.py @@ -0,0 +1,16 @@ +# +# Autogenerated by Thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# + +from thrift.Thrift import * + +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol +try: + from thrift.protocol import fastbinary +except: + fastbinary = None + + diff --git a/lib/genpyblocking/__init__.py b/lib/genpyblocking/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/lib/genpyblocking/snowflake/Snowflake-remote b/lib/genpyblocking/snowflake/Snowflake-remote new file mode 100755 index 0000000..127e837 --- /dev/null +++ b/lib/genpyblocking/snowflake/Snowflake-remote @@ -0,0 +1,100 @@ +#!/usr/bin/env python +# +# Autogenerated by Thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# + +import sys +import pprint +from urlparse import urlparse +from thrift.transport import TTransport +from thrift.transport import TSocket +from thrift.transport import THttpClient +from thrift.protocol import TBinaryProtocol + +import Snowflake +from ttypes import * + +if len(sys.argv) <= 1 or sys.argv[1] == '--help': + print '' + print 'Usage: ' + sys.argv[0] + ' [-h host:port] [-u url] [-f[ramed]] function [arg1 [arg2...]]' + print '' + print 'Functions:' + print ' i64 get_worker_id()' + print ' i64 get_datacenter_id()' + print ' i64 get_timestamp()' + print ' i64 get_id()' + print '' + sys.exit(0) + +pp = pprint.PrettyPrinter(indent = 2) +host = 'localhost' +port = 9090 +uri = '' +framed = False +http = False +argi = 1 + +if sys.argv[argi] == '-h': + parts = sys.argv[argi+1].split(':') + host = parts[0] + port = int(parts[1]) + argi += 2 + +if sys.argv[argi] == '-u': + url = urlparse(sys.argv[argi+1]) + parts = url[1].split(':') + host = parts[0] + if len(parts) > 1: + port = int(parts[1]) + else: + port = 80 + uri = url[2] + http = True + argi += 2 + +if sys.argv[argi] == '-f' or sys.argv[argi] == '-framed': + framed = True + argi += 1 + +cmd = sys.argv[argi] +args = sys.argv[argi+1:] + +if http: + transport = THttpClient.THttpClient(host, port, uri) +else: + socket = TSocket.TSocket(host, port) + if framed: + transport = TTransport.TFramedTransport(socket) + else: + transport = TTransport.TBufferedTransport(socket) +protocol = TBinaryProtocol.TBinaryProtocol(transport) +client = Snowflake.Client(protocol) +transport.open() + +if cmd == 'get_worker_id': + if len(args) != 0: + print 'get_worker_id requires 0 args' + sys.exit(1) + pp.pprint(client.get_worker_id()) + +elif cmd == 'get_datacenter_id': + if len(args) != 0: + print 'get_datacenter_id requires 0 args' + sys.exit(1) + pp.pprint(client.get_datacenter_id()) + +elif cmd == 'get_timestamp': + if len(args) != 0: + print 'get_timestamp requires 0 args' + sys.exit(1) + pp.pprint(client.get_timestamp()) + +elif cmd == 'get_id': + if len(args) != 0: + print 'get_id requires 0 args' + sys.exit(1) + pp.pprint(client.get_id()) + +transport.close() diff --git a/lib/genpyblocking/snowflake/Snowflake.py b/lib/genpyblocking/snowflake/Snowflake.py new file mode 100644 index 0000000..53f6e9c --- /dev/null +++ b/lib/genpyblocking/snowflake/Snowflake.py @@ -0,0 +1,583 @@ +# +# Autogenerated by Thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# + +from thrift.Thrift import * +from ttypes import * +from thrift.Thrift import TProcessor +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol +try: + from thrift.protocol import fastbinary +except: + fastbinary = None + + +class Iface: + def get_worker_id(self, ): + pass + + def get_datacenter_id(self, ): + pass + + def get_timestamp(self, ): + pass + + def get_id(self, ): + pass + + +class Client(Iface): + def __init__(self, iprot, oprot=None): + self._iprot = self._oprot = iprot + if oprot != None: + self._oprot = oprot + self._seqid = 0 + + def get_worker_id(self, ): + self.send_get_worker_id() + return self.recv_get_worker_id() + + def send_get_worker_id(self, ): + self._oprot.writeMessageBegin('get_worker_id', TMessageType.CALL, self._seqid) + args = get_worker_id_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_get_worker_id(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = get_worker_id_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success != None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "get_worker_id failed: unknown result"); + + def get_datacenter_id(self, ): + self.send_get_datacenter_id() + return self.recv_get_datacenter_id() + + def send_get_datacenter_id(self, ): + self._oprot.writeMessageBegin('get_datacenter_id', TMessageType.CALL, self._seqid) + args = get_datacenter_id_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_get_datacenter_id(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = get_datacenter_id_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success != None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "get_datacenter_id failed: unknown result"); + + def get_timestamp(self, ): + self.send_get_timestamp() + return self.recv_get_timestamp() + + def send_get_timestamp(self, ): + self._oprot.writeMessageBegin('get_timestamp', TMessageType.CALL, self._seqid) + args = get_timestamp_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_get_timestamp(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = get_timestamp_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success != None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "get_timestamp failed: unknown result"); + + def get_id(self, ): + self.send_get_id() + return self.recv_get_id() + + def send_get_id(self, ): + self._oprot.writeMessageBegin('get_id', TMessageType.CALL, self._seqid) + args = get_id_args() + args.write(self._oprot) + self._oprot.writeMessageEnd() + self._oprot.trans.flush() + + def recv_get_id(self, ): + (fname, mtype, rseqid) = self._iprot.readMessageBegin() + if mtype == TMessageType.EXCEPTION: + x = TApplicationException() + x.read(self._iprot) + self._iprot.readMessageEnd() + raise x + result = get_id_result() + result.read(self._iprot) + self._iprot.readMessageEnd() + if result.success != None: + return result.success + raise TApplicationException(TApplicationException.MISSING_RESULT, "get_id failed: unknown result"); + + +class Processor(Iface, TProcessor): + def __init__(self, handler): + self._handler = handler + self._processMap = {} + self._processMap["get_worker_id"] = Processor.process_get_worker_id + self._processMap["get_datacenter_id"] = Processor.process_get_datacenter_id + self._processMap["get_timestamp"] = Processor.process_get_timestamp + self._processMap["get_id"] = Processor.process_get_id + + def process(self, iprot, oprot): + (name, type, seqid) = iprot.readMessageBegin() + if name not in self._processMap: + iprot.skip(TType.STRUCT) + iprot.readMessageEnd() + x = TApplicationException(TApplicationException.UNKNOWN_METHOD, 'Unknown function %s' % (name)) + oprot.writeMessageBegin(name, TMessageType.EXCEPTION, seqid) + x.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + return + else: + self._processMap[name](self, seqid, iprot, oprot) + return True + + def process_get_worker_id(self, seqid, iprot, oprot): + args = get_worker_id_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_worker_id_result() + result.success = self._handler.get_worker_id() + oprot.writeMessageBegin("get_worker_id", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get_datacenter_id(self, seqid, iprot, oprot): + args = get_datacenter_id_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_datacenter_id_result() + result.success = self._handler.get_datacenter_id() + oprot.writeMessageBegin("get_datacenter_id", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get_timestamp(self, seqid, iprot, oprot): + args = get_timestamp_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_timestamp_result() + result.success = self._handler.get_timestamp() + oprot.writeMessageBegin("get_timestamp", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + def process_get_id(self, seqid, iprot, oprot): + args = get_id_args() + args.read(iprot) + iprot.readMessageEnd() + result = get_id_result() + result.success = self._handler.get_id() + oprot.writeMessageBegin("get_id", TMessageType.REPLY, seqid) + result.write(oprot) + oprot.writeMessageEnd() + oprot.trans.flush() + + +# HELPER FUNCTIONS AND STRUCTURES + +class get_worker_id_args: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_worker_id_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class get_worker_id_result: + """ + Attributes: + - success + """ + + thrift_spec = ( + (0, TType.I64, 'success', None, None, ), # 0 + ) + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.I64: + self.success = iprot.readI64(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_worker_id_result') + if self.success != None: + oprot.writeFieldBegin('success', TType.I64, 0) + oprot.writeI64(self.success) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class get_datacenter_id_args: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_datacenter_id_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class get_datacenter_id_result: + """ + Attributes: + - success + """ + + thrift_spec = ( + (0, TType.I64, 'success', None, None, ), # 0 + ) + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.I64: + self.success = iprot.readI64(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_datacenter_id_result') + if self.success != None: + oprot.writeFieldBegin('success', TType.I64, 0) + oprot.writeI64(self.success) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class get_timestamp_args: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_timestamp_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class get_timestamp_result: + """ + Attributes: + - success + """ + + thrift_spec = ( + (0, TType.I64, 'success', None, None, ), # 0 + ) + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.I64: + self.success = iprot.readI64(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_timestamp_result') + if self.success != None: + oprot.writeFieldBegin('success', TType.I64, 0) + oprot.writeI64(self.success) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class get_id_args: + + thrift_spec = ( + ) + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_id_args') + oprot.writeFieldStop() + oprot.writeStructEnd() + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + +class get_id_result: + """ + Attributes: + - success + """ + + thrift_spec = ( + (0, TType.I64, 'success', None, None, ), # 0 + ) + + def __init__(self, success=None,): + self.success = success + + def read(self, iprot): + if iprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and isinstance(iprot.trans, TTransport.CReadableTransport) and self.thrift_spec is not None and fastbinary is not None: + fastbinary.decode_binary(self, iprot.trans, (self.__class__, self.thrift_spec)) + return + iprot.readStructBegin() + while True: + (fname, ftype, fid) = iprot.readFieldBegin() + if ftype == TType.STOP: + break + if fid == 0: + if ftype == TType.I64: + self.success = iprot.readI64(); + else: + iprot.skip(ftype) + else: + iprot.skip(ftype) + iprot.readFieldEnd() + iprot.readStructEnd() + + def write(self, oprot): + if oprot.__class__ == TBinaryProtocol.TBinaryProtocolAccelerated and self.thrift_spec is not None and fastbinary is not None: + oprot.trans.write(fastbinary.encode_binary(self, (self.__class__, self.thrift_spec))) + return + oprot.writeStructBegin('get_id_result') + if self.success != None: + oprot.writeFieldBegin('success', TType.I64, 0) + oprot.writeI64(self.success) + oprot.writeFieldEnd() + oprot.writeFieldStop() + oprot.writeStructEnd() + + def __repr__(self): + L = ['%s=%r' % (key, value) + for key, value in self.__dict__.iteritems()] + return '%s(%s)' % (self.__class__.__name__, ', '.join(L)) + + def __eq__(self, other): + return isinstance(other, self.__class__) and self.__dict__ == other.__dict__ + + def __ne__(self, other): + return not (self == other) + + diff --git a/lib/genpyblocking/snowflake/__init__.py b/lib/genpyblocking/snowflake/__init__.py new file mode 100644 index 0000000..128bb88 --- /dev/null +++ b/lib/genpyblocking/snowflake/__init__.py @@ -0,0 +1 @@ +__all__ = ['ttypes', 'constants', 'Snowflake'] diff --git a/lib/genpyblocking/snowflake/constants.py b/lib/genpyblocking/snowflake/constants.py new file mode 100644 index 0000000..2f17ec3 --- /dev/null +++ b/lib/genpyblocking/snowflake/constants.py @@ -0,0 +1,9 @@ +# +# Autogenerated by Thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# + +from thrift.Thrift import * +from ttypes import * + diff --git a/lib/genpyblocking/snowflake/ttypes.py b/lib/genpyblocking/snowflake/ttypes.py new file mode 100644 index 0000000..c98f71f --- /dev/null +++ b/lib/genpyblocking/snowflake/ttypes.py @@ -0,0 +1,16 @@ +# +# Autogenerated by Thrift +# +# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING +# + +from thrift.Thrift import * + +from thrift.transport import TTransport +from thrift.protocol import TBinaryProtocol +try: + from thrift.protocol import fastbinary +except: + fastbinary = None + +
michaelmontano/snowflakepy
91a9f50cfecbcf80157e628bb1ea5b57e0c745d3
description in README
diff --git a/README b/README index e69de29..efd62ab 100644 --- a/README +++ b/README @@ -0,0 +1 @@ +A Python implementation of snowflake (http://github.com/twitter/snowflake). \ No newline at end of file
ghjunior/node-facebook
a6fa6903a0edec13db214bebd004f826ced0d0bc
updating to work with node v0.4.x
diff --git a/lib/facebook.js b/lib/facebook.js index 927568c..998f41c 100755 --- a/lib/facebook.js +++ b/lib/facebook.js @@ -1,202 +1,211 @@ var sys = require('sys'), crypto = require('crypto'), - http = require('http'), + https = require('https'), querystring = require('querystring'), phpjs = require('./phpjs'), EventEmitter = require('events').EventEmitter; function Facebook (config) { if (!(this instanceof Facebook)) { return new Facebook(config); }; this.appId = ''; this.apiKey = ''; this.appSecret = ''; for (var key in config) { this[key] = config[key]; }; }; sys.inherits(Facebook, EventEmitter); module.exports = Facebook; Facebook.prototype.callRest = function (req, params, callback) { var self = this; params['api_key'] = this.appId; params['format'] = 'json-strings'; this._oauthRequest(req, this.getApiUrl(params['method']), 'POST', 'restserver.php', params, callback); }; Facebook.prototype.callGraph = function (req, path, callback, method, params) { var self = this; method = method || 'GET'; this._oauthRequest(req, Facebook.DOMAIN_MAP['graph'], method, path, {}, callback); }; Facebook.prototype.getApiUrl = function(method) { var READ_ONLY_CALLS = { 'admin.getallocation': 1, 'admin.getappproperties': 1, 'admin.getbannedusers': 1, 'admin.getlivestreamvialink': 1, 'admin.getmetrics': 1, 'admin.getrestrictioninfo': 1, 'application.getpublicinfo': 1, 'auth.getapppublickey': 1, 'auth.getsession': 1, 'auth.getsignedpublicsessiondata': 1, 'comments.get': 1, 'connect.getunconnectedfriendscount': 1, 'dashboard.getactivity': 1, 'dashboard.getcount': 1, 'dashboard.getglobalnews': 1, 'dashboard.getnews': 1, 'dashboard.multigetcount': 1, 'dashboard.multigetnews': 1, 'data.getcookies': 1, 'events.get': 1, 'events.getmembers': 1, 'fbml.getcustomtags': 1, 'feed.getappfriendstories': 1, 'feed.getregisteredtemplatebundlebyid': 1, 'feed.getregisteredtemplatebundles': 1, 'fql.multiquery': 1, 'fql.query': 1, 'friends.arefriends': 1, 'friends.get': 1, 'friends.getappusers': 1, 'friends.getlists': 1, 'friends.getmutualfriends': 1, 'gifts.get': 1, 'groups.get': 1, 'groups.getmembers': 1, 'intl.gettranslations': 1, 'links.get': 1, 'notes.get': 1, 'notifications.get': 1, 'pages.getinfo': 1, 'pages.isadmin': 1, 'pages.isappadded': 1, 'pages.isfan': 1, 'permissions.checkavailableapiaccess': 1, 'permissions.checkgrantedapiaccess': 1, 'photos.get': 1, 'photos.getalbums': 1, 'photos.gettags': 1, 'profile.getinfo': 1, 'profile.getinfooptions': 1, 'stream.get': 1, 'stream.getcomments': 1, 'stream.getfilters': 1, 'users.getinfo': 1, 'users.getloggedinuser': 1, 'users.getstandardinfo': 1, 'users.hasapppermission': 1, 'users.isappuser': 1, 'users.isverified': 1, 'video.getuploadlimits': 1 }; var name = 'api'; if (method.toLowerCase() in READ_ONLY_CALLS) { name = 'api_read'; } return Facebook.DOMAIN_MAP[name]; } Facebook.prototype._oauthRequest = function(req, host, method, path, params, callback) { if (!('access_token' in params)) { params['access_token'] = this.getAccessToken(req); } for (var prop in params) { if (typeof(params[prop]) != 'string') { params[prop] = JSON.stringify(params[prop]); } } this.makeRequest(host, method, path, params, callback); } Facebook.prototype.makeRequest = function(host, method, path, params, callback) { params = phpjs.http_build_query(params, null, '&'); - var fb_client = http.createClient('443', host, true); + var options = { + host: host, + port: '443', + method: method, + path: path, + headers: {'host': host, 'User-Agent': 'NodeJS HTTP Client'} + }; - if (method == 'GET') { - path = path + '?' + params; - var fb_request = fb_client.request(method, path, {'host': host, 'User-Agent': 'NodeJS HTTP Client'}); + if (method == 'GET') { + options.path = path + '?' + params; + var fb_request = https.request(options); } else { - var fb_request = fb_client.request(method, path, {'host': host, 'User-Agent': 'NodeJS HTTP Client', 'Content-Length': params.length, 'Content-Type': 'application/x-www-form-urlencoded'}); - fb_request.write(params); + options.headers = {'host': host, 'User-Agent': 'NodeJS HTTP Client', 'Content-Length': params.length, 'Content-Type': 'application/x-www-form-urlencoded'}; + var fb_request = https.request(options); + + fb_request.write(params); } - - fb_request.end(); - fb_request.on('response', function (response) { + fb_request.on('response', function (response) { response.setEncoding('utf8'); var chunks = ''; response.on('data', function (chunk) { chunks += chunk; }); + response.on('end', function () { - callback(chunks); + callback(chunks); }); }); + + fb_request.end(); } /** * COOKIES AND SESSION */ Facebook.prototype.getAccessToken = function(req) { /*$session = $this->getSession(); // either user session signed, or app signed if ($session) { return $session['access_token']; } else { return $this->getAppId() .'|'. $this->getApiSecret(); }*/ var cookie = this.getCookie(req.cookies); return cookie.access_token; } Facebook.prototype.getSessionCookieName = function () { return 'fbs_' + this.appId; } Facebook.prototype.getCookie = function(cookies) { var args = [], payload = '', fb_cookie; fb_cookie = cookies[this.getSessionCookieName()] || ''; args = querystring.parse(fb_cookie.replace(/\\/,'').replace(/"/,'')); var keys = Object.keys(args).sort(); keys.forEach(function(key) { var value = args[key]; if (key !== 'sig') { payload += key + '=' + value; } }); var digest = crypto.createHash('md5').update(payload + this.appSecret).digest('hex'); if (digest !== args.sig) { return null; }; return args; }; /** * CONSTANTS */ Facebook.DOMAIN_MAP = { 'api' : 'api.facebook.com', 'api_read' : 'api-read.facebook.com', 'graph' : 'graph.facebook.com', 'www' : 'www.facebook.com' };
ghjunior/node-facebook
66856e3af6a100754266bb3e0bfc6ed7b28e6445
clarifying readme
diff --git a/readme.md b/readme.md index 30573ed..d5f6615 100644 --- a/readme.md +++ b/readme.md @@ -1,10 +1,12 @@ # node-facebook Borrowing some ideas from the [PHP SDK](http://github.com/facebook/php-sdk) to connect to the Facebook API via node.js +The access_token utilized to make calls is currently retrieved from the request cookie headers. Therefore all calls must pass along a request with a 'cookies' property containing the parsed cookie header (i.e. req.cookies). A more flexible approach will come soon or feel free to fork. + Still a lot to add on and move around but it's a start. Also see: - [http://coolaj86.github.com/articles/facebook-with-node.js.html](http://coolaj86.github.com/articles/facebook-with-node.js.html) - [http://developers.facebook.com/docs/authentication/](http://developers.facebook.com/docs/authentication/)
nekop/java-examples
b44ddcba5f6a437217674f388af646ed1a10f998
Move persistence.xml under main tree
diff --git a/ee6/jpa/src/test/resources/persistence.xml b/ee6/jpa/src/main/resources/META-INF/persistence.xml similarity index 100% rename from ee6/jpa/src/test/resources/persistence.xml rename to ee6/jpa/src/main/resources/META-INF/persistence.xml diff --git a/ee6/jpa/src/test/java/com/github/nekop/example/jpa/CatTest.java b/ee6/jpa/src/test/java/com/github/nekop/example/jpa/CatTest.java index 86e4950..461b0fa 100644 --- a/ee6/jpa/src/test/java/com/github/nekop/example/jpa/CatTest.java +++ b/ee6/jpa/src/test/java/com/github/nekop/example/jpa/CatTest.java @@ -1,50 +1,50 @@ package com.github.nekop.example.jpa; import javax.inject.Inject; import javax.persistence.EntityManager; import javax.persistence.PersistenceContext; import javax.transaction.UserTransaction; import org.jboss.arquillian.container.test.api.Deployment; import org.jboss.arquillian.junit.Arquillian; import org.jboss.shrinkwrap.api.Archive; import org.jboss.shrinkwrap.api.ShrinkWrap; import org.jboss.shrinkwrap.api.asset.EmptyAsset; import org.jboss.shrinkwrap.api.spec.JavaArchive; import org.junit.Test; import org.junit.runner.RunWith; @RunWith(Arquillian.class) public class CatTest { @Deployment public static JavaArchive createDeployment() { return ShrinkWrap.create(JavaArchive.class) .addPackage(Cat.class.getPackage()) - .addAsManifestResource("persistence.xml", "persistence.xml") + .addAsManifestResource("META-INF/persistence.xml", "persistence.xml") .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); } @Inject UserTransaction ut; @PersistenceContext EntityManager em; @Test public void testPersist() throws Exception { System.out.println(em); ut.begin(); em.createNativeQuery("SET WRITE_DELAY FALSE").executeUpdate(); ut.commit(); ut.begin(); Cat cat = new Cat(); em.persist(cat); em.flush(); ut.commit(); System.out.println(em.createQuery("from Cat").getSingleResult()); } }
nekop/java-examples
9c22ea14dc34b0c7e65706b222971e3be34313bb
Add jpa example
diff --git a/ee6/jpa/pom.xml b/ee6/jpa/pom.xml new file mode 100644 index 0000000..6c758c7 --- /dev/null +++ b/ee6/jpa/pom.xml @@ -0,0 +1,174 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <!-- + Java EE 6 minimal pom.xml, works with JBoss EAP 6. + + https://github.com/nekop/java-examples/blob/master/maven/ + + Put your source code, config files, boot the application server and run: + $ mvn clean install -Parq-remote + + [Summary] + Additional Repository: JBoss Public + Compile Deps: Java EE 6 Web Profile + Test Deps: JUnit, Arquillian and ShrinkWrap Resolver + Profiles: arq-managed, arq-remote + --> + + <modelVersion>4.0.0</modelVersion> + <groupId>com.github.nekop.example.jpa</groupId> + <artifactId>example-jpa</artifactId> + <packaging>war</packaging> + <version>1.0</version> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + + <version.org.jboss.spec.jboss-javaee-web-6.0>3.0.3.Final</version.org.jboss.spec.jboss-javaee-web-6.0> + + <version.org.jboss.arquillian.arquillian-bom>1.1.7.Final</version.org.jboss.arquillian.arquillian-bom> + <version.org.jboss.as.jboss-as-arquillian-container-managed>7.2.0.Final</version.org.jboss.as.jboss-as-arquillian-container-managed> + <version.org.jboss.as.jboss-as-arquillian-container-remote>7.2.0.Final</version.org.jboss.as.jboss-as-arquillian-container-remote> + <version.junit>4.12</version.junit> + <version.maven-surefire-plugin>2.18.1</version.maven-surefire-plugin> + <version.maven-compiler-plugin>3.3</version.maven-compiler-plugin> + <version.maven-war-plugin>2.6</version.maven-war-plugin> + </properties> + + <repositories> + <repository> + <id>jboss-public</id> + <name>JBoss Public Maven Repository Group</name> + <url>https://repository.jboss.org/nexus/content/groups/public/</url> + <layout>default</layout> + <releases> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>jboss-public</id> + <name>JBoss Public Maven Repository Group</name> + <url>https://repository.jboss.org/nexus/content/groups/public/</url> + <layout>default</layout> + <releases> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.jboss.arquillian</groupId> + <artifactId>arquillian-bom</artifactId> + <version>${version.org.jboss.arquillian.arquillian-bom}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <!-- This Java EE 6 API jar is crippled, do NOT use for real projects/testing. + Fixed in Java EE 7. + <dependency> + <groupId>javax</groupId> + <artifactId>javaee-web-api</artifactId> + <version>6.0</version> + <scope>provided</scope> + </dependency> + --> + <!-- Java EE 6 API jars. It's actually a bom, but we can use it as a depchain --> + <dependency> + <groupId>org.jboss.spec</groupId> + <artifactId>jboss-javaee-web-6.0</artifactId> + <version>${version.org.jboss.spec.jboss-javaee-web-6.0}</version> + <scope>provided</scope> + <type>pom</type> + </dependency> + + <!-- test deps --> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>${version.junit}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jboss.arquillian.junit</groupId> + <artifactId>arquillian-junit-container</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jboss.shrinkwrap.resolver</groupId> + <artifactId>shrinkwrap-resolver-depchain</artifactId> + <type>pom</type> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <finalName>${project.artifactId}</finalName> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>${version.maven-compiler-plugin}</version> + <configuration> + <source>1.6</source> + <target>1.6</target> + </configuration> + </plugin> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <version>${version.maven-surefire-plugin}</version> + </plugin> + <plugin> + <artifactId>maven-war-plugin</artifactId> + <version>${version.maven-war-plugin}</version> + <configuration> + <failOnMissingWebXml>false</failOnMissingWebXml> + </configuration> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <id>arq-managed</id> + <dependencies> + <dependency> + <groupId>org.jboss.as</groupId> + <artifactId>jboss-as-arquillian-container-managed</artifactId> + <version>${version.org.jboss.as.jboss-as-arquillian-container-managed}</version> + <scope>test</scope> + </dependency> + </dependencies> + </profile> + + <profile> + <id>arq-remote</id> + <dependencies> + <dependency> + <groupId>org.jboss.as</groupId> + <artifactId>jboss-as-arquillian-container-remote</artifactId> + <version>${version.org.jboss.as.jboss-as-arquillian-container-remote}</version> + <scope>test</scope> + </dependency> + </dependencies> + </profile> + </profiles> + +</project> diff --git a/ee6/jpa/src/main/java/com/github/nekop/example/jpa/Cat.java b/ee6/jpa/src/main/java/com/github/nekop/example/jpa/Cat.java new file mode 100644 index 0000000..9f6025a --- /dev/null +++ b/ee6/jpa/src/main/java/com/github/nekop/example/jpa/Cat.java @@ -0,0 +1,31 @@ +package com.github.nekop.example.jpa; + +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.GeneratedValue; + +@Entity +public class Cat { + + @Id @GeneratedValue + private Integer id; + private String name; + + public Integer getId() { + return id; + } + + public void setId(Integer id) { + this.id = id; + } + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + +} diff --git a/ee6/jpa/src/test/java/com/github/nekop/example/jpa/CatTest.java b/ee6/jpa/src/test/java/com/github/nekop/example/jpa/CatTest.java new file mode 100644 index 0000000..86e4950 --- /dev/null +++ b/ee6/jpa/src/test/java/com/github/nekop/example/jpa/CatTest.java @@ -0,0 +1,50 @@ +package com.github.nekop.example.jpa; + +import javax.inject.Inject; +import javax.persistence.EntityManager; +import javax.persistence.PersistenceContext; +import javax.transaction.UserTransaction; +import org.jboss.arquillian.container.test.api.Deployment; +import org.jboss.arquillian.junit.Arquillian; +import org.jboss.shrinkwrap.api.Archive; +import org.jboss.shrinkwrap.api.ShrinkWrap; +import org.jboss.shrinkwrap.api.asset.EmptyAsset; +import org.jboss.shrinkwrap.api.spec.JavaArchive; +import org.junit.Test; +import org.junit.runner.RunWith; + +@RunWith(Arquillian.class) +public class CatTest { + + @Deployment + public static JavaArchive createDeployment() { + return ShrinkWrap.create(JavaArchive.class) + .addPackage(Cat.class.getPackage()) + .addAsManifestResource("persistence.xml", "persistence.xml") + .addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml"); + } + + @Inject + UserTransaction ut; + + @PersistenceContext + EntityManager em; + + @Test + public void testPersist() throws Exception { + System.out.println(em); + + ut.begin(); + em.createNativeQuery("SET WRITE_DELAY FALSE").executeUpdate(); + ut.commit(); + + ut.begin(); + Cat cat = new Cat(); + em.persist(cat); + em.flush(); + ut.commit(); + + System.out.println(em.createQuery("from Cat").getSingleResult()); + } + +} diff --git a/ee6/jpa/src/test/resources/persistence.xml b/ee6/jpa/src/test/resources/persistence.xml new file mode 100644 index 0000000..d3e052e --- /dev/null +++ b/ee6/jpa/src/test/resources/persistence.xml @@ -0,0 +1,20 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<persistence xmlns="http://java.sun.com/xml/ns/persistence" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd" + version="2.0"> + <persistence-unit name="test" transaction-type="JTA"> + <provider>org.hibernate.ejb.HibernatePersistence</provider> + <jta-data-source>java:jboss/datasources/ExampleDS</jta-data-source> + <shared-cache-mode>ALL</shared-cache-mode> + <properties> + <property name="hibernate.cache.use_second_level_cache" value="true"/> + <property name="hibernate.cache.use_query_cache" value="true"/> + <property name="hibernate.dialect" value="org.hibernate.dialect.HSQLDialect"/> + <property name="hibernate.max_fetch_depth" value="3"/> + <property name="hibernate.hbm2ddl.auto" value="create-drop"/> + <property name="hibernate.show_sql" value="true"/> + </properties> + </persistence-unit> +</persistence>
nekop/java-examples
283e806ed68cef552766b7f6dc55bac83d3e0ffb
Archive old examples
diff --git a/README b/README deleted file mode 100644 index 41266a1..0000000 --- a/README +++ /dev/null @@ -1 +0,0 @@ -Various examples written in Java. diff --git a/README.md b/README.md new file mode 100644 index 0000000..dc5c20b --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +Various examples written in Java. + +Note that old things are moved under "old" directory. diff --git a/clustered-webapp/.gitignore b/clustered-webapp/.gitignore new file mode 100644 index 0000000..785d71d --- /dev/null +++ b/clustered-webapp/.gitignore @@ -0,0 +1 @@ +cluster-test.war diff --git a/ee6/README.md b/ee6/README.md new file mode 100644 index 0000000..b7a1093 --- /dev/null +++ b/ee6/README.md @@ -0,0 +1 @@ +Minimal Java EE 6 examples \ No newline at end of file diff --git a/as7-ear/appclient/pom.xml b/old/as7-ear/appclient/pom.xml similarity index 100% rename from as7-ear/appclient/pom.xml rename to old/as7-ear/appclient/pom.xml diff --git a/as7-ear/appclient/src/main/java/jp/programmers/as7/examples/HelloClient.java b/old/as7-ear/appclient/src/main/java/jp/programmers/as7/examples/HelloClient.java similarity index 100% rename from as7-ear/appclient/src/main/java/jp/programmers/as7/examples/HelloClient.java rename to old/as7-ear/appclient/src/main/java/jp/programmers/as7/examples/HelloClient.java diff --git a/as7-ear/ear/pom.xml b/old/as7-ear/ear/pom.xml similarity index 100% rename from as7-ear/ear/pom.xml rename to old/as7-ear/ear/pom.xml diff --git a/as7-ear/ejb/pom.xml b/old/as7-ear/ejb/pom.xml similarity index 100% rename from as7-ear/ejb/pom.xml rename to old/as7-ear/ejb/pom.xml diff --git a/as7-ear/ejb/src/main/java/jp/programmers/as7/examples/Hello.java b/old/as7-ear/ejb/src/main/java/jp/programmers/as7/examples/Hello.java similarity index 100% rename from as7-ear/ejb/src/main/java/jp/programmers/as7/examples/Hello.java rename to old/as7-ear/ejb/src/main/java/jp/programmers/as7/examples/Hello.java diff --git a/as7-ear/ejb/src/main/java/jp/programmers/as7/examples/HelloSLSB.java b/old/as7-ear/ejb/src/main/java/jp/programmers/as7/examples/HelloSLSB.java similarity index 100% rename from as7-ear/ejb/src/main/java/jp/programmers/as7/examples/HelloSLSB.java rename to old/as7-ear/ejb/src/main/java/jp/programmers/as7/examples/HelloSLSB.java diff --git a/as7-ear/pom.xml b/old/as7-ear/pom.xml similarity index 100% rename from as7-ear/pom.xml rename to old/as7-ear/pom.xml diff --git a/as7-ear/web/pom.xml b/old/as7-ear/web/pom.xml similarity index 100% rename from as7-ear/web/pom.xml rename to old/as7-ear/web/pom.xml diff --git a/as7-ejb/pom.xml b/old/as7-ejb/pom.xml similarity index 100% rename from as7-ejb/pom.xml rename to old/as7-ejb/pom.xml diff --git a/as7-ejb/run-client-clustered.sh b/old/as7-ejb/run-client-clustered.sh similarity index 100% rename from as7-ejb/run-client-clustered.sh rename to old/as7-ejb/run-client-clustered.sh diff --git a/as7-ejb/run-client-iiop.sh b/old/as7-ejb/run-client-iiop.sh similarity index 100% rename from as7-ejb/run-client-iiop.sh rename to old/as7-ejb/run-client-iiop.sh diff --git a/as7-ejb/run-client-ws.sh b/old/as7-ejb/run-client-ws.sh similarity index 100% rename from as7-ejb/run-client-ws.sh rename to old/as7-ejb/run-client-ws.sh diff --git a/as7-ejb/run-client.sh b/old/as7-ejb/run-client.sh similarity index 100% rename from as7-ejb/run-client.sh rename to old/as7-ejb/run-client.sh diff --git a/as7-ejb/src/main/java/jp/programmers/examples/ejb3/sfsb/Hello.java b/old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/sfsb/Hello.java similarity index 100% rename from as7-ejb/src/main/java/jp/programmers/examples/ejb3/sfsb/Hello.java rename to old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/sfsb/Hello.java diff --git a/as7-ejb/src/main/java/jp/programmers/examples/ejb3/sfsb/HelloSFSB.java b/old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/sfsb/HelloSFSB.java similarity index 100% rename from as7-ejb/src/main/java/jp/programmers/examples/ejb3/sfsb/HelloSFSB.java rename to old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/sfsb/HelloSFSB.java diff --git a/as7-ejb/src/main/java/jp/programmers/examples/ejb3/sfsb/HelloSFSBClient.java b/old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/sfsb/HelloSFSBClient.java similarity index 100% rename from as7-ejb/src/main/java/jp/programmers/examples/ejb3/sfsb/HelloSFSBClient.java rename to old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/sfsb/HelloSFSBClient.java diff --git a/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/Hello.java b/old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/Hello.java similarity index 100% rename from as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/Hello.java rename to old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/Hello.java diff --git a/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/HelloSLSB.java b/old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/HelloSLSB.java similarity index 100% rename from as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/HelloSLSB.java rename to old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/HelloSLSB.java diff --git a/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/HelloSLSBClient.java b/old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/HelloSLSBClient.java similarity index 100% rename from as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/HelloSLSBClient.java rename to old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/HelloSLSBClient.java diff --git a/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/HelloSLSBLoadClient.java b/old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/HelloSLSBLoadClient.java similarity index 100% rename from as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/HelloSLSBLoadClient.java rename to old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/HelloSLSBLoadClient.java diff --git a/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/clustered/ClusteredHelloSLSB.java b/old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/clustered/ClusteredHelloSLSB.java similarity index 100% rename from as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/clustered/ClusteredHelloSLSB.java rename to old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/clustered/ClusteredHelloSLSB.java diff --git a/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloHome.java b/old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloHome.java similarity index 100% rename from as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloHome.java rename to old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloHome.java diff --git a/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloIIOP.java b/old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloIIOP.java similarity index 100% rename from as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloIIOP.java rename to old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloIIOP.java diff --git a/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloIIOPClient.java b/old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloIIOPClient.java similarity index 100% rename from as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloIIOPClient.java rename to old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloIIOPClient.java diff --git a/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloRemote.java b/old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloRemote.java similarity index 100% rename from as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloRemote.java rename to old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloRemote.java diff --git a/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/ws/HelloEndpoint.java b/old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/ws/HelloEndpoint.java similarity index 100% rename from as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/ws/HelloEndpoint.java rename to old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/ws/HelloEndpoint.java diff --git a/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/ws/HelloWS.java b/old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/ws/HelloWS.java similarity index 100% rename from as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/ws/HelloWS.java rename to old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/ws/HelloWS.java diff --git a/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/ws/HelloWSClient.java b/old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/ws/HelloWSClient.java similarity index 100% rename from as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/ws/HelloWSClient.java rename to old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/slsb/ws/HelloWSClient.java diff --git a/as7-ejb/src/main/java/jp/programmers/examples/ejb3/startup/StartupBean.java b/old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/startup/StartupBean.java similarity index 100% rename from as7-ejb/src/main/java/jp/programmers/examples/ejb3/startup/StartupBean.java rename to old/as7-ejb/src/main/java/jp/programmers/examples/ejb3/startup/StartupBean.java diff --git a/as7-ejb/src/main/resources/META-INF/jboss-ejb3.xml b/old/as7-ejb/src/main/resources/META-INF/jboss-ejb3.xml similarity index 100% rename from as7-ejb/src/main/resources/META-INF/jboss-ejb3.xml rename to old/as7-ejb/src/main/resources/META-INF/jboss-ejb3.xml diff --git a/as7-ejb/src/main/resources/clustered-jboss-ejb-client.properties b/old/as7-ejb/src/main/resources/clustered-jboss-ejb-client.properties similarity index 100% rename from as7-ejb/src/main/resources/clustered-jboss-ejb-client.properties rename to old/as7-ejb/src/main/resources/clustered-jboss-ejb-client.properties diff --git a/as7-ejb/src/main/resources/finest-logging.properties b/old/as7-ejb/src/main/resources/finest-logging.properties similarity index 100% rename from as7-ejb/src/main/resources/finest-logging.properties rename to old/as7-ejb/src/main/resources/finest-logging.properties diff --git a/as7-ejb/src/main/resources/nonclustered-jboss-ejb-client.properties b/old/as7-ejb/src/main/resources/nonclustered-jboss-ejb-client.properties similarity index 100% rename from as7-ejb/src/main/resources/nonclustered-jboss-ejb-client.properties rename to old/as7-ejb/src/main/resources/nonclustered-jboss-ejb-client.properties diff --git a/as7-hello-service/pom.xml b/old/as7-hello-service/pom.xml similarity index 100% rename from as7-hello-service/pom.xml rename to old/as7-hello-service/pom.xml diff --git a/as7-hello-service/src/main/java/jp/programmers/jboss/hello/Hello.java b/old/as7-hello-service/src/main/java/jp/programmers/jboss/hello/Hello.java similarity index 100% rename from as7-hello-service/src/main/java/jp/programmers/jboss/hello/Hello.java rename to old/as7-hello-service/src/main/java/jp/programmers/jboss/hello/Hello.java diff --git a/as7-hello-service/src/main/java/jp/programmers/jboss/hello/HelloMBean.java b/old/as7-hello-service/src/main/java/jp/programmers/jboss/hello/HelloMBean.java similarity index 100% rename from as7-hello-service/src/main/java/jp/programmers/jboss/hello/HelloMBean.java rename to old/as7-hello-service/src/main/java/jp/programmers/jboss/hello/HelloMBean.java diff --git a/as7-hello-service/src/main/resources/META-INF/jboss-beans.xml.example b/old/as7-hello-service/src/main/resources/META-INF/jboss-beans.xml.example similarity index 100% rename from as7-hello-service/src/main/resources/META-INF/jboss-beans.xml.example rename to old/as7-hello-service/src/main/resources/META-INF/jboss-beans.xml.example diff --git a/as7-hello-service/src/main/resources/META-INF/jboss-service.xml b/old/as7-hello-service/src/main/resources/META-INF/jboss-service.xml similarity index 100% rename from as7-hello-service/src/main/resources/META-INF/jboss-service.xml rename to old/as7-hello-service/src/main/resources/META-INF/jboss-service.xml diff --git a/customvalve/README.txt b/old/customvalve/README.txt similarity index 100% rename from customvalve/README.txt rename to old/customvalve/README.txt diff --git a/customvalve/build.properties b/old/customvalve/build.properties similarity index 100% rename from customvalve/build.properties rename to old/customvalve/build.properties diff --git a/customvalve/build.xml b/old/customvalve/build.xml similarity index 100% rename from customvalve/build.xml rename to old/customvalve/build.xml diff --git a/customvalve/context.xml b/old/customvalve/context.xml similarity index 100% rename from customvalve/context.xml rename to old/customvalve/context.xml diff --git a/customvalve/src/main/java/com/redhat/jboss/support/ConfigureSessionCookieResponseWrapper.java b/old/customvalve/src/main/java/com/redhat/jboss/support/ConfigureSessionCookieResponseWrapper.java similarity index 100% rename from customvalve/src/main/java/com/redhat/jboss/support/ConfigureSessionCookieResponseWrapper.java rename to old/customvalve/src/main/java/com/redhat/jboss/support/ConfigureSessionCookieResponseWrapper.java diff --git a/customvalve/src/main/java/com/redhat/jboss/support/ConfigureSessionCookieValve.java b/old/customvalve/src/main/java/com/redhat/jboss/support/ConfigureSessionCookieValve.java similarity index 100% rename from customvalve/src/main/java/com/redhat/jboss/support/ConfigureSessionCookieValve.java rename to old/customvalve/src/main/java/com/redhat/jboss/support/ConfigureSessionCookieValve.java diff --git a/customvalve/src/main/java/com/redhat/jboss/support/RequestCountValve.java b/old/customvalve/src/main/java/com/redhat/jboss/support/RequestCountValve.java similarity index 100% rename from customvalve/src/main/java/com/redhat/jboss/support/RequestCountValve.java rename to old/customvalve/src/main/java/com/redhat/jboss/support/RequestCountValve.java diff --git a/customvalve/src/main/java/com/redhat/jboss/support/ResponseWrapper.java b/old/customvalve/src/main/java/com/redhat/jboss/support/ResponseWrapper.java similarity index 100% rename from customvalve/src/main/java/com/redhat/jboss/support/ResponseWrapper.java rename to old/customvalve/src/main/java/com/redhat/jboss/support/ResponseWrapper.java diff --git a/ee6-ejb-interfaces/deploy.sh b/old/ee6-ejb-interfaces/deploy.sh similarity index 100% rename from ee6-ejb-interfaces/deploy.sh rename to old/ee6-ejb-interfaces/deploy.sh diff --git a/ee6-ejb-interfaces/ee6-ejb-interfaces-client.rb b/old/ee6-ejb-interfaces/ee6-ejb-interfaces-client.rb similarity index 100% rename from ee6-ejb-interfaces/ee6-ejb-interfaces-client.rb rename to old/ee6-ejb-interfaces/ee6-ejb-interfaces-client.rb diff --git a/ee6-ejb-interfaces/load.rb b/old/ee6-ejb-interfaces/load.rb similarity index 100% rename from ee6-ejb-interfaces/load.rb rename to old/ee6-ejb-interfaces/load.rb diff --git a/ee6-ejb-interfaces/pom.xml b/old/ee6-ejb-interfaces/pom.xml similarity index 100% rename from ee6-ejb-interfaces/pom.xml rename to old/ee6-ejb-interfaces/pom.xml diff --git a/ee6-ejb-interfaces/src/main/java/com/github/nekop/examples/Hello.java b/old/ee6-ejb-interfaces/src/main/java/com/github/nekop/examples/Hello.java similarity index 100% rename from ee6-ejb-interfaces/src/main/java/com/github/nekop/examples/Hello.java rename to old/ee6-ejb-interfaces/src/main/java/com/github/nekop/examples/Hello.java diff --git a/ee6-ejb-interfaces/src/main/java/com/github/nekop/examples/HelloApplication.java b/old/ee6-ejb-interfaces/src/main/java/com/github/nekop/examples/HelloApplication.java similarity index 100% rename from ee6-ejb-interfaces/src/main/java/com/github/nekop/examples/HelloApplication.java rename to old/ee6-ejb-interfaces/src/main/java/com/github/nekop/examples/HelloApplication.java diff --git a/ee6-ejb-interfaces/src/main/java/com/github/nekop/examples/HelloEJB2Home.java b/old/ee6-ejb-interfaces/src/main/java/com/github/nekop/examples/HelloEJB2Home.java similarity index 100% rename from ee6-ejb-interfaces/src/main/java/com/github/nekop/examples/HelloEJB2Home.java rename to old/ee6-ejb-interfaces/src/main/java/com/github/nekop/examples/HelloEJB2Home.java diff --git a/ee6-ejb-interfaces/src/main/java/com/github/nekop/examples/HelloEJB2Remote.java b/old/ee6-ejb-interfaces/src/main/java/com/github/nekop/examples/HelloEJB2Remote.java similarity index 100% rename from ee6-ejb-interfaces/src/main/java/com/github/nekop/examples/HelloEJB2Remote.java rename to old/ee6-ejb-interfaces/src/main/java/com/github/nekop/examples/HelloEJB2Remote.java diff --git a/ee6-ejb-interfaces/src/main/java/com/github/nekop/examples/HelloLocal.java b/old/ee6-ejb-interfaces/src/main/java/com/github/nekop/examples/HelloLocal.java similarity index 100% rename from ee6-ejb-interfaces/src/main/java/com/github/nekop/examples/HelloLocal.java rename to old/ee6-ejb-interfaces/src/main/java/com/github/nekop/examples/HelloLocal.java diff --git a/ee6-ejb-interfaces/src/main/java/com/github/nekop/examples/HelloRemote.java b/old/ee6-ejb-interfaces/src/main/java/com/github/nekop/examples/HelloRemote.java similarity index 100% rename from ee6-ejb-interfaces/src/main/java/com/github/nekop/examples/HelloRemote.java rename to old/ee6-ejb-interfaces/src/main/java/com/github/nekop/examples/HelloRemote.java diff --git a/ee6-ejb-interfaces/src/main/resources/META-INF/jboss-ejb3.xml b/old/ee6-ejb-interfaces/src/main/resources/META-INF/jboss-ejb3.xml similarity index 100% rename from ee6-ejb-interfaces/src/main/resources/META-INF/jboss-ejb3.xml rename to old/ee6-ejb-interfaces/src/main/resources/META-INF/jboss-ejb3.xml diff --git a/ejb2cmp/pom.xml b/old/ejb2cmp/pom.xml similarity index 100% rename from ejb2cmp/pom.xml rename to old/ejb2cmp/pom.xml diff --git a/ejb2cmp/src/main/java/jp/programmers/examples/ejb2/cmp/StudentEntityBean.java b/old/ejb2cmp/src/main/java/jp/programmers/examples/ejb2/cmp/StudentEntityBean.java similarity index 100% rename from ejb2cmp/src/main/java/jp/programmers/examples/ejb2/cmp/StudentEntityBean.java rename to old/ejb2cmp/src/main/java/jp/programmers/examples/ejb2/cmp/StudentEntityBean.java diff --git a/ejb2mdb/QueueSend.bsh b/old/ejb2mdb/QueueSend.bsh similarity index 100% rename from ejb2mdb/QueueSend.bsh rename to old/ejb2mdb/QueueSend.bsh diff --git a/ejb2mdb/pom.xml b/old/ejb2mdb/pom.xml similarity index 100% rename from ejb2mdb/pom.xml rename to old/ejb2mdb/pom.xml diff --git a/ejb2mdb/src/main/java/jp/programmers/examples/ejb2/mdb/HelloMDB.java b/old/ejb2mdb/src/main/java/jp/programmers/examples/ejb2/mdb/HelloMDB.java similarity index 100% rename from ejb2mdb/src/main/java/jp/programmers/examples/ejb2/mdb/HelloMDB.java rename to old/ejb2mdb/src/main/java/jp/programmers/examples/ejb2/mdb/HelloMDB.java diff --git a/ejb2mdb/tmpQueue-service.xml b/old/ejb2mdb/tmpQueue-service.xml similarity index 100% rename from ejb2mdb/tmpQueue-service.xml rename to old/ejb2mdb/tmpQueue-service.xml diff --git a/ejb2slsb/pom.xml b/old/ejb2slsb/pom.xml similarity index 100% rename from ejb2slsb/pom.xml rename to old/ejb2slsb/pom.xml diff --git a/ejb2slsb/run-client.sh b/old/ejb2slsb/run-client.sh similarity index 100% rename from ejb2slsb/run-client.sh rename to old/ejb2slsb/run-client.sh diff --git a/ejb2slsb/src/main/java/jp/programmers/examples/ejb2/slsb/HelloSLSBBean.java b/old/ejb2slsb/src/main/java/jp/programmers/examples/ejb2/slsb/HelloSLSBBean.java similarity index 100% rename from ejb2slsb/src/main/java/jp/programmers/examples/ejb2/slsb/HelloSLSBBean.java rename to old/ejb2slsb/src/main/java/jp/programmers/examples/ejb2/slsb/HelloSLSBBean.java diff --git a/ejb2slsb/src/main/java/jp/programmers/examples/ejb2/slsb/HelloSLSBClient.java b/old/ejb2slsb/src/main/java/jp/programmers/examples/ejb2/slsb/HelloSLSBClient.java similarity index 100% rename from ejb2slsb/src/main/java/jp/programmers/examples/ejb2/slsb/HelloSLSBClient.java rename to old/ejb2slsb/src/main/java/jp/programmers/examples/ejb2/slsb/HelloSLSBClient.java diff --git a/ejb2slsb/src/main/java/jp/programmers/examples/ejb2/slsb/HelloSLSBLoadClient.java b/old/ejb2slsb/src/main/java/jp/programmers/examples/ejb2/slsb/HelloSLSBLoadClient.java similarity index 100% rename from ejb2slsb/src/main/java/jp/programmers/examples/ejb2/slsb/HelloSLSBLoadClient.java rename to old/ejb2slsb/src/main/java/jp/programmers/examples/ejb2/slsb/HelloSLSBLoadClient.java diff --git a/ejb3mailmdb/pom.xml b/old/ejb3mailmdb/pom.xml similarity index 100% rename from ejb3mailmdb/pom.xml rename to old/ejb3mailmdb/pom.xml diff --git a/ejb3mailmdb/src/main/java/jp/programmers/examples/ejb3/mdb/MailMDB.java b/old/ejb3mailmdb/src/main/java/jp/programmers/examples/ejb3/mdb/MailMDB.java similarity index 100% rename from ejb3mailmdb/src/main/java/jp/programmers/examples/ejb3/mdb/MailMDB.java rename to old/ejb3mailmdb/src/main/java/jp/programmers/examples/ejb3/mdb/MailMDB.java diff --git a/ejb3mdb/QueueSend.bsh b/old/ejb3mdb/QueueSend.bsh similarity index 100% rename from ejb3mdb/QueueSend.bsh rename to old/ejb3mdb/QueueSend.bsh diff --git a/ejb3mdb/pom.xml b/old/ejb3mdb/pom.xml similarity index 100% rename from ejb3mdb/pom.xml rename to old/ejb3mdb/pom.xml diff --git a/ejb3mdb/src/main/java/jp/programmers/examples/ejb3/mdb/HelloMDB.java b/old/ejb3mdb/src/main/java/jp/programmers/examples/ejb3/mdb/HelloMDB.java similarity index 100% rename from ejb3mdb/src/main/java/jp/programmers/examples/ejb3/mdb/HelloMDB.java rename to old/ejb3mdb/src/main/java/jp/programmers/examples/ejb3/mdb/HelloMDB.java diff --git a/ejb3mdb/tmpQueue-service.xml b/old/ejb3mdb/tmpQueue-service.xml similarity index 100% rename from ejb3mdb/tmpQueue-service.xml rename to old/ejb3mdb/tmpQueue-service.xml diff --git a/ejb3sfsb/pom.xml b/old/ejb3sfsb/pom.xml similarity index 100% rename from ejb3sfsb/pom.xml rename to old/ejb3sfsb/pom.xml diff --git a/ejb3sfsb/run-client.sh b/old/ejb3sfsb/run-client.sh similarity index 100% rename from ejb3sfsb/run-client.sh rename to old/ejb3sfsb/run-client.sh diff --git a/ejb3sfsb/src/main/java/jp/programmers/examples/ejb3/sfsb/Hello.java b/old/ejb3sfsb/src/main/java/jp/programmers/examples/ejb3/sfsb/Hello.java similarity index 100% rename from ejb3sfsb/src/main/java/jp/programmers/examples/ejb3/sfsb/Hello.java rename to old/ejb3sfsb/src/main/java/jp/programmers/examples/ejb3/sfsb/Hello.java diff --git a/ejb3sfsb/src/main/java/jp/programmers/examples/ejb3/sfsb/HelloSFSB.java b/old/ejb3sfsb/src/main/java/jp/programmers/examples/ejb3/sfsb/HelloSFSB.java similarity index 100% rename from ejb3sfsb/src/main/java/jp/programmers/examples/ejb3/sfsb/HelloSFSB.java rename to old/ejb3sfsb/src/main/java/jp/programmers/examples/ejb3/sfsb/HelloSFSB.java diff --git a/ejb3sfsb/src/main/java/jp/programmers/examples/ejb3/sfsb/HelloSFSBClient.java b/old/ejb3sfsb/src/main/java/jp/programmers/examples/ejb3/sfsb/HelloSFSBClient.java similarity index 100% rename from ejb3sfsb/src/main/java/jp/programmers/examples/ejb3/sfsb/HelloSFSBClient.java rename to old/ejb3sfsb/src/main/java/jp/programmers/examples/ejb3/sfsb/HelloSFSBClient.java diff --git a/ejb3sfsb/src/main/resources/META-INF/ejb-jar.xml b/old/ejb3sfsb/src/main/resources/META-INF/ejb-jar.xml similarity index 100% rename from ejb3sfsb/src/main/resources/META-INF/ejb-jar.xml rename to old/ejb3sfsb/src/main/resources/META-INF/ejb-jar.xml diff --git a/ejb3sfsb/src/main/resources/META-INF/jboss.xml b/old/ejb3sfsb/src/main/resources/META-INF/jboss.xml similarity index 100% rename from ejb3sfsb/src/main/resources/META-INF/jboss.xml rename to old/ejb3sfsb/src/main/resources/META-INF/jboss.xml diff --git a/ejb3sfsb/src/main/resources/client-log4j.xml b/old/ejb3sfsb/src/main/resources/client-log4j.xml similarity index 100% rename from ejb3sfsb/src/main/resources/client-log4j.xml rename to old/ejb3sfsb/src/main/resources/client-log4j.xml diff --git a/ejb3slsb/iiop.policy b/old/ejb3slsb/iiop.policy similarity index 100% rename from ejb3slsb/iiop.policy rename to old/ejb3slsb/iiop.policy diff --git a/ejb3slsb/pom.xml b/old/ejb3slsb/pom.xml similarity index 100% rename from ejb3slsb/pom.xml rename to old/ejb3slsb/pom.xml diff --git a/ejb3slsb/run-client.sh b/old/ejb3slsb/run-client.sh similarity index 100% rename from ejb3slsb/run-client.sh rename to old/ejb3slsb/run-client.sh diff --git a/ejb3slsb/run-iiop-client.sh b/old/ejb3slsb/run-iiop-client.sh similarity index 100% rename from ejb3slsb/run-iiop-client.sh rename to old/ejb3slsb/run-iiop-client.sh diff --git a/ejb3slsb/run-ws-client.sh b/old/ejb3slsb/run-ws-client.sh similarity index 100% rename from ejb3slsb/run-ws-client.sh rename to old/ejb3slsb/run-ws-client.sh diff --git a/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/Hello.java b/old/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/Hello.java similarity index 100% rename from ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/Hello.java rename to old/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/Hello.java diff --git a/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/HelloSLSB.java b/old/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/HelloSLSB.java similarity index 100% rename from ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/HelloSLSB.java rename to old/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/HelloSLSB.java diff --git a/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/HelloSLSBClient.java b/old/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/HelloSLSBClient.java similarity index 100% rename from ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/HelloSLSBClient.java rename to old/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/HelloSLSBClient.java diff --git a/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/HelloSLSBLoadClient.java b/old/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/HelloSLSBLoadClient.java similarity index 100% rename from ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/HelloSLSBLoadClient.java rename to old/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/HelloSLSBLoadClient.java diff --git a/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/clustered/ClusteredHelloSLSB.java b/old/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/clustered/ClusteredHelloSLSB.java similarity index 100% rename from ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/clustered/ClusteredHelloSLSB.java rename to old/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/clustered/ClusteredHelloSLSB.java diff --git a/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloHome.java b/old/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloHome.java similarity index 100% rename from ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloHome.java rename to old/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloHome.java diff --git a/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloIIOP.java b/old/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloIIOP.java similarity index 100% rename from ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloIIOP.java rename to old/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloIIOP.java diff --git a/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloIIOPClient.java b/old/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloIIOPClient.java similarity index 100% rename from ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloIIOPClient.java rename to old/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloIIOPClient.java diff --git a/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloRemote.java b/old/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloRemote.java similarity index 100% rename from ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloRemote.java rename to old/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/iiop/HelloRemote.java diff --git a/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/ws/HelloEndpoint.java b/old/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/ws/HelloEndpoint.java similarity index 100% rename from ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/ws/HelloEndpoint.java rename to old/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/ws/HelloEndpoint.java diff --git a/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/ws/HelloWS.java b/old/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/ws/HelloWS.java similarity index 100% rename from ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/ws/HelloWS.java rename to old/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/ws/HelloWS.java diff --git a/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/ws/HelloWSClient.java b/old/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/ws/HelloWSClient.java similarity index 100% rename from ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/ws/HelloWSClient.java rename to old/ejb3slsb/src/main/java/jp/programmers/examples/ejb3/slsb/ws/HelloWSClient.java diff --git a/ejb3slsb/src/main/resources/META-INF/ejb-jar.xml b/old/ejb3slsb/src/main/resources/META-INF/ejb-jar.xml similarity index 100% rename from ejb3slsb/src/main/resources/META-INF/ejb-jar.xml rename to old/ejb3slsb/src/main/resources/META-INF/ejb-jar.xml diff --git a/ejb3slsb/src/main/resources/META-INF/jboss.xml b/old/ejb3slsb/src/main/resources/META-INF/jboss.xml similarity index 100% rename from ejb3slsb/src/main/resources/META-INF/jboss.xml rename to old/ejb3slsb/src/main/resources/META-INF/jboss.xml diff --git a/ejb3slsb/src/main/resources/client-log4j.xml b/old/ejb3slsb/src/main/resources/client-log4j.xml similarity index 100% rename from ejb3slsb/src/main/resources/client-log4j.xml rename to old/ejb3slsb/src/main/resources/client-log4j.xml diff --git a/elaopmetrics/README b/old/elaopmetrics/README similarity index 100% rename from elaopmetrics/README rename to old/elaopmetrics/README diff --git a/elaopmetrics/build.properties b/old/elaopmetrics/build.properties similarity index 100% rename from elaopmetrics/build.properties rename to old/elaopmetrics/build.properties diff --git a/elaopmetrics/build.xml b/old/elaopmetrics/build.xml similarity index 100% rename from elaopmetrics/build.xml rename to old/elaopmetrics/build.xml diff --git a/elaopmetrics/src/main/java/org/jboss/jbossaop/ValueExpressionMetrics.java b/old/elaopmetrics/src/main/java/org/jboss/jbossaop/ValueExpressionMetrics.java similarity index 100% rename from elaopmetrics/src/main/java/org/jboss/jbossaop/ValueExpressionMetrics.java rename to old/elaopmetrics/src/main/java/org/jboss/jbossaop/ValueExpressionMetrics.java diff --git a/elaopmetrics/src/main/resources/META-INF/jboss-aop.xml b/old/elaopmetrics/src/main/resources/META-INF/jboss-aop.xml similarity index 100% rename from elaopmetrics/src/main/resources/META-INF/jboss-aop.xml rename to old/elaopmetrics/src/main/resources/META-INF/jboss-aop.xml diff --git a/jab/pom.xml b/old/jab/pom.xml similarity index 100% rename from jab/pom.xml rename to old/jab/pom.xml diff --git a/jab/run-all.sh b/old/jab/run-all.sh similarity index 100% rename from jab/run-all.sh rename to old/jab/run-all.sh diff --git a/jab/run.sh b/old/jab/run.sh similarity index 100% rename from jab/run.sh rename to old/jab/run.sh diff --git a/jab/src/main/java/jp/programmers/jab/BaseJAB.java b/old/jab/src/main/java/jp/programmers/jab/BaseJAB.java similarity index 100% rename from jab/src/main/java/jp/programmers/jab/BaseJAB.java rename to old/jab/src/main/java/jp/programmers/jab/BaseJAB.java diff --git a/jab/src/main/java/jp/programmers/jab/Executorz.java b/old/jab/src/main/java/jp/programmers/jab/Executorz.java similarity index 100% rename from jab/src/main/java/jp/programmers/jab/Executorz.java rename to old/jab/src/main/java/jp/programmers/jab/Executorz.java diff --git a/jab/src/main/java/jp/programmers/jab/JAB.java b/old/jab/src/main/java/jp/programmers/jab/JAB.java similarity index 100% rename from jab/src/main/java/jp/programmers/jab/JAB.java rename to old/jab/src/main/java/jp/programmers/jab/JAB.java diff --git a/jab/src/main/java/jp/programmers/jab/JABFactory.java b/old/jab/src/main/java/jp/programmers/jab/JABFactory.java similarity index 100% rename from jab/src/main/java/jp/programmers/jab/JABFactory.java rename to old/jab/src/main/java/jp/programmers/jab/JABFactory.java diff --git a/jab/src/main/java/jp/programmers/jab/JABMain.java b/old/jab/src/main/java/jp/programmers/jab/JABMain.java similarity index 100% rename from jab/src/main/java/jp/programmers/jab/JABMain.java rename to old/jab/src/main/java/jp/programmers/jab/JABMain.java diff --git a/jab/src/main/java/jp/programmers/jab/JABOptions.java b/old/jab/src/main/java/jp/programmers/jab/JABOptions.java similarity index 100% rename from jab/src/main/java/jp/programmers/jab/JABOptions.java rename to old/jab/src/main/java/jp/programmers/jab/JABOptions.java diff --git a/jab/src/main/java/jp/programmers/jab/NettyJAB.java b/old/jab/src/main/java/jp/programmers/jab/NettyJAB.java similarity index 100% rename from jab/src/main/java/jp/programmers/jab/NettyJAB.java rename to old/jab/src/main/java/jp/programmers/jab/NettyJAB.java diff --git a/jab/src/main/java/jp/programmers/jab/NettyNioJAB.java b/old/jab/src/main/java/jp/programmers/jab/NettyNioJAB.java similarity index 100% rename from jab/src/main/java/jp/programmers/jab/NettyNioJAB.java rename to old/jab/src/main/java/jp/programmers/jab/NettyNioJAB.java diff --git a/jab/src/main/java/jp/programmers/jab/NettyOioJAB.java b/old/jab/src/main/java/jp/programmers/jab/NettyOioJAB.java similarity index 100% rename from jab/src/main/java/jp/programmers/jab/NettyOioJAB.java rename to old/jab/src/main/java/jp/programmers/jab/NettyOioJAB.java diff --git a/jab/src/main/java/jp/programmers/jab/Recorder.java b/old/jab/src/main/java/jp/programmers/jab/Recorder.java similarity index 100% rename from jab/src/main/java/jp/programmers/jab/Recorder.java rename to old/jab/src/main/java/jp/programmers/jab/Recorder.java diff --git a/jab/src/main/java/jp/programmers/jab/StandardJAB.java b/old/jab/src/main/java/jp/programmers/jab/StandardJAB.java similarity index 100% rename from jab/src/main/java/jp/programmers/jab/StandardJAB.java rename to old/jab/src/main/java/jp/programmers/jab/StandardJAB.java diff --git a/jaxrs-jsonp/README.md b/old/jaxrs-jsonp/README.md similarity index 100% rename from jaxrs-jsonp/README.md rename to old/jaxrs-jsonp/README.md diff --git a/jaxrs-jsonp/pom.xml b/old/jaxrs-jsonp/pom.xml similarity index 100% rename from jaxrs-jsonp/pom.xml rename to old/jaxrs-jsonp/pom.xml diff --git a/jaxrs-jsonp/src/main/java/com/github/nekop/example/jaxrs/jsonp/HelloJson.java b/old/jaxrs-jsonp/src/main/java/com/github/nekop/example/jaxrs/jsonp/HelloJson.java similarity index 100% rename from jaxrs-jsonp/src/main/java/com/github/nekop/example/jaxrs/jsonp/HelloJson.java rename to old/jaxrs-jsonp/src/main/java/com/github/nekop/example/jaxrs/jsonp/HelloJson.java diff --git a/jaxrs-jsonp/src/main/java/com/github/nekop/example/jaxrs/jsonp/RestBootstrap.java b/old/jaxrs-jsonp/src/main/java/com/github/nekop/example/jaxrs/jsonp/RestBootstrap.java similarity index 100% rename from jaxrs-jsonp/src/main/java/com/github/nekop/example/jaxrs/jsonp/RestBootstrap.java rename to old/jaxrs-jsonp/src/main/java/com/github/nekop/example/jaxrs/jsonp/RestBootstrap.java diff --git a/jaxrs-jsonp/src/main/java/com/github/nekop/example/jaxrs/jsonp/RestMessage.java b/old/jaxrs-jsonp/src/main/java/com/github/nekop/example/jaxrs/jsonp/RestMessage.java similarity index 100% rename from jaxrs-jsonp/src/main/java/com/github/nekop/example/jaxrs/jsonp/RestMessage.java rename to old/jaxrs-jsonp/src/main/java/com/github/nekop/example/jaxrs/jsonp/RestMessage.java diff --git a/jaxrs-jsonp/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/old/jaxrs-jsonp/src/main/webapp/WEB-INF/jboss-deployment-structure.xml similarity index 100% rename from jaxrs-jsonp/src/main/webapp/WEB-INF/jboss-deployment-structure.xml rename to old/jaxrs-jsonp/src/main/webapp/WEB-INF/jboss-deployment-structure.xml diff --git a/jboss-debug/README.txt b/old/jboss-debug/README.txt similarity index 100% rename from jboss-debug/README.txt rename to old/jboss-debug/README.txt diff --git a/jboss-debug/build.properties b/old/jboss-debug/build.properties similarity index 100% rename from jboss-debug/build.properties rename to old/jboss-debug/build.properties diff --git a/jboss-debug/build.xml b/old/jboss-debug/build.xml similarity index 100% rename from jboss-debug/build.xml rename to old/jboss-debug/build.xml diff --git a/jboss-debug/etc/example-aop.xml b/old/jboss-debug/etc/example-aop.xml similarity index 100% rename from jboss-debug/etc/example-aop.xml rename to old/jboss-debug/etc/example-aop.xml diff --git a/jboss-debug/etc/example-log4j.xml b/old/jboss-debug/etc/example-log4j.xml similarity index 100% rename from jboss-debug/etc/example-log4j.xml rename to old/jboss-debug/etc/example-log4j.xml diff --git a/jboss-debug/etc/example-txrecovery.xml b/old/jboss-debug/etc/example-txrecovery.xml similarity index 100% rename from jboss-debug/etc/example-txrecovery.xml rename to old/jboss-debug/etc/example-txrecovery.xml diff --git a/jboss-debug/etc/txtest.bsh b/old/jboss-debug/etc/txtest.bsh similarity index 100% rename from jboss-debug/etc/txtest.bsh rename to old/jboss-debug/etc/txtest.bsh diff --git a/jboss-debug/src/main/java/com/redhat/jboss/support/debug/aop/MethodCallLoggingInterceptor.java b/old/jboss-debug/src/main/java/com/redhat/jboss/support/debug/aop/MethodCallLoggingInterceptor.java similarity index 100% rename from jboss-debug/src/main/java/com/redhat/jboss/support/debug/aop/MethodCallLoggingInterceptor.java rename to old/jboss-debug/src/main/java/com/redhat/jboss/support/debug/aop/MethodCallLoggingInterceptor.java diff --git a/jboss-debug/src/main/java/com/redhat/jboss/support/debug/log4j/DumpStackTraceFilter.java b/old/jboss-debug/src/main/java/com/redhat/jboss/support/debug/log4j/DumpStackTraceFilter.java similarity index 100% rename from jboss-debug/src/main/java/com/redhat/jboss/support/debug/log4j/DumpStackTraceFilter.java rename to old/jboss-debug/src/main/java/com/redhat/jboss/support/debug/log4j/DumpStackTraceFilter.java diff --git a/jboss-debug/src/main/java/com/redhat/jboss/support/debug/tx/MockXAResource.java b/old/jboss-debug/src/main/java/com/redhat/jboss/support/debug/tx/MockXAResource.java similarity index 100% rename from jboss-debug/src/main/java/com/redhat/jboss/support/debug/tx/MockXAResource.java rename to old/jboss-debug/src/main/java/com/redhat/jboss/support/debug/tx/MockXAResource.java diff --git a/jboss-debug/src/main/java/com/redhat/jboss/support/debug/tx/MockXAResourceRecovery.java b/old/jboss-debug/src/main/java/com/redhat/jboss/support/debug/tx/MockXAResourceRecovery.java similarity index 100% rename from jboss-debug/src/main/java/com/redhat/jboss/support/debug/tx/MockXAResourceRecovery.java rename to old/jboss-debug/src/main/java/com/redhat/jboss/support/debug/tx/MockXAResourceRecovery.java diff --git a/jboss-debug/src/main/java/com/redhat/jboss/support/debug/tx/SerializableMockXAResource.java b/old/jboss-debug/src/main/java/com/redhat/jboss/support/debug/tx/SerializableMockXAResource.java similarity index 100% rename from jboss-debug/src/main/java/com/redhat/jboss/support/debug/tx/SerializableMockXAResource.java rename to old/jboss-debug/src/main/java/com/redhat/jboss/support/debug/tx/SerializableMockXAResource.java diff --git a/jboss-debug/src/main/java/com/redhat/jboss/support/debug/tx/XAResourceWrapper.java b/old/jboss-debug/src/main/java/com/redhat/jboss/support/debug/tx/XAResourceWrapper.java similarity index 100% rename from jboss-debug/src/main/java/com/redhat/jboss/support/debug/tx/XAResourceWrapper.java rename to old/jboss-debug/src/main/java/com/redhat/jboss/support/debug/tx/XAResourceWrapper.java diff --git a/jpa-managed/pom.xml b/old/jpa-managed/pom.xml similarity index 100% rename from jpa-managed/pom.xml rename to old/jpa-managed/pom.xml diff --git a/jpa-managed/src/main/java/jp/programmers/examples/jpa/Cat.java b/old/jpa-managed/src/main/java/jp/programmers/examples/jpa/Cat.java similarity index 100% rename from jpa-managed/src/main/java/jp/programmers/examples/jpa/Cat.java rename to old/jpa-managed/src/main/java/jp/programmers/examples/jpa/Cat.java diff --git a/jpa-managed/src/main/resources/META-INF/persistence.xml b/old/jpa-managed/src/main/resources/META-INF/persistence.xml similarity index 100% rename from jpa-managed/src/main/resources/META-INF/persistence.xml rename to old/jpa-managed/src/main/resources/META-INF/persistence.xml diff --git a/jpa-standalone/pom.xml b/old/jpa-standalone/pom.xml similarity index 100% rename from jpa-standalone/pom.xml rename to old/jpa-standalone/pom.xml diff --git a/jpa-standalone/src/main/java/jp/programmers/examples/jpa/Cat.java b/old/jpa-standalone/src/main/java/jp/programmers/examples/jpa/Cat.java similarity index 100% rename from jpa-standalone/src/main/java/jp/programmers/examples/jpa/Cat.java rename to old/jpa-standalone/src/main/java/jp/programmers/examples/jpa/Cat.java diff --git a/jpa-standalone/src/main/java/jp/programmers/examples/jpa/MMCat.java b/old/jpa-standalone/src/main/java/jp/programmers/examples/jpa/MMCat.java similarity index 100% rename from jpa-standalone/src/main/java/jp/programmers/examples/jpa/MMCat.java rename to old/jpa-standalone/src/main/java/jp/programmers/examples/jpa/MMCat.java diff --git a/jpa-standalone/src/main/resources/META-INF/persistence.xml b/old/jpa-standalone/src/main/resources/META-INF/persistence.xml similarity index 100% rename from jpa-standalone/src/main/resources/META-INF/persistence.xml rename to old/jpa-standalone/src/main/resources/META-INF/persistence.xml diff --git a/jpa-standalone/src/test/java/jp/programmers/examples/jpa/CatTest.java b/old/jpa-standalone/src/test/java/jp/programmers/examples/jpa/CatTest.java similarity index 100% rename from jpa-standalone/src/test/java/jp/programmers/examples/jpa/CatTest.java rename to old/jpa-standalone/src/test/java/jp/programmers/examples/jpa/CatTest.java diff --git a/mockxa/pom.xml b/old/mockxa/pom.xml similarity index 100% rename from mockxa/pom.xml rename to old/mockxa/pom.xml diff --git a/mockxa/src/main/java/com/redhat/gss/mockxa/MockXAResource.java b/old/mockxa/src/main/java/com/redhat/gss/mockxa/MockXAResource.java similarity index 100% rename from mockxa/src/main/java/com/redhat/gss/mockxa/MockXAResource.java rename to old/mockxa/src/main/java/com/redhat/gss/mockxa/MockXAResource.java diff --git a/mockxa/src/main/java/com/redhat/gss/mockxa/MockXAResourceRecovery.java b/old/mockxa/src/main/java/com/redhat/gss/mockxa/MockXAResourceRecovery.java similarity index 100% rename from mockxa/src/main/java/com/redhat/gss/mockxa/MockXAResourceRecovery.java rename to old/mockxa/src/main/java/com/redhat/gss/mockxa/MockXAResourceRecovery.java diff --git a/mockxa/src/main/java/com/redhat/gss/mockxa/MockXAResourceRecoveryRegistrationListener.java b/old/mockxa/src/main/java/com/redhat/gss/mockxa/MockXAResourceRecoveryRegistrationListener.java similarity index 100% rename from mockxa/src/main/java/com/redhat/gss/mockxa/MockXAResourceRecoveryRegistrationListener.java rename to old/mockxa/src/main/java/com/redhat/gss/mockxa/MockXAResourceRecoveryRegistrationListener.java diff --git a/mockxa/src/main/java/com/redhat/gss/mockxa/SerializableMockXAResource.java b/old/mockxa/src/main/java/com/redhat/gss/mockxa/SerializableMockXAResource.java similarity index 100% rename from mockxa/src/main/java/com/redhat/gss/mockxa/SerializableMockXAResource.java rename to old/mockxa/src/main/java/com/redhat/gss/mockxa/SerializableMockXAResource.java diff --git a/mockxa/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/old/mockxa/src/main/webapp/WEB-INF/jboss-deployment-structure.xml similarity index 100% rename from mockxa/src/main/webapp/WEB-INF/jboss-deployment-structure.xml rename to old/mockxa/src/main/webapp/WEB-INF/jboss-deployment-structure.xml diff --git a/mockxa/src/main/webapp/WEB-INF/web.xml b/old/mockxa/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from mockxa/src/main/webapp/WEB-INF/web.xml rename to old/mockxa/src/main/webapp/WEB-INF/web.xml diff --git a/mockxa/src/main/webapp/txtest.jsp b/old/mockxa/src/main/webapp/txtest.jsp similarity index 100% rename from mockxa/src/main/webapp/txtest.jsp rename to old/mockxa/src/main/webapp/txtest.jsp diff --git a/rest/pom.xml b/old/rest/pom.xml similarity index 100% rename from rest/pom.xml rename to old/rest/pom.xml diff --git a/rest/src/main/java/jp/programmers/examples/HelloRest.java b/old/rest/src/main/java/jp/programmers/examples/HelloRest.java similarity index 100% rename from rest/src/main/java/jp/programmers/examples/HelloRest.java rename to old/rest/src/main/java/jp/programmers/examples/HelloRest.java diff --git a/rest/src/main/webapp/WEB-INF/web.xml b/old/rest/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from rest/src/main/webapp/WEB-INF/web.xml rename to old/rest/src/main/webapp/WEB-INF/web.xml diff --git a/servlet/pom.xml b/old/servlet/pom.xml similarity index 100% rename from servlet/pom.xml rename to old/servlet/pom.xml diff --git a/servlet/src/main/java/jp/programmers/examples/ContentLengthFilter.java b/old/servlet/src/main/java/jp/programmers/examples/ContentLengthFilter.java similarity index 100% rename from servlet/src/main/java/jp/programmers/examples/ContentLengthFilter.java rename to old/servlet/src/main/java/jp/programmers/examples/ContentLengthFilter.java diff --git a/servlet/src/main/java/jp/programmers/examples/ContentLengthResponseWrapper.java b/old/servlet/src/main/java/jp/programmers/examples/ContentLengthResponseWrapper.java similarity index 100% rename from servlet/src/main/java/jp/programmers/examples/ContentLengthResponseWrapper.java rename to old/servlet/src/main/java/jp/programmers/examples/ContentLengthResponseWrapper.java diff --git a/servlet/src/main/java/jp/programmers/examples/DebugSessionListener.java b/old/servlet/src/main/java/jp/programmers/examples/DebugSessionListener.java similarity index 100% rename from servlet/src/main/java/jp/programmers/examples/DebugSessionListener.java rename to old/servlet/src/main/java/jp/programmers/examples/DebugSessionListener.java diff --git a/servlet/src/main/java/jp/programmers/examples/HelloServlet.java b/old/servlet/src/main/java/jp/programmers/examples/HelloServlet.java similarity index 100% rename from servlet/src/main/java/jp/programmers/examples/HelloServlet.java rename to old/servlet/src/main/java/jp/programmers/examples/HelloServlet.java diff --git a/servlet/src/main/java/jp/programmers/examples/Redirect.java b/old/servlet/src/main/java/jp/programmers/examples/Redirect.java similarity index 100% rename from servlet/src/main/java/jp/programmers/examples/Redirect.java rename to old/servlet/src/main/java/jp/programmers/examples/Redirect.java diff --git a/servlet/src/main/java/jp/programmers/examples/SemaphoreFilter.java b/old/servlet/src/main/java/jp/programmers/examples/SemaphoreFilter.java similarity index 100% rename from servlet/src/main/java/jp/programmers/examples/SemaphoreFilter.java rename to old/servlet/src/main/java/jp/programmers/examples/SemaphoreFilter.java diff --git a/servlet/src/main/java/jp/programmers/examples/SessionFixationProtectionFilter.java b/old/servlet/src/main/java/jp/programmers/examples/SessionFixationProtectionFilter.java similarity index 100% rename from servlet/src/main/java/jp/programmers/examples/SessionFixationProtectionFilter.java rename to old/servlet/src/main/java/jp/programmers/examples/SessionFixationProtectionFilter.java diff --git a/servlet/src/main/webapp/WEB-INF/jboss-web.xml b/old/servlet/src/main/webapp/WEB-INF/jboss-web.xml similarity index 100% rename from servlet/src/main/webapp/WEB-INF/jboss-web.xml rename to old/servlet/src/main/webapp/WEB-INF/jboss-web.xml diff --git a/servlet/src/main/webapp/WEB-INF/web.xml b/old/servlet/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from servlet/src/main/webapp/WEB-INF/web.xml rename to old/servlet/src/main/webapp/WEB-INF/web.xml diff --git a/servlet/src/main/webapp/index.html b/old/servlet/src/main/webapp/index.html similarity index 100% rename from servlet/src/main/webapp/index.html rename to old/servlet/src/main/webapp/index.html diff --git a/servlet/src/main/webapp/invalidate.jsp b/old/servlet/src/main/webapp/invalidate.jsp similarity index 100% rename from servlet/src/main/webapp/invalidate.jsp rename to old/servlet/src/main/webapp/invalidate.jsp diff --git a/servlet/src/main/webapp/length/index.jsp b/old/servlet/src/main/webapp/length/index.jsp similarity index 100% rename from servlet/src/main/webapp/length/index.jsp rename to old/servlet/src/main/webapp/length/index.jsp diff --git a/servlet/src/main/webapp/listener.jsp b/old/servlet/src/main/webapp/listener.jsp similarity index 100% rename from servlet/src/main/webapp/listener.jsp rename to old/servlet/src/main/webapp/listener.jsp diff --git a/twitter/pom.xml b/old/twitter/pom.xml similarity index 100% rename from twitter/pom.xml rename to old/twitter/pom.xml diff --git a/twitter/run.sh b/old/twitter/run.sh similarity index 100% rename from twitter/run.sh rename to old/twitter/run.sh diff --git a/twitter/src/main/java/jp/programmers/examples/twitter/HelloTwitter.java b/old/twitter/src/main/java/jp/programmers/examples/twitter/HelloTwitter.java similarity index 100% rename from twitter/src/main/java/jp/programmers/examples/twitter/HelloTwitter.java rename to old/twitter/src/main/java/jp/programmers/examples/twitter/HelloTwitter.java diff --git a/xnio3-example/pom.xml b/old/xnio3-example/pom.xml similarity index 100% rename from xnio3-example/pom.xml rename to old/xnio3-example/pom.xml diff --git a/xnio3-example/run.sh b/old/xnio3-example/run.sh similarity index 100% rename from xnio3-example/run.sh rename to old/xnio3-example/run.sh diff --git a/xnio3-example/src/main/java/jp/programmers/xnio3/examples/EchoServer.java b/old/xnio3-example/src/main/java/jp/programmers/xnio3/examples/EchoServer.java similarity index 100% rename from xnio3-example/src/main/java/jp/programmers/xnio3/examples/EchoServer.java rename to old/xnio3-example/src/main/java/jp/programmers/xnio3/examples/EchoServer.java diff --git a/rhgss/jdg-standalone/exec-java.sh b/rhgss/jdg-standalone/exec-java.sh new file mode 100644 index 0000000..e81457b --- /dev/null +++ b/rhgss/jdg-standalone/exec-java.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +mvn -e exec:java -Dexec.mainClass=com.redhat.gss.example.JDGStandalone
nekop/java-examples
254424fa78618142ad1cd8f9dc9019e2496288a5
Add simple example
diff --git a/rhgss/jdg-standalone/pom.xml b/rhgss/jdg-standalone/pom.xml index e4a3cb7..7c2a9ad 100644 --- a/rhgss/jdg-standalone/pom.xml +++ b/rhgss/jdg-standalone/pom.xml @@ -1,144 +1,144 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.redhat.gss.example.jdg</groupId> <artifactId>jdg-standalone</artifactId> <packaging>jar</packaging> <name>jdg-standalone</name> <version>1.0</version> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <version.org.infinispan.bom>6.1.0.Final-redhat-4</version.org.infinispan.bom> <version.junit>4.11</version.junit> <version.maven-surefire-plugin>2.17</version.maven-surefire-plugin> <version.maven-compiler-plugin>3.1</version.maven-compiler-plugin> </properties> <repositories> <repository> <id>jboss-public</id> <name>JBoss Public Maven Repository Group</name> <url>https://repository.jboss.org/nexus/content/groups/public/</url> <layout>default</layout> <releases> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> <repository> <id>redhat</id> <name>redhat</name> <url>http://maven.repository.redhat.com/techpreview/all/</url> <releases> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>jboss-public</id> <name>JBoss Public Maven Repository Group</name> <url>https://repository.jboss.org/nexus/content/groups/public/</url> <layout>default</layout> <releases> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> <pluginRepository> <id>redhat</id> <name>redhat</name> <url>http://maven.repository.redhat.com/techpreview/all/</url> <releases> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories> <dependencyManagement> <dependencies> <dependency> <groupId>org.infinispan</groupId> <artifactId>infinispan-bom</artifactId> <version>${version.org.infinispan.bom}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>org.infinispan</groupId> <artifactId>infinispan-core</artifactId> <scope>compile</scope> <exclusions> <exclusion> <groupId>org.osgi</groupId> <artifactId>org.osgi.core</artifactId> </exclusion> <exclusion> <groupId>org.osgi</groupId> <artifactId>org.osgi.compendium</artifactId> </exclusion> <exclusion> <groupId>org.jboss.spec.javax.transaction</groupId> <artifactId>jboss-transaction-api_1.1_spec</artifactId> </exclusion> - <exclusion> - <groupId>org.jboss.logging</groupId> - <artifactId>jboss-logging</artifactId> - </exclusion> <exclusion> <groupId>log4j</groupId> <artifactId>log4j</artifactId> </exclusion> </exclusions> </dependency> + <dependency> + <groupId>org.jboss.spec.javax.transaction</groupId> + <artifactId>jboss-transaction-api_1.1_spec</artifactId> + </dependency> <!-- test deps --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>${version.junit}</version> <scope>test</scope> </dependency> </dependencies> <build> <finalName>${project.artifactId}</finalName> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>${version.maven-compiler-plugin}</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>${version.maven-surefire-plugin}</version> </plugin> </plugins> </build> </project> diff --git a/rhgss/jdg-standalone/src/main/java/com/redhat/gss/example/JDGStandalone.java b/rhgss/jdg-standalone/src/main/java/com/redhat/gss/example/JDGStandalone.java index ab4c1e6..d36a8a1 100644 --- a/rhgss/jdg-standalone/src/main/java/com/redhat/gss/example/JDGStandalone.java +++ b/rhgss/jdg-standalone/src/main/java/com/redhat/gss/example/JDGStandalone.java @@ -1,17 +1,45 @@ /* * To the extent possible under law, Red Hat, Inc. has dedicated all * copyright to this software to the public domain worldwide, pursuant * to the CC0 Public Domain Dedication. This software is distributed * without any warranty. * * See <http://creativecommons.org/publicdomain/zero/1.0/>. */ package com.redhat.gss.example; +import org.infinispan.Cache; +import org.infinispan.manager.DefaultCacheManager; +import org.infinispan.configuration.global.GlobalConfiguration; +import org.infinispan.configuration.global.GlobalConfigurationBuilder; +import org.infinispan.configuration.cache.Configuration; +import org.infinispan.configuration.cache.ConfigurationBuilder; +import org.infinispan.configuration.cache.CacheMode; + public class JDGStandalone { - public static void main(String[] args) { - // todo: implement Infinispan stuff + public static void main(String[] args) throws Exception { + simple(); } + public static void simple() throws Exception { + GlobalConfiguration globalConfig = + new GlobalConfigurationBuilder() + .globalJmxStatistics().allowDuplicateDomains(true) + .transport() + .defaultTransport() + .build(); + Configuration defaultCacheConfig = + new ConfigurationBuilder() + .clustering() + .cacheMode(CacheMode.DIST_ASYNC) + .build(); + DefaultCacheManager cm = new DefaultCacheManager(globalConfig, defaultCacheConfig); + Cache cache = cm.getCache(); + System.out.println("sleep 20 sec"); + try { + Thread.sleep(20000); + } catch (InterruptedException ignore) { } + cm.stop(); + } }
nekop/java-examples
17e11696488fe01c200c8e07258dc08c1cca5c48
Add jdg examples
diff --git a/rhgss/jdg-standalone/pom.xml b/rhgss/jdg-standalone/pom.xml new file mode 100644 index 0000000..e4a3cb7 --- /dev/null +++ b/rhgss/jdg-standalone/pom.xml @@ -0,0 +1,144 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <groupId>com.redhat.gss.example.jdg</groupId> + <artifactId>jdg-standalone</artifactId> + <packaging>jar</packaging> + <name>jdg-standalone</name> + <version>1.0</version> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + + <version.org.infinispan.bom>6.1.0.Final-redhat-4</version.org.infinispan.bom> + + <version.junit>4.11</version.junit> + <version.maven-surefire-plugin>2.17</version.maven-surefire-plugin> + <version.maven-compiler-plugin>3.1</version.maven-compiler-plugin> + </properties> + + <repositories> + <repository> + <id>jboss-public</id> + <name>JBoss Public Maven Repository Group</name> + <url>https://repository.jboss.org/nexus/content/groups/public/</url> + <layout>default</layout> + <releases> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + <repository> + <id>redhat</id> + <name>redhat</name> + <url>http://maven.repository.redhat.com/techpreview/all/</url> + <releases> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>jboss-public</id> + <name>JBoss Public Maven Repository Group</name> + <url>https://repository.jboss.org/nexus/content/groups/public/</url> + <layout>default</layout> + <releases> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + <pluginRepository> + <id>redhat</id> + <name>redhat</name> + <url>http://maven.repository.redhat.com/techpreview/all/</url> + <releases> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.infinispan</groupId> + <artifactId>infinispan-bom</artifactId> + <version>${version.org.infinispan.bom}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <dependency> + <groupId>org.infinispan</groupId> + <artifactId>infinispan-core</artifactId> + <scope>compile</scope> + <exclusions> + <exclusion> + <groupId>org.osgi</groupId> + <artifactId>org.osgi.core</artifactId> + </exclusion> + <exclusion> + <groupId>org.osgi</groupId> + <artifactId>org.osgi.compendium</artifactId> + </exclusion> + <exclusion> + <groupId>org.jboss.spec.javax.transaction</groupId> + <artifactId>jboss-transaction-api_1.1_spec</artifactId> + </exclusion> + <exclusion> + <groupId>org.jboss.logging</groupId> + <artifactId>jboss-logging</artifactId> + </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + </exclusions> + </dependency> + + <!-- test deps --> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>${version.junit}</version> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <finalName>${project.artifactId}</finalName> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>${version.maven-compiler-plugin}</version> + <configuration> + <source>1.6</source> + <target>1.6</target> + </configuration> + </plugin> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <version>${version.maven-surefire-plugin}</version> + </plugin> + </plugins> + </build> + +</project> diff --git a/rhgss/jdg-standalone/src/main/java/com/redhat/gss/example/JDGStandalone.java b/rhgss/jdg-standalone/src/main/java/com/redhat/gss/example/JDGStandalone.java new file mode 100644 index 0000000..ab4c1e6 --- /dev/null +++ b/rhgss/jdg-standalone/src/main/java/com/redhat/gss/example/JDGStandalone.java @@ -0,0 +1,17 @@ +/* + * To the extent possible under law, Red Hat, Inc. has dedicated all + * copyright to this software to the public domain worldwide, pursuant + * to the CC0 Public Domain Dedication. This software is distributed + * without any warranty. + * + * See <http://creativecommons.org/publicdomain/zero/1.0/>. + */ +package com.redhat.gss.example; + +public class JDGStandalone { + + public static void main(String[] args) { + // todo: implement Infinispan stuff + } + +} diff --git a/rhgss/jdg-webapp/pom.xml b/rhgss/jdg-webapp/pom.xml new file mode 100644 index 0000000..8dd68c7 --- /dev/null +++ b/rhgss/jdg-webapp/pom.xml @@ -0,0 +1,217 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <groupId>com.redhat.gss.example.jdg</groupId> + <artifactId>jdg-webapp</artifactId> + <packaging>war</packaging> + <name>jdg-webapp</name> + <version>1.0</version> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + + <version.org.jboss.spec.jboss-javaee-web-6.0>3.0.2.Final</version.org.jboss.spec.jboss-javaee-web-6.0> + <version.org.infinispan.bom>6.1.0.Final-redhat-4</version.org.infinispan.bom> + + <version.org.jboss.arquillian.arquillian-bom>1.1.5.Final</version.org.jboss.arquillian.arquillian-bom> + <version.org.jboss.as.jboss-as-arquillian-container-managed>7.2.0.Final</version.org.jboss.as.jboss-as-arquillian-container-managed> + <version.org.jboss.as.jboss-as-arquillian-container-remote>7.2.0.Final</version.org.jboss.as.jboss-as-arquillian-container-remote> + <version.junit>4.11</version.junit> + <version.maven-surefire-plugin>2.17</version.maven-surefire-plugin> + <version.maven-compiler-plugin>3.1</version.maven-compiler-plugin> + <version.maven-war-plugin>2.4</version.maven-war-plugin> + </properties> + + <repositories> + <repository> + <id>jboss-public</id> + <name>JBoss Public Maven Repository Group</name> + <url>https://repository.jboss.org/nexus/content/groups/public/</url> + <layout>default</layout> + <releases> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + <repository> + <id>redhat</id> + <name>redhat</name> + <url>http://maven.repository.redhat.com/techpreview/all/</url> + <releases> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>jboss-public</id> + <name>JBoss Public Maven Repository Group</name> + <url>https://repository.jboss.org/nexus/content/groups/public/</url> + <layout>default</layout> + <releases> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + <pluginRepository> + <id>redhat</id> + <name>redhat</name> + <url>http://maven.repository.redhat.com/techpreview/all/</url> + <releases> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.jboss.arquillian</groupId> + <artifactId>arquillian-bom</artifactId> + <version>${version.org.jboss.arquillian.arquillian-bom}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + <dependency> + <groupId>org.infinispan</groupId> + <artifactId>infinispan-bom</artifactId> + <version>${version.org.infinispan.bom}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <!-- This Java EE 6 API jar is crippled, do NOT use for real projects/testing. + Fixed in Java EE 7. + <dependency> + <groupId>javax</groupId> + <artifactId>javaee-web-api</artifactId> + <version>6.0</version> + <scope>provided</scope> + </dependency> + --> + <!-- Java EE 6 API jars. It's actually a bom, but we can use it as a depchain --> + <dependency> + <groupId>org.jboss.spec</groupId> + <artifactId>jboss-javaee-web-6.0</artifactId> + <version>${version.org.jboss.spec.jboss-javaee-web-6.0}</version> + <scope>provided</scope> + <type>pom</type> + </dependency> + <dependency> + <groupId>org.infinispan</groupId> + <artifactId>infinispan-core</artifactId> + <scope>compile</scope> + <exclusions> + <exclusion> + <groupId>org.osgi</groupId> + <artifactId>org.osgi.core</artifactId> + </exclusion> + <exclusion> + <groupId>org.osgi</groupId> + <artifactId>org.osgi.compendium</artifactId> + </exclusion> + <exclusion> + <groupId>org.jboss.spec.javax.transaction</groupId> + <artifactId>jboss-transaction-api_1.1_spec</artifactId> + </exclusion> + <exclusion> + <groupId>org.jboss.logging</groupId> + <artifactId>jboss-logging</artifactId> + </exclusion> + <exclusion> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + </exclusion> + </exclusions> + </dependency> + + <!-- test deps --> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>${version.junit}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jboss.arquillian.junit</groupId> + <artifactId>arquillian-junit-container</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jboss.shrinkwrap.resolver</groupId> + <artifactId>shrinkwrap-resolver-depchain</artifactId> + <type>pom</type> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <finalName>${project.artifactId}</finalName> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>${version.maven-compiler-plugin}</version> + <configuration> + <source>1.6</source> + <target>1.6</target> + </configuration> + </plugin> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <version>${version.maven-surefire-plugin}</version> + </plugin> + <plugin> + <artifactId>maven-war-plugin</artifactId> + <version>${version.maven-war-plugin}</version> + <configuration> + <failOnMissingWebXml>false</failOnMissingWebXml> + </configuration> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <id>arq-managed</id> + <dependencies> + <dependency> + <groupId>org.jboss.as</groupId> + <artifactId>jboss-as-arquillian-container-managed</artifactId> + <version>${version.org.jboss.as.jboss-as-arquillian-container-managed}</version> + <scope>test</scope> + </dependency> + </dependencies> + </profile> + + <profile> + <id>arq-remote</id> + <dependencies> + <dependency> + <groupId>org.jboss.as</groupId> + <artifactId>jboss-as-arquillian-container-remote</artifactId> + <version>${version.org.jboss.as.jboss-as-arquillian-container-remote}</version> + <scope>test</scope> + </dependency> + </dependencies> + </profile> + </profiles> + +</project> diff --git a/rhgss/jdg-webapp/src/main/java/com/redhat/gss/example/JDGTestServlet.java b/rhgss/jdg-webapp/src/main/java/com/redhat/gss/example/JDGTestServlet.java new file mode 100644 index 0000000..e5bd6e3 --- /dev/null +++ b/rhgss/jdg-webapp/src/main/java/com/redhat/gss/example/JDGTestServlet.java @@ -0,0 +1,35 @@ +/* + * To the extent possible under law, Red Hat, Inc. has dedicated all + * copyright to this software to the public domain worldwide, pursuant + * to the CC0 Public Domain Dedication. This software is distributed + * without any warranty. + * + * See <http://creativecommons.org/publicdomain/zero/1.0/>. + */ +package com.redhat.gss.example; + +import java.io.IOException; +import java.util.logging.Level; +import java.util.logging.LogManager; +import java.util.logging.Logger; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpSession; + +@WebServlet("/jdgtest") +public class JDGTestServlet extends HttpServlet { + + private Logger log = + LogManager.getLogManager().getLogger(JDGTestServlet.class.getName()); + + // TODO: Implement basic Infinispan stuff + public void doGet(ServletRequest request, + ServletResponse response) + throws IOException, ServletException { + } + +}
nekop/java-examples
30dc57c22cc8777290ab7bff98b780b7a0a56a52
Enable JSONP
diff --git a/jaxrs-jsonp/src/main/webapp/WEB-INF/jboss-deployment-structure.xml b/jaxrs-jsonp/src/main/webapp/WEB-INF/jboss-deployment-structure.xml new file mode 100644 index 0000000..a3a594f --- /dev/null +++ b/jaxrs-jsonp/src/main/webapp/WEB-INF/jboss-deployment-structure.xml @@ -0,0 +1,7 @@ +<jboss-deployment-structure> + <deployment> + <dependencies> + <module name="org.jboss.resteasy.resteasy-jackson-provider" annotations="true"/> + </dependencies> + </deployment> +</jboss-deployment-structure>
nekop/java-examples
6f051fbf0616913edf5d9b992fa113672082a2c5
Add JAX-RS JSONP example
diff --git a/jaxrs-jsonp/README.md b/jaxrs-jsonp/README.md new file mode 100644 index 0000000..cc9d7ab --- /dev/null +++ b/jaxrs-jsonp/README.md @@ -0,0 +1,7 @@ +To test GET: + +> $ curl -v http://localhost:8080/jaxrs-jsonp/rest/hello + +To test POST: + +> $ curl -v -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"message":"hello"}' http://localhost:8080/jaxrs-jsonp/rest/hello \ No newline at end of file diff --git a/jaxrs-jsonp/pom.xml b/jaxrs-jsonp/pom.xml new file mode 100644 index 0000000..2b4182d --- /dev/null +++ b/jaxrs-jsonp/pom.xml @@ -0,0 +1,161 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <!-- + Java EE 7 minimal pom.xml, works with WildFly 8.1. + + https://github.com/nekop/java-examples/blob/master/maven/ + + Put your source code, config files, boot the application server and run: + $ mvn clean install -Parq-remote + + [Summary] + Additional Repository: JBoss Public + Compile Deps: Java EE 7 Web Profile + Test Deps: JUnit, Arquillian and ShrinkWrap Resolver + Profiles: arq-managed, arq-remote + --> + + <modelVersion>4.0.0</modelVersion> + <groupId>com.github.nekop</groupId> + <artifactId>jaxrs-jsonp</artifactId> + <packaging>war</packaging> + <name>jaxrs-jsonp</name> + <version>1.0</version> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + + <version.org.jboss.arquillian.arquillian-bom>1.1.5.Final</version.org.jboss.arquillian.arquillian-bom> + <version.wildfly>8.1.0.Final</version.wildfly> + <version.junit>4.11</version.junit> + <version.maven-surefire-plugin>2.17</version.maven-surefire-plugin> + <version.maven-compiler-plugin>3.1</version.maven-compiler-plugin> + <version.maven-war-plugin>2.4</version.maven-war-plugin> + </properties> + + <repositories> + <repository> + <id>jboss-public</id> + <name>JBoss Public Maven Repository Group</name> + <url>https://repository.jboss.org/nexus/content/groups/public/</url> + <layout>default</layout> + <releases> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>jboss-public</id> + <name>JBoss Public Maven Repository Group</name> + <url>https://repository.jboss.org/nexus/content/groups/public/</url> + <layout>default</layout> + <releases> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.jboss.arquillian</groupId> + <artifactId>arquillian-bom</artifactId> + <version>${version.org.jboss.arquillian.arquillian-bom}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <dependency> + <groupId>javax</groupId> + <artifactId>javaee-web-api</artifactId> + <version>7.0</version> + <scope>provided</scope> + </dependency> + + <!-- test deps --> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>${version.junit}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jboss.arquillian.junit</groupId> + <artifactId>arquillian-junit-container</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jboss.shrinkwrap.resolver</groupId> + <artifactId>shrinkwrap-resolver-depchain</artifactId> + <type>pom</type> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <finalName>${project.artifactId}</finalName> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>${version.maven-compiler-plugin}</version> + <configuration> + <source>1.7</source> + <target>1.7</target> + </configuration> + </plugin> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <version>${version.maven-surefire-plugin}</version> + </plugin> + <plugin> + <artifactId>maven-war-plugin</artifactId> + <version>${version.maven-war-plugin}</version> + <configuration> + <failOnMissingWebXml>false</failOnMissingWebXml> + </configuration> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <id>arq-managed</id> + <dependencies> + <dependency> + <groupId>org.wildfly</groupId> + <artifactId>wildfly-arquillian-container-managed</artifactId> + <version>${version.wildfly}</version> + <scope>test</scope> + </dependency> + </dependencies> + </profile> + + <profile> + <id>arq-remote</id> + <dependencies> + <dependency> + <groupId>org.wildfly</groupId> + <artifactId>wildfly-arquillian-container-remote</artifactId> + <version>${version.wildfly}</version> + <scope>test</scope> + </dependency> + </dependencies> + </profile> + </profiles> + +</project> diff --git a/jaxrs-jsonp/src/main/java/com/github/nekop/example/jaxrs/jsonp/HelloJson.java b/jaxrs-jsonp/src/main/java/com/github/nekop/example/jaxrs/jsonp/HelloJson.java new file mode 100644 index 0000000..c140dcd --- /dev/null +++ b/jaxrs-jsonp/src/main/java/com/github/nekop/example/jaxrs/jsonp/HelloJson.java @@ -0,0 +1,28 @@ +package com.github.nekop.example.jaxrs.jsonp; + +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.POST; +import javax.ws.rs.Path; +import javax.ws.rs.Produces; +import javax.ws.rs.core.MediaType; + +@Path("/hello") +public class HelloJson { + + @GET + @Produces(MediaType.APPLICATION_JSON) + public Object hello() { + System.out.println("HelloJson#hello()"); + return new RestMessage("hello"); + } + + @POST + @Consumes(MediaType.APPLICATION_JSON) + @Produces(MediaType.APPLICATION_JSON) + public Object echo(RestMessage message) { + System.out.println("HelloJson#echo()"); + return message; + } + +} diff --git a/jaxrs-jsonp/src/main/java/com/github/nekop/example/jaxrs/jsonp/RestBootstrap.java b/jaxrs-jsonp/src/main/java/com/github/nekop/example/jaxrs/jsonp/RestBootstrap.java new file mode 100644 index 0000000..5a26ad3 --- /dev/null +++ b/jaxrs-jsonp/src/main/java/com/github/nekop/example/jaxrs/jsonp/RestBootstrap.java @@ -0,0 +1,7 @@ +package com.github.nekop.example.jaxrs.jsonp; + +import javax.ws.rs.ApplicationPath; +import javax.ws.rs.core.Application; + +@ApplicationPath("/rest") +public class RestBootstrap extends Application { } diff --git a/jaxrs-jsonp/src/main/java/com/github/nekop/example/jaxrs/jsonp/RestMessage.java b/jaxrs-jsonp/src/main/java/com/github/nekop/example/jaxrs/jsonp/RestMessage.java new file mode 100644 index 0000000..cbfd64f --- /dev/null +++ b/jaxrs-jsonp/src/main/java/com/github/nekop/example/jaxrs/jsonp/RestMessage.java @@ -0,0 +1,22 @@ +package com.github.nekop.example.jaxrs.jsonp; + +public class RestMessage { + + public RestMessage() { + } + + public RestMessage(String message) { + setMessage(message); + } + + private String message; + + public String getMessage() { + return message; + } + + public void setMessage(String message) { + this.message = message; + } + +}
nekop/java-examples
6411c1662583fc20c5d374b40f3f1a359a16bc57
Add ejb2dep example
diff --git a/rhgss/ejb2dep/ear/pom.xml b/rhgss/ejb2dep/ear/pom.xml new file mode 100644 index 0000000..1a240e8 --- /dev/null +++ b/rhgss/ejb2dep/ear/pom.xml @@ -0,0 +1,49 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <groupId>com.redhat.gss.example.ejb2dep</groupId> + <artifactId>ejb2dep-ear</artifactId> + <name>ejb2dep-ear</name> + <version>1.0</version> + <packaging>ear</packaging> + + <parent> + <groupId>com.redhat.gss.example.ejb2dep</groupId> + <artifactId>ejb2dep</artifactId> + <version>1.0</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <dependencies> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>ejb2dep-ejb1</artifactId> + <version>${project.version}</version> + <type>ejb</type> + </dependency> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>ejb2dep-ejb2</artifactId> + <version>${project.version}</version> + <type>ejb</type> + </dependency> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>ejb2dep-web</artifactId> + <version>${project.version}</version> + <type>war</type> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-ear-plugin</artifactId> + </plugin> + </plugins> + </build> + +</project> diff --git a/rhgss/ejb2dep/ejb1/pom.xml b/rhgss/ejb2dep/ejb1/pom.xml new file mode 100644 index 0000000..ab90057 --- /dev/null +++ b/rhgss/ejb2dep/ejb1/pom.xml @@ -0,0 +1,64 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <groupId>com.redhat.gss.example.ejb2dep</groupId> + <artifactId>ejb2dep-ejb1</artifactId> + <name>ejb2dep-ejb1</name> + <packaging>ejb</packaging> + <version>1.0</version> + + <parent> + <groupId>com.redhat.gss.example.ejb2dep</groupId> + <artifactId>ejb2dep</artifactId> + <version>1.0</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <dependencies> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>ejb2dep-ejb2</artifactId> + <version>${project.version}</version> + <type>ejb</type> + </dependency> + </dependencies> + + <build> + <finalName>${project.artifactId}</finalName> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>xdoclet-maven-plugin</artifactId> + <version>1.0</version> + <executions> + <execution> + <phase>generate-sources</phase> + <goals> + <goal>xdoclet</goal> + </goals> + <configuration> + <tasks> + <ejbdoclet destDir="${project.build.directory}/generated-sources/xdoclet" + ejbSpec="2.1"> + <fileset dir="${project.build.sourceDirectory}"> + <include name="**/*Bean.java" /> + <include name="**/*MDB.java" /> + </fileset> + <homeinterface /> + <remoteinterface /> + <localinterface /> + <localhomeinterface /> + </ejbdoclet> + </tasks> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project> diff --git a/rhgss/ejb2dep/ejb1/src/main/java/com/redhat/gss/example/ejb2dep/ejb1/EJB1Bean.java b/rhgss/ejb2dep/ejb1/src/main/java/com/redhat/gss/example/ejb2dep/ejb1/EJB1Bean.java new file mode 100644 index 0000000..7f900fc --- /dev/null +++ b/rhgss/ejb2dep/ejb1/src/main/java/com/redhat/gss/example/ejb2dep/ejb1/EJB1Bean.java @@ -0,0 +1,40 @@ +package com.redhat.gss.example.ejb2dep.ejb1; + +import java.rmi.RemoteException; +import javax.ejb.EJBException; +import javax.ejb.SessionBean; +import javax.ejb.SessionContext; +import javax.naming.InitialContext; +import com.redhat.gss.example.ejb2dep.ejb2.EJB2LocalHome; +import com.redhat.gss.example.ejb2dep.ejb2.EJB2Local; + +/** + * @ejb.bean name="EJB1" type="Stateless" + * //@ejb.ejb-ref ejb-name="EJB2Local" view-type="local" ref-name="ejb/EJB2LocalHome" + */ +public class EJB1Bean implements SessionBean { + + private SessionContext ctx; + + /** + * @ejb.interface-method view-type="local" + */ + public String echo(String name) { + try { + EJB2LocalHome ejb2home = InitialContext.doLookup("java:comp/env/ejb/EJB2LocalHome"); + EJB2Local ejb2 = ejb2home.create(); + return ejb2.echo(name); + } catch (Exception ex) { + throw new RuntimeException("EJB2 invoke error", ex); + } + } + + public void ejbCreate() { } + public void ejbActivate() throws EJBException, RemoteException { } + public void ejbPassivate() throws EJBException, RemoteException { } + public void ejbRemove() throws EJBException, RemoteException { } + public void setSessionContext(SessionContext context) + throws EJBException, RemoteException { + this.ctx = context; + } +} diff --git a/rhgss/ejb2dep/ejb1/src/main/resources/META-INF/ejb-jar.xml b/rhgss/ejb2dep/ejb1/src/main/resources/META-INF/ejb-jar.xml new file mode 100644 index 0000000..6341fc4 --- /dev/null +++ b/rhgss/ejb2dep/ejb1/src/main/resources/META-INF/ejb-jar.xml @@ -0,0 +1,32 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<ejb-jar xmlns="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee http://java.sun.com/xml/ns/j2ee/ejb-jar_2_1.xsd" version="2.1"> + + <description><![CDATA[No Description.]]></description> + <display-name>Generated by XDoclet</display-name> + + <enterprise-beans> + + <!-- Session Beans --> + <session > + <ejb-name>EJB1</ejb-name> + + <home>com.redhat.gss.example.ejb2dep.ejb1.EJB1Home</home> + <remote>com.redhat.gss.example.ejb2dep.ejb1.EJB1</remote> + <local-home>com.redhat.gss.example.ejb2dep.ejb1.EJB1LocalHome</local-home> + <local>com.redhat.gss.example.ejb2dep.ejb1.EJB1Local</local> + <ejb-class>com.redhat.gss.example.ejb2dep.ejb1.EJB1Bean</ejb-class> + <session-type>Stateless</session-type> + <transaction-type>Container</transaction-type> + + <ejb-local-ref> + <ejb-ref-name>ejb/EJB2LocalHome</ejb-ref-name> + <ejb-ref-type>Session</ejb-ref-type> + <local-home>com.redhat.gss.example.ejb2dep.ejb2.EJB2LocalHome</local-home> + <local>com.redhat.gss.example.ejb2dep.ejb2.EJB2Local</local> + </ejb-local-ref> + </session> + + </enterprise-beans> + +</ejb-jar> diff --git a/rhgss/ejb2dep/ejb1/src/main/resources/META-INF/jboss-ejb3.xml b/rhgss/ejb2dep/ejb1/src/main/resources/META-INF/jboss-ejb3.xml new file mode 100644 index 0000000..388ae51 --- /dev/null +++ b/rhgss/ejb2dep/ejb1/src/main/resources/META-INF/jboss-ejb3.xml @@ -0,0 +1,23 @@ +<?xml version="1.0"?> + +<jboss:ejb-jar xmlns:jboss="http://www.jboss.com/xml/ns/javaee" + xmlns="http://java.sun.com/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.org/j2ee/schema/jboss-ejb3-2_0.xsd + http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/ejb-jar_3_1.xsd" + version="3.1" + impl-version="2.0"> + + <enterprise-beans> + + <session> + <ejb-name>EJB1</ejb-name> + <ejb-local-ref> + <ejb-ref-name>ejb/EJB2LocalHome</ejb-ref-name> + <jndi-name>java:app/ejb2dep-ejb2-1.0/EJB2!com.redhat.gss.example.ejb2dep.ejb2.EJB2LocalHome</jndi-name> + </ejb-local-ref> + + </session> + + </enterprise-beans> +</jboss:ejb-jar> diff --git a/rhgss/ejb2dep/ejb2/pom.xml b/rhgss/ejb2dep/ejb2/pom.xml new file mode 100644 index 0000000..0739655 --- /dev/null +++ b/rhgss/ejb2dep/ejb2/pom.xml @@ -0,0 +1,56 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <groupId>com.redhat.gss.example.ejb2dep</groupId> + <artifactId>ejb2dep-ejb2</artifactId> + <name>ejb2dep-ejb2</name> + <packaging>ejb</packaging> + <version>1.0</version> + + <parent> + <groupId>com.redhat.gss.example.ejb2dep</groupId> + <artifactId>ejb2dep</artifactId> + <version>1.0</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <build> + <finalName>${project.artifactId}</finalName> + <plugins> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>xdoclet-maven-plugin</artifactId> + <version>1.0</version> + <executions> + <execution> + <phase>generate-sources</phase> + <goals> + <goal>xdoclet</goal> + </goals> + <configuration> + <tasks> + <ejbdoclet destDir="${project.build.directory}/generated-sources/xdoclet" + ejbSpec="2.1"> + <fileset dir="${project.build.sourceDirectory}"> + <include name="**/*Bean.java" /> + <include name="**/*MDB.java" /> + </fileset> + <homeinterface /> + <remoteinterface /> + <localinterface /> + <localhomeinterface /> + <deploymentdescriptor destDir="${project.build.outputDirectory}/META-INF" /> + </ejbdoclet> + </tasks> + </configuration> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project> diff --git a/rhgss/ejb2dep/ejb2/src/main/java/com/redhat/gss/example/ejb2dep/ejb2/EJB2Bean.java b/rhgss/ejb2dep/ejb2/src/main/java/com/redhat/gss/example/ejb2dep/ejb2/EJB2Bean.java new file mode 100644 index 0000000..a4a411a --- /dev/null +++ b/rhgss/ejb2dep/ejb2/src/main/java/com/redhat/gss/example/ejb2dep/ejb2/EJB2Bean.java @@ -0,0 +1,30 @@ +package com.redhat.gss.example.ejb2dep.ejb2; + +import java.rmi.RemoteException; +import javax.ejb.EJBException; +import javax.ejb.SessionBean; +import javax.ejb.SessionContext; + +/** + * @ejb.bean name="EJB2" type="Stateless" + */ +public class EJB2Bean implements SessionBean { + + private SessionContext ctx; + + /** + * @ejb.interface-method view-type="local" + */ + public String echo(String name) { + return name; + } + + public void ejbCreate() { } + public void ejbActivate() throws EJBException, RemoteException { } + public void ejbPassivate() throws EJBException, RemoteException { } + public void ejbRemove() throws EJBException, RemoteException { } + public void setSessionContext(SessionContext context) + throws EJBException, RemoteException { + this.ctx = context; + } +} diff --git a/rhgss/ejb2dep/pom.xml b/rhgss/ejb2dep/pom.xml new file mode 100644 index 0000000..83e84f9 --- /dev/null +++ b/rhgss/ejb2dep/pom.xml @@ -0,0 +1,132 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <groupId>com.redhat.gss.example.ejb2dep</groupId> + <artifactId>ejb2dep</artifactId> + <name>ejb2dep</name> + <version>1.0</version> + <packaging>pom</packaging> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + + <version.org.jboss.spec.jboss-javaee-6.0>3.0.2.Final</version.org.jboss.spec.jboss-javaee-6.0> + + <version.maven-compiler-plugin>3.1</version.maven-compiler-plugin> + <version.maven-ear-plugin>2.9.1</version.maven-ear-plugin> + <version.maven-ejb-plugin>2.4</version.maven-ejb-plugin> + <version.maven-war-plugin>2.4</version.maven-war-plugin> + </properties> + + <repositories> + <repository> + <id>jboss-public</id> + <name>JBoss Public Maven Repository Group</name> + <url>https://repository.jboss.org/nexus/content/groups/public/</url> + <layout>default</layout> + <releases> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>jboss-public</id> + <name>JBoss Public Maven Repository Group</name> + <url>https://repository.jboss.org/nexus/content/groups/public/</url> + <layout>default</layout> + <releases> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + + <dependencies> + <dependency> + <groupId>org.jboss.spec</groupId> + <artifactId>jboss-javaee-6.0</artifactId> + <version>${version.org.jboss.spec.jboss-javaee-6.0}</version> + <type>pom</type> + <scope>provided</scope> + </dependency> + </dependencies> + + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>${version.maven-compiler-plugin}</version> + <configuration> + <source>1.6</source> + <target>1.6</target> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-ejb-plugin</artifactId> + <version>${version.maven-ejb-plugin}</version> + <configuration> + <ejbVersion>3.1</ejbVersion> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-war-plugin</artifactId> + <version>${version.maven-war-plugin}</version> + <configuration> + <failOnMissingWebXml>false</failOnMissingWebXml> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-ear-plugin</artifactId> + <version>${version.maven-ear-plugin}</version> + <configuration> + <finalName>ejb2dep</finalName> + <version>6</version> + <modules> + <ejbModule> + <groupId>${project.groupId}</groupId> + <artifactId>ejb2dep-ejb1</artifactId> + </ejbModule> + <ejbModule> + <groupId>${project.groupId}</groupId> + <artifactId>ejb2dep-ejb2</artifactId> + </ejbModule> + <webModule> + <groupId>${project.groupId}</groupId> + <artifactId>ejb2dep-web</artifactId> + </webModule> + </modules> + </configuration> + </plugin> + </plugins> + </pluginManagement> + + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + </plugin> + </plugins> + </build> + + <modules> + <module>ejb2</module> + <module>ejb1</module> + <module>web</module> + <module>ear</module> + </modules> + +</project> diff --git a/rhgss/ejb2dep/web/pom.xml b/rhgss/ejb2dep/web/pom.xml new file mode 100644 index 0000000..80ff96b --- /dev/null +++ b/rhgss/ejb2dep/web/pom.xml @@ -0,0 +1,45 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <groupId>com.redhat.gss.example.ejb2dep</groupId> + <artifactId>ejb2dep-web</artifactId> + <name>ejb2dep-web</name> + <version>1.0</version> + <packaging>war</packaging> + + <parent> + <groupId>com.redhat.gss.example.ejb2dep</groupId> + <artifactId>ejb2dep</artifactId> + <version>1.0</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <dependencies> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>ejb2dep-ejb1</artifactId> + <version>${project.version}</version> + <type>ejb</type> + <scope>provided</scope> + </dependency> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>ejb2dep-ejb2</artifactId> + <version>${project.version}</version> + <type>ejb</type> + <scope>provided</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-war-plugin</artifactId> + </plugin> + </plugins> + </build> + +</project> diff --git a/rhgss/ejb2dep/web/src/main/java/com/redhat/gss/example/ejb2dep/web/TestServlet.java b/rhgss/ejb2dep/web/src/main/java/com/redhat/gss/example/ejb2dep/web/TestServlet.java new file mode 100644 index 0000000..63e064b --- /dev/null +++ b/rhgss/ejb2dep/web/src/main/java/com/redhat/gss/example/ejb2dep/web/TestServlet.java @@ -0,0 +1,27 @@ +package com.redhat.gss.example.ejb2dep.web; + +import java.io.IOException; +import javax.naming.InitialContext; +import javax.servlet.ServletException; +import javax.servlet.annotation.WebServlet; +import javax.servlet.http.HttpServlet; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import com.redhat.gss.example.ejb2dep.ejb1.EJB1LocalHome; +import com.redhat.gss.example.ejb2dep.ejb1.EJB1Local; + +@WebServlet(urlPatterns={"/test"}) +public class TestServlet extends HttpServlet { + + public void doGet(HttpServletRequest req, HttpServletResponse res) + throws ServletException, IOException { + try { + EJB1LocalHome ejb1home = InitialContext.doLookup("java:comp/env/ejb/EJB1LocalHome"); + EJB1Local ejb1 = ejb1home.create(); + String result = ejb1.echo("foo"); + res.getWriter().println(result); + } catch (Exception ex) { + throw new RuntimeException("EJB1 invoke error", ex); + } + } +} diff --git a/rhgss/ejb2dep/web/src/main/webapp/WEB-INF/jboss-web.xml b/rhgss/ejb2dep/web/src/main/webapp/WEB-INF/jboss-web.xml new file mode 100644 index 0000000..accf844 --- /dev/null +++ b/rhgss/ejb2dep/web/src/main/webapp/WEB-INF/jboss-web.xml @@ -0,0 +1,14 @@ +<?xml version='1.0' encoding='UTF-8' ?> + +<jboss-web version="7.2" + xmlns="http://java.sun.com/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.jboss.com/xml/ns/javaee http://www.jboss.com/xml/ns/javaee/jboss-web_7_2.xsd"> + + <ejb-local-ref> + <ejb-ref-name>ejb/EJB1LocalHome</ejb-ref-name> + <jndi-name>java:app/ejb2dep-ejb1-1.0/EJB1!com.redhat.gss.example.ejb2dep.ejb1.EJB1LocalHome</jndi-name> + </ejb-local-ref> + +</jboss-web> + diff --git a/rhgss/ejb2dep/web/src/main/webapp/WEB-INF/web.xml b/rhgss/ejb2dep/web/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 0000000..36c9821 --- /dev/null +++ b/rhgss/ejb2dep/web/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,15 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<web-app version="3.0" + xmlns="http://java.sun.com/xml/ns/javaee" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd"> + + <ejb-local-ref> + <ejb-ref-name>ejb/EJB1LocalHome</ejb-ref-name> + <ejb-ref-type>Session</ejb-ref-type> + <local-home>com.redhat.gss.example.ejb2dep.ejb1.EJB1LocalHome</local-home> + <local>com.redhat.gss.example.ejb2dep.ejb1.EJB1Local</local> + </ejb-local-ref> + +</web-app>
nekop/java-examples
48c192c41bae20ff7aa462ff1fc75469bb8e54c8
Fix inconsistent ejb and web modules order, always ejb first
diff --git a/maven/ee6full/pom.xml b/maven/ee6full/pom.xml index 85b469c..809e2dd 100644 --- a/maven/ee6full/pom.xml +++ b/maven/ee6full/pom.xml @@ -1,127 +1,127 @@ <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.github.nekop</groupId> <artifactId>ee6full</artifactId> <name>ee6full</name> <version>1.0</version> <packaging>pom</packaging> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <version.org.jboss.spec.jboss-javaee-6.0>3.0.2.Final</version.org.jboss.spec.jboss-javaee-6.0> <version.maven-compiler-plugin>3.1</version.maven-compiler-plugin> <version.maven-ear-plugin>2.9.1</version.maven-ear-plugin> <version.maven-ejb-plugin>2.4</version.maven-ejb-plugin> <version.maven-war-plugin>2.4</version.maven-war-plugin> </properties> <repositories> <repository> <id>jboss-public</id> <name>JBoss Public Maven Repository Group</name> <url>https://repository.jboss.org/nexus/content/groups/public/</url> <layout>default</layout> <releases> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>jboss-public</id> <name>JBoss Public Maven Repository Group</name> <url>https://repository.jboss.org/nexus/content/groups/public/</url> <layout>default</layout> <releases> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories> <dependencies> <dependency> <groupId>org.jboss.spec</groupId> <artifactId>jboss-javaee-6.0</artifactId> <version>${version.org.jboss.spec.jboss-javaee-6.0}</version> <type>pom</type> <scope>provided</scope> </dependency> </dependencies> <build> <pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>${version.maven-compiler-plugin}</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-war-plugin</artifactId> - <version>${version.maven-war-plugin}</version> + <artifactId>maven-ejb-plugin</artifactId> + <version>${version.maven-ejb-plugin}</version> <configuration> - <failOnMissingWebXml>false</failOnMissingWebXml> + <ejbVersion>3.1</ejbVersion> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> - <artifactId>maven-ejb-plugin</artifactId> - <version>${version.maven-ejb-plugin}</version> + <artifactId>maven-war-plugin</artifactId> + <version>${version.maven-war-plugin}</version> <configuration> - <ejbVersion>3.1</ejbVersion> + <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-ear-plugin</artifactId> <version>${version.maven-ear-plugin}</version> <configuration> <finalName>ee6full</finalName> <version>6</version> <modules> - <webModule> - <groupId>${project.groupId}</groupId> - <artifactId>ee6full-web</artifactId> - </webModule> <ejbModule> <groupId>${project.groupId}</groupId> <artifactId>ee6full-ejb</artifactId> </ejbModule> + <webModule> + <groupId>${project.groupId}</groupId> + <artifactId>ee6full-web</artifactId> + </webModule> </modules> </configuration> </plugin> </plugins> </pluginManagement> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> </plugin> </plugins> </build> <modules> <module>ejb</module> <module>web</module> <module>ear</module> </modules> </project>
nekop/java-examples
e5bd3127dab3d33f6e7aa49bfe81e3de40161a79
Add Java EE 6 Full EAR pom files
diff --git a/maven/ee6full/ear/pom.xml b/maven/ee6full/ear/pom.xml new file mode 100644 index 0000000..f9df990 --- /dev/null +++ b/maven/ee6full/ear/pom.xml @@ -0,0 +1,43 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <groupId>com.github.nekop</groupId> + <artifactId>ee6full-ear</artifactId> + <name>ee6full-ear</name> + <version>1.0</version> + <packaging>ear</packaging> + + <parent> + <groupId>com.github.nekop</groupId> + <artifactId>ee6full</artifactId> + <version>1.0</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <dependencies> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>ee6full-ejb</artifactId> + <version>${project.version}</version> + <type>ejb</type> + </dependency> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>ee6full-web</artifactId> + <version>${project.version}</version> + <type>war</type> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-ear-plugin</artifactId> + </plugin> + </plugins> + </build> + +</project> diff --git a/maven/ee6full/ejb/pom.xml b/maven/ee6full/ejb/pom.xml new file mode 100644 index 0000000..a481ddc --- /dev/null +++ b/maven/ee6full/ejb/pom.xml @@ -0,0 +1,19 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <groupId>com.github.nekop</groupId> + <artifactId>ee6full-ejb</artifactId> + <name>ee6full-ejb</name> + <version>1.0</version> + <packaging>ejb</packaging> + + <parent> + <groupId>com.github.nekop</groupId> + <artifactId>ee6full</artifactId> + <version>1.0</version> + <relativePath>../pom.xml</relativePath> + </parent> + +</project> diff --git a/maven/ee6full/pom.xml b/maven/ee6full/pom.xml new file mode 100644 index 0000000..85b469c --- /dev/null +++ b/maven/ee6full/pom.xml @@ -0,0 +1,127 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <groupId>com.github.nekop</groupId> + <artifactId>ee6full</artifactId> + <name>ee6full</name> + <version>1.0</version> + <packaging>pom</packaging> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + + <version.org.jboss.spec.jboss-javaee-6.0>3.0.2.Final</version.org.jboss.spec.jboss-javaee-6.0> + + <version.maven-compiler-plugin>3.1</version.maven-compiler-plugin> + <version.maven-ear-plugin>2.9.1</version.maven-ear-plugin> + <version.maven-ejb-plugin>2.4</version.maven-ejb-plugin> + <version.maven-war-plugin>2.4</version.maven-war-plugin> + </properties> + + <repositories> + <repository> + <id>jboss-public</id> + <name>JBoss Public Maven Repository Group</name> + <url>https://repository.jboss.org/nexus/content/groups/public/</url> + <layout>default</layout> + <releases> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>jboss-public</id> + <name>JBoss Public Maven Repository Group</name> + <url>https://repository.jboss.org/nexus/content/groups/public/</url> + <layout>default</layout> + <releases> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + + <dependencies> + <dependency> + <groupId>org.jboss.spec</groupId> + <artifactId>jboss-javaee-6.0</artifactId> + <version>${version.org.jboss.spec.jboss-javaee-6.0}</version> + <type>pom</type> + <scope>provided</scope> + </dependency> + </dependencies> + + <build> + <pluginManagement> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + <version>${version.maven-compiler-plugin}</version> + <configuration> + <source>1.6</source> + <target>1.6</target> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-war-plugin</artifactId> + <version>${version.maven-war-plugin}</version> + <configuration> + <failOnMissingWebXml>false</failOnMissingWebXml> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-ejb-plugin</artifactId> + <version>${version.maven-ejb-plugin}</version> + <configuration> + <ejbVersion>3.1</ejbVersion> + </configuration> + </plugin> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-ear-plugin</artifactId> + <version>${version.maven-ear-plugin}</version> + <configuration> + <finalName>ee6full</finalName> + <version>6</version> + <modules> + <webModule> + <groupId>${project.groupId}</groupId> + <artifactId>ee6full-web</artifactId> + </webModule> + <ejbModule> + <groupId>${project.groupId}</groupId> + <artifactId>ee6full-ejb</artifactId> + </ejbModule> + </modules> + </configuration> + </plugin> + </plugins> + </pluginManagement> + + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-compiler-plugin</artifactId> + </plugin> + </plugins> + </build> + + <modules> + <module>ejb</module> + <module>web</module> + <module>ear</module> + </modules> + +</project> diff --git a/maven/ee6full/web/pom.xml b/maven/ee6full/web/pom.xml new file mode 100644 index 0000000..6ba978d --- /dev/null +++ b/maven/ee6full/web/pom.xml @@ -0,0 +1,38 @@ +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <groupId>com.github.nekop</groupId> + <artifactId>ee6full-web</artifactId> + <name>ee6full-web</name> + <version>1.0</version> + <packaging>war</packaging> + + <parent> + <groupId>com.github.nekop</groupId> + <artifactId>ee6full</artifactId> + <version>1.0</version> + <relativePath>../pom.xml</relativePath> + </parent> + + <dependencies> + <dependency> + <groupId>${project.groupId}</groupId> + <artifactId>ee6full-ejb</artifactId> + <version>${project.version}</version> + <type>ejb</type> + <scope>provided</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-war-plugin</artifactId> + </plugin> + </plugins> + </build> + +</project>
nekop/java-examples
8863dcfd367152fcabf2d2907d1d56fd3e3c3d95
Added URL
diff --git a/maven/pom-ee6web.xml b/maven/pom-ee6web.xml index 2dbb607..225bb08 100644 --- a/maven/pom-ee6web.xml +++ b/maven/pom-ee6web.xml @@ -1,173 +1,175 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <!-- Java EE 6 minimal pom.xml, works with JBoss EAP 6. + https://github.com/nekop/java-examples/blob/master/maven/ + Put your source code, config files, boot the application server and run: $ mvn clean install -Parq-remote [Summary] Additional Repository: JBoss Public Compile Deps: Java EE 6 Web Profile Test Deps: JUnit, Arquillian and ShrinkWrap Resolver Profiles: arq-managed, arq-remote --> <modelVersion>4.0.0</modelVersion> <groupId>com.github.nekop</groupId> <artifactId>ee6web</artifactId> <packaging>war</packaging> <name>ee6web</name> <version>1.0</version> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <version.org.jboss.spec.jboss-javaee-web-6.0>3.0.2.Final</version.org.jboss.spec.jboss-javaee-web-6.0> <version.org.jboss.arquillian.arquillian-bom>1.1.5.Final</version.org.jboss.arquillian.arquillian-bom> <version.org.jboss.as.jboss-as-arquillian-container-managed>7.2.0.Final</version.org.jboss.as.jboss-as-arquillian-container-managed> <version.org.jboss.as.jboss-as-arquillian-container-remote>7.2.0.Final</version.org.jboss.as.jboss-as-arquillian-container-remote> <version.junit>4.11</version.junit> <version.maven-surefire-plugin>2.17</version.maven-surefire-plugin> <version.maven-compiler-plugin>3.1</version.maven-compiler-plugin> <version.maven-war-plugin>2.4</version.maven-war-plugin> </properties> <repositories> <repository> <id>jboss-public</id> <name>JBoss Public Maven Repository Group</name> <url>https://repository.jboss.org/nexus/content/groups/public/</url> <layout>default</layout> <releases> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>jboss-public</id> <name>JBoss Public Maven Repository Group</name> <url>https://repository.jboss.org/nexus/content/groups/public/</url> <layout>default</layout> <releases> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories> <dependencyManagement> <dependencies> <dependency> <groupId>org.jboss.arquillian</groupId> <artifactId>arquillian-bom</artifactId> <version>${version.org.jboss.arquillian.arquillian-bom}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <!-- This Java EE 6 API jar is crippled, do NOT use for real projects/testing. Fixed in Java EE 7. <dependency> <groupId>javax</groupId> <artifactId>javaee-web-api</artifactId> <version>6.0</version> <scope>provided</scope> </dependency> --> <!-- Java EE 6 API jars. It's actually a bom, but we can use it as a depchain --> <dependency> <groupId>org.jboss.spec</groupId> <artifactId>jboss-javaee-web-6.0</artifactId> <version>${version.org.jboss.spec.jboss-javaee-web-6.0}</version> <scope>provided</scope> <type>pom</type> </dependency> <!-- test deps --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>${version.junit}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.arquillian.junit</groupId> <artifactId>arquillian-junit-container</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.shrinkwrap.resolver</groupId> <artifactId>shrinkwrap-resolver-depchain</artifactId> <type>pom</type> <scope>test</scope> </dependency> </dependencies> <build> <finalName>${project.artifactId}</finalName> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>${version.maven-compiler-plugin}</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>${version.maven-surefire-plugin}</version> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>${version.maven-war-plugin}</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> </plugins> </build> <profiles> <profile> <id>arq-managed</id> <dependencies> <dependency> <groupId>org.jboss.as</groupId> <artifactId>jboss-as-arquillian-container-managed</artifactId> <version>${version.org.jboss.as.jboss-as-arquillian-container-managed}</version> <scope>test</scope> </dependency> </dependencies> </profile> <profile> <id>arq-remote</id> <dependencies> <dependency> <groupId>org.jboss.as</groupId> <artifactId>jboss-as-arquillian-container-remote</artifactId> <version>${version.org.jboss.as.jboss-as-arquillian-container-remote}</version> <scope>test</scope> </dependency> </dependencies> </profile> </profiles> </project> diff --git a/maven/pom-ee7web.xml b/maven/pom-ee7web.xml index 0731d17..aaed80a 100644 --- a/maven/pom-ee7web.xml +++ b/maven/pom-ee7web.xml @@ -1,159 +1,161 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <!-- Java EE 7 minimal pom.xml, works with WildFly 8.1. + https://github.com/nekop/java-examples/blob/master/maven/ + Put your source code, config files, boot the application server and run: $ mvn clean install -Parq-remote [Summary] Additional Repository: JBoss Public Compile Deps: Java EE 7 Web Profile Test Deps: JUnit, Arquillian and ShrinkWrap Resolver Profiles: arq-managed, arq-remote --> <modelVersion>4.0.0</modelVersion> <groupId>com.github.nekop</groupId> <artifactId>ee7web</artifactId> <packaging>war</packaging> <name>ee7web</name> <version>1.0</version> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <version.org.jboss.arquillian.arquillian-bom>1.1.5.Final</version.org.jboss.arquillian.arquillian-bom> <version.wildfly>8.1.0.Final</version.wildfly> <version.junit>4.11</version.junit> <version.maven-surefire-plugin>2.17</version.maven-surefire-plugin> <version.maven-compiler-plugin>3.1</version.maven-compiler-plugin> <version.maven-war-plugin>2.4</version.maven-war-plugin> </properties> <repositories> <repository> <id>jboss-public</id> <name>JBoss Public Maven Repository Group</name> <url>https://repository.jboss.org/nexus/content/groups/public/</url> <layout>default</layout> <releases> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>jboss-public</id> <name>JBoss Public Maven Repository Group</name> <url>https://repository.jboss.org/nexus/content/groups/public/</url> <layout>default</layout> <releases> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories> <dependencyManagement> <dependencies> <dependency> <groupId>org.jboss.arquillian</groupId> <artifactId>arquillian-bom</artifactId> <version>${version.org.jboss.arquillian.arquillian-bom}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <dependency> <groupId>javax</groupId> <artifactId>javaee-web-api</artifactId> <version>7.0</version> <scope>provided</scope> </dependency> <!-- test deps --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>${version.junit}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.arquillian.junit</groupId> <artifactId>arquillian-junit-container</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.shrinkwrap.resolver</groupId> <artifactId>shrinkwrap-resolver-depchain</artifactId> <type>pom</type> <scope>test</scope> </dependency> </dependencies> <build> <finalName>${project.artifactId}</finalName> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>${version.maven-compiler-plugin}</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>${version.maven-surefire-plugin}</version> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>${version.maven-war-plugin}</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> </plugins> </build> <profiles> <profile> <id>arq-managed</id> <dependencies> <dependency> <groupId>org.wildfly</groupId> <artifactId>wildfly-arquillian-container-managed</artifactId> <version>${version.wildfly}</version> <scope>test</scope> </dependency> </dependencies> </profile> <profile> <id>arq-remote</id> <dependencies> <dependency> <groupId>org.wildfly</groupId> <artifactId>wildfly-arquillian-container-remote</artifactId> <version>${version.wildfly}</version> <scope>test</scope> </dependency> </dependencies> </profile> </profiles> </project>
nekop/java-examples
142c6d5c11e8629d511e00c874d4711c191be904
Broken spec jar has been fixed in EE 7
diff --git a/maven/pom-ee6web.xml b/maven/pom-ee6web.xml index f68ba27..083b0f1 100644 --- a/maven/pom-ee6web.xml +++ b/maven/pom-ee6web.xml @@ -1,172 +1,173 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <!-- Java EE 6 minimal pom.xml, works with JBoss EAP 6. Put your source code, config files, boot the application server and run: $ mvn clean install -Parq-remote [Summary] Additional Repository: JBoss Public Compile Deps: Java EE 6 Web Profile Test Deps: JUnit, Arquillian and ShrinkWrap Resolver Profiles: arq-managed, arq-remote --> <modelVersion>4.0.0</modelVersion> <groupId>com.github.nekop</groupId> <artifactId>ee6web</artifactId> <packaging>war</packaging> <name>ee6web</name> <version>1.0</version> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <version.org.jboss.spec.jboss-javaee-web-6.0>3.0.2.Final</version.org.jboss.spec.jboss-javaee-web-6.0> <version.org.jboss.arquillian.arquillian-bom>1.1.4.Final</version.org.jboss.arquillian.arquillian-bom> <version.org.jboss.as.jboss-as-arquillian-container-managed>7.2.0.Final</version.org.jboss.as.jboss-as-arquillian-container-managed> <version.org.jboss.as.jboss-as-arquillian-container-remote>7.2.0.Final</version.org.jboss.as.jboss-as-arquillian-container-remote> <version.junit>4.11</version.junit> <version.maven-surefire-plugin>2.17</version.maven-surefire-plugin> <version.maven-compiler-plugin>3.1</version.maven-compiler-plugin> <version.maven-war-plugin>2.4</version.maven-war-plugin> </properties> <repositories> <repository> <id>jboss-public</id> <name>JBoss Public Maven Repository Group</name> <url>https://repository.jboss.org/nexus/content/groups/public/</url> <layout>default</layout> <releases> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>jboss-public</id> <name>JBoss Public Maven Repository Group</name> <url>https://repository.jboss.org/nexus/content/groups/public/</url> <layout>default</layout> <releases> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories> <dependencyManagement> <dependencies> <dependency> <groupId>org.jboss.arquillian</groupId> <artifactId>arquillian-bom</artifactId> <version>${version.org.jboss.arquillian.arquillian-bom}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> - <!-- prune API jar, do NOT use for real projects/testing + <!-- This Java EE 6 API jar is crippled, do NOT use for real projects/testing. + Fixed in Java EE 7. <dependency> <groupId>javax</groupId> - <artifactId>javaee-api</artifactId> + <artifactId>javaee-web-api</artifactId> <version>6.0</version> <scope>provided</scope> </dependency> --> <!-- Java EE 6 API jars. It's actually a bom, but we can use it as a depchain --> <dependency> <groupId>org.jboss.spec</groupId> <artifactId>jboss-javaee-web-6.0</artifactId> <version>${version.org.jboss.spec.jboss-javaee-web-6.0}</version> <scope>provided</scope> <type>pom</type> </dependency> <!-- test deps --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>${version.junit}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.arquillian.junit</groupId> <artifactId>arquillian-junit-container</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.shrinkwrap.resolver</groupId> <artifactId>shrinkwrap-resolver-depchain</artifactId> <type>pom</type> <scope>test</scope> </dependency> </dependencies> <build> <finalName>${project.artifactId}</finalName> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>${version.maven-compiler-plugin}</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>${version.maven-surefire-plugin}</version> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>${version.maven-war-plugin}</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> </plugins> </build> <profiles> <profile> <id>arq-managed</id> <dependencies> <dependency> <groupId>org.jboss.as</groupId> <artifactId>jboss-as-arquillian-container-managed</artifactId> <version>${version.org.jboss.as.jboss-as-arquillian-container-managed}</version> <scope>test</scope> </dependency> </dependencies> </profile> <profile> <id>arq-remote</id> <dependencies> <dependency> <groupId>org.jboss.as</groupId> <artifactId>jboss-as-arquillian-container-remote</artifactId> <version>${version.org.jboss.as.jboss-as-arquillian-container-remote}</version> <scope>test</scope> </dependency> </dependencies> </profile> </profiles> </project> diff --git a/maven/pom-ee7web.xml b/maven/pom-ee7web.xml index 8c20102..23c642c 100644 --- a/maven/pom-ee7web.xml +++ b/maven/pom-ee7web.xml @@ -1,171 +1,159 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <!-- Java EE 7 minimal pom.xml, works with WildFly 8.1. Put your source code, config files, boot the application server and run: $ mvn clean install -Parq-remote [Summary] Additional Repository: JBoss Public Compile Deps: Java EE 7 Web Profile Test Deps: JUnit, Arquillian and ShrinkWrap Resolver Profiles: arq-managed, arq-remote --> <modelVersion>4.0.0</modelVersion> <groupId>com.github.nekop</groupId> <artifactId>ee7web</artifactId> <packaging>war</packaging> <name>ee7web</name> <version>1.0</version> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> - <version.org.jboss.spec.jboss-javaee-web-7.0>1.0.0.Final</version.org.jboss.spec.jboss-javaee-web-7.0> - <version.org.jboss.arquillian.arquillian-bom>1.1.4.Final</version.org.jboss.arquillian.arquillian-bom> <version.wildfly>8.1.0.Final</version.wildfly> <version.junit>4.11</version.junit> <version.maven-surefire-plugin>2.17</version.maven-surefire-plugin> <version.maven-compiler-plugin>3.1</version.maven-compiler-plugin> <version.maven-war-plugin>2.4</version.maven-war-plugin> </properties> <repositories> <repository> <id>jboss-public</id> <name>JBoss Public Maven Repository Group</name> <url>https://repository.jboss.org/nexus/content/groups/public/</url> <layout>default</layout> <releases> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>jboss-public</id> <name>JBoss Public Maven Repository Group</name> <url>https://repository.jboss.org/nexus/content/groups/public/</url> <layout>default</layout> <releases> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories> <dependencyManagement> <dependencies> <dependency> <groupId>org.jboss.arquillian</groupId> <artifactId>arquillian-bom</artifactId> <version>${version.org.jboss.arquillian.arquillian-bom}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> - <!-- prune API jar, do NOT use for real projects/testing <dependency> <groupId>javax</groupId> - <artifactId>javaee-api</artifactId> + <artifactId>javaee-web-api</artifactId> <version>7.0</version> <scope>provided</scope> </dependency> - --> - <!-- Java EE 7 API jars. It's actually a bom, but we can use it as a depchain --> - <dependency> - <groupId>org.jboss.spec</groupId> - <artifactId>jboss-javaee-web-7.0</artifactId> - <version>${version.org.jboss.spec.jboss-javaee-web-7.0}</version> - <scope>provided</scope> - <type>pom</type> - </dependency> <!-- test deps --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>${version.junit}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.arquillian.junit</groupId> <artifactId>arquillian-junit-container</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.shrinkwrap.resolver</groupId> <artifactId>shrinkwrap-resolver-depchain</artifactId> <type>pom</type> <scope>test</scope> </dependency> </dependencies> <build> <finalName>${project.artifactId}</finalName> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>${version.maven-compiler-plugin}</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>${version.maven-surefire-plugin}</version> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>${version.maven-war-plugin}</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> </plugins> </build> <profiles> <profile> <id>arq-managed</id> <dependencies> <dependency> <groupId>org.wildfly</groupId> <artifactId>wildfly-arquillian-container-managed</artifactId> <version>${version.wildfly}</version> <scope>test</scope> </dependency> </dependencies> </profile> <profile> <id>arq-remote</id> <dependencies> <dependency> <groupId>org.wildfly</groupId> <artifactId>wildfly-arquillian-container-remote</artifactId> <version>${version.wildfly}</version> <scope>test</scope> </dependency> </dependencies> </profile> </profiles> </project>
nekop/java-examples
3d4610285f2c5a6f0207aeed0f417fead29cb572
Add basic steps in the comment
diff --git a/maven/pom-ee6web.xml b/maven/pom-ee6web.xml index 18a422c..f68ba27 100644 --- a/maven/pom-ee6web.xml +++ b/maven/pom-ee6web.xml @@ -1,169 +1,172 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <!-- - Java EE 6 minimal pom.xml, works with JBoss EAP 6 + Java EE 6 minimal pom.xml, works with JBoss EAP 6. + + Put your source code, config files, boot the application server and run: + $ mvn clean install -Parq-remote [Summary] Additional Repository: JBoss Public Compile Deps: Java EE 6 Web Profile Test Deps: JUnit, Arquillian and ShrinkWrap Resolver Profiles: arq-managed, arq-remote --> <modelVersion>4.0.0</modelVersion> <groupId>com.github.nekop</groupId> <artifactId>ee6web</artifactId> <packaging>war</packaging> <name>ee6web</name> <version>1.0</version> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <version.org.jboss.spec.jboss-javaee-web-6.0>3.0.2.Final</version.org.jboss.spec.jboss-javaee-web-6.0> <version.org.jboss.arquillian.arquillian-bom>1.1.4.Final</version.org.jboss.arquillian.arquillian-bom> <version.org.jboss.as.jboss-as-arquillian-container-managed>7.2.0.Final</version.org.jboss.as.jboss-as-arquillian-container-managed> <version.org.jboss.as.jboss-as-arquillian-container-remote>7.2.0.Final</version.org.jboss.as.jboss-as-arquillian-container-remote> <version.junit>4.11</version.junit> <version.maven-surefire-plugin>2.17</version.maven-surefire-plugin> <version.maven-compiler-plugin>3.1</version.maven-compiler-plugin> <version.maven-war-plugin>2.4</version.maven-war-plugin> </properties> <repositories> <repository> <id>jboss-public</id> <name>JBoss Public Maven Repository Group</name> <url>https://repository.jboss.org/nexus/content/groups/public/</url> <layout>default</layout> <releases> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>jboss-public</id> <name>JBoss Public Maven Repository Group</name> <url>https://repository.jboss.org/nexus/content/groups/public/</url> <layout>default</layout> <releases> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories> <dependencyManagement> <dependencies> <dependency> <groupId>org.jboss.arquillian</groupId> <artifactId>arquillian-bom</artifactId> <version>${version.org.jboss.arquillian.arquillian-bom}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <!-- prune API jar, do NOT use for real projects/testing <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>6.0</version> <scope>provided</scope> </dependency> --> <!-- Java EE 6 API jars. It's actually a bom, but we can use it as a depchain --> <dependency> <groupId>org.jboss.spec</groupId> <artifactId>jboss-javaee-web-6.0</artifactId> <version>${version.org.jboss.spec.jboss-javaee-web-6.0}</version> <scope>provided</scope> <type>pom</type> </dependency> <!-- test deps --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>${version.junit}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.arquillian.junit</groupId> <artifactId>arquillian-junit-container</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.shrinkwrap.resolver</groupId> <artifactId>shrinkwrap-resolver-depchain</artifactId> <type>pom</type> <scope>test</scope> </dependency> </dependencies> <build> <finalName>${project.artifactId}</finalName> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>${version.maven-compiler-plugin}</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>${version.maven-surefire-plugin}</version> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>${version.maven-war-plugin}</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> </plugins> </build> <profiles> <profile> <id>arq-managed</id> <dependencies> <dependency> <groupId>org.jboss.as</groupId> <artifactId>jboss-as-arquillian-container-managed</artifactId> <version>${version.org.jboss.as.jboss-as-arquillian-container-managed}</version> <scope>test</scope> </dependency> </dependencies> </profile> <profile> <id>arq-remote</id> <dependencies> <dependency> <groupId>org.jboss.as</groupId> <artifactId>jboss-as-arquillian-container-remote</artifactId> <version>${version.org.jboss.as.jboss-as-arquillian-container-remote}</version> <scope>test</scope> </dependency> </dependencies> </profile> </profiles> </project> diff --git a/maven/pom-ee7web.xml b/maven/pom-ee7web.xml index 09f21c2..ede92ab 100644 --- a/maven/pom-ee7web.xml +++ b/maven/pom-ee7web.xml @@ -1,168 +1,171 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <!-- - Java EE 7 minimal pom.xml, works with WildFly 8.1 + Java EE 7 minimal pom.xml, works with WildFly 8.1. + + Put your source code, config files, boot the application server and run: + $ mvn clean install -Parq-remote [Summary] Additional Repository: JBoss Public Compile Deps: Java EE 7 Web Profile Test Deps: JUnit, Arquillian and ShrinkWrap Resolver Profiles: arq-managed, arq-remote --> <modelVersion>4.0.0</modelVersion> <groupId>com.github.nekop</groupId> <artifactId>ee7web</artifactId> <packaging>war</packaging> <name>ee7web</name> <version>1.0</version> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <version.org.jboss.spec.jboss-javaee-web-7.0>1.0.0.Final</version.org.jboss.spec.jboss-javaee-web-7.0> <version.org.jboss.arquillian.arquillian-bom>1.1.4.Final</version.org.jboss.arquillian.arquillian-bom> <version.wildfly>8.1.0.CR2</version.wildfly> <version.junit>4.11</version.junit> <version.maven-surefire-plugin>2.17</version.maven-surefire-plugin> <version.maven-compiler-plugin>3.1</version.maven-compiler-plugin> <version.maven-war-plugin>2.4</version.maven-war-plugin> </properties> <repositories> <repository> <id>jboss-public</id> <name>JBoss Public Maven Repository Group</name> <url>https://repository.jboss.org/nexus/content/groups/public/</url> <layout>default</layout> <releases> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>jboss-public</id> <name>JBoss Public Maven Repository Group</name> <url>https://repository.jboss.org/nexus/content/groups/public/</url> <layout>default</layout> <releases> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories> <dependencyManagement> <dependencies> <dependency> <groupId>org.jboss.arquillian</groupId> <artifactId>arquillian-bom</artifactId> <version>${version.org.jboss.arquillian.arquillian-bom}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <!-- prune API jar, do NOT use for real projects/testing <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>7.0</version> <scope>provided</scope> </dependency> --> <!-- Java EE 7 API jars. It's actually a bom, but we can use it as a depchain --> <dependency> <groupId>org.jboss.spec</groupId> <artifactId>jboss-javaee-web-7.0</artifactId> <version>${version.org.jboss.spec.jboss-javaee-web-7.0}</version> <scope>provided</scope> <type>pom</type> </dependency> <!-- test deps --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>${version.junit}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.arquillian.junit</groupId> <artifactId>arquillian-junit-container</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.shrinkwrap.resolver</groupId> <artifactId>shrinkwrap-resolver-depchain</artifactId> <type>pom</type> <scope>test</scope> </dependency> </dependencies> <build> <finalName>${project.artifactId}</finalName> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>${version.maven-compiler-plugin}</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>${version.maven-surefire-plugin}</version> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>${version.maven-war-plugin}</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> </plugins> </build> <profiles> <profile> <id>arq-managed</id> <dependencies> <dependency> <groupId>org.wildfly</groupId> <artifactId>wildfly-arquillian-container-managed</artifactId> <version>${version.wildfly}</version> <scope>test</scope> </dependency> </dependencies> </profile> <profile> <id>arq-remote</id> <dependencies> <dependency> <groupId>org.wildfly</groupId> <artifactId>wildfly-arquillian-container-remote</artifactId> <version>${version.wildfly}</version> <scope>test</scope> </dependency> </dependencies> </profile> </profiles> </project>
nekop/java-examples
f610d819d1ad8a9ff2d6b4595c94c500ac1044a7
Add summary comment
diff --git a/maven/pom-ee6web.xml b/maven/pom-ee6web.xml index b167a25..18a422c 100644 --- a/maven/pom-ee6web.xml +++ b/maven/pom-ee6web.xml @@ -1,159 +1,169 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <!-- + Java EE 6 minimal pom.xml, works with JBoss EAP 6 + + [Summary] + Additional Repository: JBoss Public + Compile Deps: Java EE 6 Web Profile + Test Deps: JUnit, Arquillian and ShrinkWrap Resolver + Profiles: arq-managed, arq-remote + --> + <modelVersion>4.0.0</modelVersion> <groupId>com.github.nekop</groupId> <artifactId>ee6web</artifactId> <packaging>war</packaging> <name>ee6web</name> <version>1.0</version> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <version.org.jboss.spec.jboss-javaee-web-6.0>3.0.2.Final</version.org.jboss.spec.jboss-javaee-web-6.0> <version.org.jboss.arquillian.arquillian-bom>1.1.4.Final</version.org.jboss.arquillian.arquillian-bom> <version.org.jboss.as.jboss-as-arquillian-container-managed>7.2.0.Final</version.org.jboss.as.jboss-as-arquillian-container-managed> <version.org.jboss.as.jboss-as-arquillian-container-remote>7.2.0.Final</version.org.jboss.as.jboss-as-arquillian-container-remote> <version.junit>4.11</version.junit> <version.maven-surefire-plugin>2.17</version.maven-surefire-plugin> <version.maven-compiler-plugin>3.1</version.maven-compiler-plugin> <version.maven-war-plugin>2.4</version.maven-war-plugin> </properties> <repositories> <repository> <id>jboss-public</id> <name>JBoss Public Maven Repository Group</name> <url>https://repository.jboss.org/nexus/content/groups/public/</url> <layout>default</layout> <releases> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>jboss-public</id> <name>JBoss Public Maven Repository Group</name> <url>https://repository.jboss.org/nexus/content/groups/public/</url> <layout>default</layout> <releases> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories> <dependencyManagement> <dependencies> <dependency> <groupId>org.jboss.arquillian</groupId> <artifactId>arquillian-bom</artifactId> <version>${version.org.jboss.arquillian.arquillian-bom}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <!-- prune API jar, do NOT use for real projects/testing <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>6.0</version> <scope>provided</scope> </dependency> --> <!-- Java EE 6 API jars. It's actually a bom, but we can use it as a depchain --> <dependency> <groupId>org.jboss.spec</groupId> <artifactId>jboss-javaee-web-6.0</artifactId> <version>${version.org.jboss.spec.jboss-javaee-web-6.0}</version> <scope>provided</scope> <type>pom</type> </dependency> <!-- test deps --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>${version.junit}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.arquillian.junit</groupId> <artifactId>arquillian-junit-container</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.shrinkwrap.resolver</groupId> <artifactId>shrinkwrap-resolver-depchain</artifactId> <type>pom</type> <scope>test</scope> </dependency> </dependencies> <build> <finalName>${project.artifactId}</finalName> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>${version.maven-compiler-plugin}</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>${version.maven-surefire-plugin}</version> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>${version.maven-war-plugin}</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> </plugins> </build> <profiles> <profile> <id>arq-managed</id> <dependencies> <dependency> <groupId>org.jboss.as</groupId> <artifactId>jboss-as-arquillian-container-managed</artifactId> <version>${version.org.jboss.as.jboss-as-arquillian-container-managed}</version> <scope>test</scope> </dependency> </dependencies> </profile> <profile> <id>arq-remote</id> <dependencies> <dependency> <groupId>org.jboss.as</groupId> <artifactId>jboss-as-arquillian-container-remote</artifactId> <version>${version.org.jboss.as.jboss-as-arquillian-container-remote}</version> <scope>test</scope> </dependency> </dependencies> </profile> </profiles> </project> diff --git a/maven/pom-ee7web.xml b/maven/pom-ee7web.xml index 6f67cd4..09f21c2 100644 --- a/maven/pom-ee7web.xml +++ b/maven/pom-ee7web.xml @@ -1,158 +1,168 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + <!-- + Java EE 7 minimal pom.xml, works with WildFly 8.1 + + [Summary] + Additional Repository: JBoss Public + Compile Deps: Java EE 7 Web Profile + Test Deps: JUnit, Arquillian and ShrinkWrap Resolver + Profiles: arq-managed, arq-remote + --> + <modelVersion>4.0.0</modelVersion> <groupId>com.github.nekop</groupId> <artifactId>ee7web</artifactId> <packaging>war</packaging> <name>ee7web</name> <version>1.0</version> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <version.org.jboss.spec.jboss-javaee-web-7.0>1.0.0.Final</version.org.jboss.spec.jboss-javaee-web-7.0> <version.org.jboss.arquillian.arquillian-bom>1.1.4.Final</version.org.jboss.arquillian.arquillian-bom> <version.wildfly>8.1.0.CR2</version.wildfly> <version.junit>4.11</version.junit> <version.maven-surefire-plugin>2.17</version.maven-surefire-plugin> <version.maven-compiler-plugin>3.1</version.maven-compiler-plugin> <version.maven-war-plugin>2.4</version.maven-war-plugin> </properties> <repositories> <repository> <id>jboss-public</id> <name>JBoss Public Maven Repository Group</name> <url>https://repository.jboss.org/nexus/content/groups/public/</url> <layout>default</layout> <releases> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </repository> </repositories> <pluginRepositories> <pluginRepository> <id>jboss-public</id> <name>JBoss Public Maven Repository Group</name> <url>https://repository.jboss.org/nexus/content/groups/public/</url> <layout>default</layout> <releases> <updatePolicy>never</updatePolicy> </releases> <snapshots> <enabled>false</enabled> </snapshots> </pluginRepository> </pluginRepositories> <dependencyManagement> <dependencies> <dependency> <groupId>org.jboss.arquillian</groupId> <artifactId>arquillian-bom</artifactId> <version>${version.org.jboss.arquillian.arquillian-bom}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <!-- prune API jar, do NOT use for real projects/testing <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>7.0</version> <scope>provided</scope> </dependency> --> <!-- Java EE 7 API jars. It's actually a bom, but we can use it as a depchain --> <dependency> <groupId>org.jboss.spec</groupId> <artifactId>jboss-javaee-web-7.0</artifactId> <version>${version.org.jboss.spec.jboss-javaee-web-7.0}</version> <scope>provided</scope> <type>pom</type> </dependency> <!-- test deps --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>${version.junit}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.arquillian.junit</groupId> <artifactId>arquillian-junit-container</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.shrinkwrap.resolver</groupId> <artifactId>shrinkwrap-resolver-depchain</artifactId> <type>pom</type> <scope>test</scope> </dependency> </dependencies> <build> <finalName>${project.artifactId}</finalName> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>${version.maven-compiler-plugin}</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>${version.maven-surefire-plugin}</version> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>${version.maven-war-plugin}</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> </plugins> </build> <profiles> <profile> <id>arq-managed</id> <dependencies> <dependency> <groupId>org.wildfly</groupId> <artifactId>wildfly-arquillian-container-managed</artifactId> <version>${version.wildfly}</version> <scope>test</scope> </dependency> </dependencies> </profile> <profile> <id>arq-remote</id> <dependencies> <dependency> <groupId>org.wildfly</groupId> <artifactId>wildfly-arquillian-container-remote</artifactId> <version>${version.wildfly}</version> <scope>test</scope> </dependency> </dependencies> </profile> </profiles> </project>
nekop/java-examples
e2dc902a66288b5a6e735ee99d94ac133a6398f8
Add jboss repo
diff --git a/maven/pom-ee6web.xml b/maven/pom-ee6web.xml index 3bb7cee..b167a25 100644 --- a/maven/pom-ee6web.xml +++ b/maven/pom-ee6web.xml @@ -1,130 +1,159 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.github.nekop</groupId> <artifactId>ee6web</artifactId> <packaging>war</packaging> <name>ee6web</name> <version>1.0</version> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <version.org.jboss.spec.jboss-javaee-web-6.0>3.0.2.Final</version.org.jboss.spec.jboss-javaee-web-6.0> <version.org.jboss.arquillian.arquillian-bom>1.1.4.Final</version.org.jboss.arquillian.arquillian-bom> <version.org.jboss.as.jboss-as-arquillian-container-managed>7.2.0.Final</version.org.jboss.as.jboss-as-arquillian-container-managed> <version.org.jboss.as.jboss-as-arquillian-container-remote>7.2.0.Final</version.org.jboss.as.jboss-as-arquillian-container-remote> <version.junit>4.11</version.junit> <version.maven-surefire-plugin>2.17</version.maven-surefire-plugin> <version.maven-compiler-plugin>3.1</version.maven-compiler-plugin> <version.maven-war-plugin>2.4</version.maven-war-plugin> </properties> + <repositories> + <repository> + <id>jboss-public</id> + <name>JBoss Public Maven Repository Group</name> + <url>https://repository.jboss.org/nexus/content/groups/public/</url> + <layout>default</layout> + <releases> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>jboss-public</id> + <name>JBoss Public Maven Repository Group</name> + <url>https://repository.jboss.org/nexus/content/groups/public/</url> + <layout>default</layout> + <releases> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + <dependencyManagement> <dependencies> <dependency> <groupId>org.jboss.arquillian</groupId> <artifactId>arquillian-bom</artifactId> <version>${version.org.jboss.arquillian.arquillian-bom}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <!-- prune API jar, do NOT use for real projects/testing <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>6.0</version> <scope>provided</scope> </dependency> --> <!-- Java EE 6 API jars. It's actually a bom, but we can use it as a depchain --> <dependency> <groupId>org.jboss.spec</groupId> <artifactId>jboss-javaee-web-6.0</artifactId> <version>${version.org.jboss.spec.jboss-javaee-web-6.0}</version> <scope>provided</scope> <type>pom</type> </dependency> <!-- test deps --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>${version.junit}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.arquillian.junit</groupId> <artifactId>arquillian-junit-container</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.shrinkwrap.resolver</groupId> <artifactId>shrinkwrap-resolver-depchain</artifactId> <type>pom</type> <scope>test</scope> </dependency> </dependencies> <build> <finalName>${project.artifactId}</finalName> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>${version.maven-compiler-plugin}</version> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>${version.maven-surefire-plugin}</version> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>${version.maven-war-plugin}</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> </plugins> </build> <profiles> <profile> <id>arq-managed</id> <dependencies> <dependency> <groupId>org.jboss.as</groupId> <artifactId>jboss-as-arquillian-container-managed</artifactId> <version>${version.org.jboss.as.jboss-as-arquillian-container-managed}</version> <scope>test</scope> </dependency> </dependencies> </profile> <profile> <id>arq-remote</id> <dependencies> <dependency> <groupId>org.jboss.as</groupId> <artifactId>jboss-as-arquillian-container-remote</artifactId> <version>${version.org.jboss.as.jboss-as-arquillian-container-remote}</version> <scope>test</scope> </dependency> </dependencies> </profile> </profiles> </project> diff --git a/maven/pom-ee7web.xml b/maven/pom-ee7web.xml index b0c6e61..6f67cd4 100644 --- a/maven/pom-ee7web.xml +++ b/maven/pom-ee7web.xml @@ -1,129 +1,158 @@ <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <modelVersion>4.0.0</modelVersion> <groupId>com.github.nekop</groupId> <artifactId>ee7web</artifactId> <packaging>war</packaging> <name>ee7web</name> <version>1.0</version> <properties> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <version.org.jboss.spec.jboss-javaee-web-7.0>1.0.0.Final</version.org.jboss.spec.jboss-javaee-web-7.0> <version.org.jboss.arquillian.arquillian-bom>1.1.4.Final</version.org.jboss.arquillian.arquillian-bom> <version.wildfly>8.1.0.CR2</version.wildfly> <version.junit>4.11</version.junit> <version.maven-surefire-plugin>2.17</version.maven-surefire-plugin> <version.maven-compiler-plugin>3.1</version.maven-compiler-plugin> <version.maven-war-plugin>2.4</version.maven-war-plugin> </properties> + <repositories> + <repository> + <id>jboss-public</id> + <name>JBoss Public Maven Repository Group</name> + <url>https://repository.jboss.org/nexus/content/groups/public/</url> + <layout>default</layout> + <releases> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </repository> + </repositories> + <pluginRepositories> + <pluginRepository> + <id>jboss-public</id> + <name>JBoss Public Maven Repository Group</name> + <url>https://repository.jboss.org/nexus/content/groups/public/</url> + <layout>default</layout> + <releases> + <updatePolicy>never</updatePolicy> + </releases> + <snapshots> + <enabled>false</enabled> + </snapshots> + </pluginRepository> + </pluginRepositories> + <dependencyManagement> <dependencies> <dependency> <groupId>org.jboss.arquillian</groupId> <artifactId>arquillian-bom</artifactId> <version>${version.org.jboss.arquillian.arquillian-bom}</version> <type>pom</type> <scope>import</scope> </dependency> </dependencies> </dependencyManagement> <dependencies> <!-- prune API jar, do NOT use for real projects/testing <dependency> <groupId>javax</groupId> <artifactId>javaee-api</artifactId> <version>7.0</version> <scope>provided</scope> </dependency> --> <!-- Java EE 7 API jars. It's actually a bom, but we can use it as a depchain --> <dependency> <groupId>org.jboss.spec</groupId> <artifactId>jboss-javaee-web-7.0</artifactId> <version>${version.org.jboss.spec.jboss-javaee-web-7.0}</version> <scope>provided</scope> <type>pom</type> </dependency> <!-- test deps --> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>${version.junit}</version> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.arquillian.junit</groupId> <artifactId>arquillian-junit-container</artifactId> <scope>test</scope> </dependency> <dependency> <groupId>org.jboss.shrinkwrap.resolver</groupId> <artifactId>shrinkwrap-resolver-depchain</artifactId> <type>pom</type> <scope>test</scope> </dependency> </dependencies> <build> <finalName>${project.artifactId}</finalName> <plugins> <plugin> <artifactId>maven-compiler-plugin</artifactId> <version>${version.maven-compiler-plugin}</version> <configuration> <source>1.7</source> <target>1.7</target> </configuration> </plugin> <plugin> <artifactId>maven-surefire-plugin</artifactId> <version>${version.maven-surefire-plugin}</version> </plugin> <plugin> <artifactId>maven-war-plugin</artifactId> <version>${version.maven-war-plugin}</version> <configuration> <failOnMissingWebXml>false</failOnMissingWebXml> </configuration> </plugin> </plugins> </build> <profiles> <profile> <id>arq-managed</id> <dependencies> <dependency> <groupId>org.wildfly</groupId> <artifactId>wildfly-arquillian-container-managed</artifactId> <version>${version.wildfly}</version> <scope>test</scope> </dependency> </dependencies> </profile> <profile> <id>arq-remote</id> <dependencies> <dependency> <groupId>org.wildfly</groupId> <artifactId>wildfly-arquillian-container-remote</artifactId> <version>${version.wildfly}</version> <scope>test</scope> </dependency> </dependencies> </profile> </profiles> </project>
nekop/java-examples
f0383dabd1988c9e6aa7c3de064c697570419840
Add ee6 and ee7 pom templates
diff --git a/maven/pom-ee6-web.xml b/maven/pom-ee6-web.xml deleted file mode 100644 index 4b339a5..0000000 --- a/maven/pom-ee6-web.xml +++ /dev/null @@ -1,60 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> - -<project xmlns="http://maven.apache.org/POM/4.0.0" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> - - <modelVersion>4.0.0</modelVersion> - <groupId>com.github.nekop</groupId> - <artifactId>ee6-web</artifactId> - <packaging>war</packaging> - <name>ee6-web</name> - <version>1.0</version> - - <properties> - <version.org.jboss.spec.jboss-javaee-web-6.0>3.0.2.Final</version.org.jboss.spec.jboss-javaee-web-6.0> - <version.maven-war-plugin>2.4</version.maven-war-plugin> - <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> - <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> - </properties> - - <dependencies> - <!-- prune API jar, do not use for real projects/testing - <dependency> - <groupId>javax</groupId> - <artifactId>javaee-api</artifactId> - <version>6.0</version> - <scope>provided</scope> - </dependency> - --> - <!-- It's actually a bom, but we can declare it directly for simple use cases --> - <dependency> - <groupId>org.jboss.spec</groupId> - <artifactId>jboss-javaee-web-6.0</artifactId> - <version>${version.org.jboss.spec.jboss-javaee-web-6.0}</version> - <scope>provided</scope> - <type>pom</type> - </dependency> - </dependencies> - - <build> - <finalName>${project.artifactId}</finalName> - <plugins> - <plugin> - <artifactId>maven-compiler-plugin</artifactId> - <configuration> - <source>1.7</source> - <target>1.7</target> - </configuration> - </plugin> - <plugin> - <artifactId>maven-war-plugin</artifactId> - <version>${version.maven-war-plugin}</version> - <configuration> - <failOnMissingWebXml>false</failOnMissingWebXml> - </configuration> - </plugin> - </plugins> - </build> - -</project> diff --git a/maven/pom-ee6web.xml b/maven/pom-ee6web.xml new file mode 100644 index 0000000..3bb7cee --- /dev/null +++ b/maven/pom-ee6web.xml @@ -0,0 +1,130 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <groupId>com.github.nekop</groupId> + <artifactId>ee6web</artifactId> + <packaging>war</packaging> + <name>ee6web</name> + <version>1.0</version> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + + <version.org.jboss.spec.jboss-javaee-web-6.0>3.0.2.Final</version.org.jboss.spec.jboss-javaee-web-6.0> + + <version.org.jboss.arquillian.arquillian-bom>1.1.4.Final</version.org.jboss.arquillian.arquillian-bom> + <version.org.jboss.as.jboss-as-arquillian-container-managed>7.2.0.Final</version.org.jboss.as.jboss-as-arquillian-container-managed> + <version.org.jboss.as.jboss-as-arquillian-container-remote>7.2.0.Final</version.org.jboss.as.jboss-as-arquillian-container-remote> + <version.junit>4.11</version.junit> + <version.maven-surefire-plugin>2.17</version.maven-surefire-plugin> + <version.maven-compiler-plugin>3.1</version.maven-compiler-plugin> + <version.maven-war-plugin>2.4</version.maven-war-plugin> + </properties> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.jboss.arquillian</groupId> + <artifactId>arquillian-bom</artifactId> + <version>${version.org.jboss.arquillian.arquillian-bom}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <!-- prune API jar, do NOT use for real projects/testing + <dependency> + <groupId>javax</groupId> + <artifactId>javaee-api</artifactId> + <version>6.0</version> + <scope>provided</scope> + </dependency> + --> + <!-- Java EE 6 API jars. It's actually a bom, but we can use it as a depchain --> + <dependency> + <groupId>org.jboss.spec</groupId> + <artifactId>jboss-javaee-web-6.0</artifactId> + <version>${version.org.jboss.spec.jboss-javaee-web-6.0}</version> + <scope>provided</scope> + <type>pom</type> + </dependency> + + <!-- test deps --> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>${version.junit}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jboss.arquillian.junit</groupId> + <artifactId>arquillian-junit-container</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jboss.shrinkwrap.resolver</groupId> + <artifactId>shrinkwrap-resolver-depchain</artifactId> + <type>pom</type> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <finalName>${project.artifactId}</finalName> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>${version.maven-compiler-plugin}</version> + <configuration> + <source>1.6</source> + <target>1.6</target> + </configuration> + </plugin> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <version>${version.maven-surefire-plugin}</version> + </plugin> + <plugin> + <artifactId>maven-war-plugin</artifactId> + <version>${version.maven-war-plugin}</version> + <configuration> + <failOnMissingWebXml>false</failOnMissingWebXml> + </configuration> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <id>arq-managed</id> + <dependencies> + <dependency> + <groupId>org.jboss.as</groupId> + <artifactId>jboss-as-arquillian-container-managed</artifactId> + <version>${version.org.jboss.as.jboss-as-arquillian-container-managed}</version> + <scope>test</scope> + </dependency> + </dependencies> + </profile> + + <profile> + <id>arq-remote</id> + <dependencies> + <dependency> + <groupId>org.jboss.as</groupId> + <artifactId>jboss-as-arquillian-container-remote</artifactId> + <version>${version.org.jboss.as.jboss-as-arquillian-container-remote}</version> + <scope>test</scope> + </dependency> + </dependencies> + </profile> + </profiles> + +</project> diff --git a/maven/pom-ee7web.xml b/maven/pom-ee7web.xml new file mode 100644 index 0000000..b0c6e61 --- /dev/null +++ b/maven/pom-ee7web.xml @@ -0,0 +1,129 @@ +<?xml version="1.0" encoding="UTF-8"?> + +<project xmlns="http://maven.apache.org/POM/4.0.0" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <groupId>com.github.nekop</groupId> + <artifactId>ee7web</artifactId> + <packaging>war</packaging> + <name>ee7web</name> + <version>1.0</version> + + <properties> + <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> + <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> + + <version.org.jboss.spec.jboss-javaee-web-7.0>1.0.0.Final</version.org.jboss.spec.jboss-javaee-web-7.0> + + <version.org.jboss.arquillian.arquillian-bom>1.1.4.Final</version.org.jboss.arquillian.arquillian-bom> + <version.wildfly>8.1.0.CR2</version.wildfly> + <version.junit>4.11</version.junit> + <version.maven-surefire-plugin>2.17</version.maven-surefire-plugin> + <version.maven-compiler-plugin>3.1</version.maven-compiler-plugin> + <version.maven-war-plugin>2.4</version.maven-war-plugin> + </properties> + + <dependencyManagement> + <dependencies> + <dependency> + <groupId>org.jboss.arquillian</groupId> + <artifactId>arquillian-bom</artifactId> + <version>${version.org.jboss.arquillian.arquillian-bom}</version> + <type>pom</type> + <scope>import</scope> + </dependency> + </dependencies> + </dependencyManagement> + + <dependencies> + <!-- prune API jar, do NOT use for real projects/testing + <dependency> + <groupId>javax</groupId> + <artifactId>javaee-api</artifactId> + <version>7.0</version> + <scope>provided</scope> + </dependency> + --> + <!-- Java EE 7 API jars. It's actually a bom, but we can use it as a depchain --> + <dependency> + <groupId>org.jboss.spec</groupId> + <artifactId>jboss-javaee-web-7.0</artifactId> + <version>${version.org.jboss.spec.jboss-javaee-web-7.0}</version> + <scope>provided</scope> + <type>pom</type> + </dependency> + + <!-- test deps --> + <dependency> + <groupId>junit</groupId> + <artifactId>junit</artifactId> + <version>${version.junit}</version> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jboss.arquillian.junit</groupId> + <artifactId>arquillian-junit-container</artifactId> + <scope>test</scope> + </dependency> + <dependency> + <groupId>org.jboss.shrinkwrap.resolver</groupId> + <artifactId>shrinkwrap-resolver-depchain</artifactId> + <type>pom</type> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <finalName>${project.artifactId}</finalName> + <plugins> + <plugin> + <artifactId>maven-compiler-plugin</artifactId> + <version>${version.maven-compiler-plugin}</version> + <configuration> + <source>1.7</source> + <target>1.7</target> + </configuration> + </plugin> + <plugin> + <artifactId>maven-surefire-plugin</artifactId> + <version>${version.maven-surefire-plugin}</version> + </plugin> + <plugin> + <artifactId>maven-war-plugin</artifactId> + <version>${version.maven-war-plugin}</version> + <configuration> + <failOnMissingWebXml>false</failOnMissingWebXml> + </configuration> + </plugin> + </plugins> + </build> + + <profiles> + <profile> + <id>arq-managed</id> + <dependencies> + <dependency> + <groupId>org.wildfly</groupId> + <artifactId>wildfly-arquillian-container-managed</artifactId> + <version>${version.wildfly}</version> + <scope>test</scope> + </dependency> + </dependencies> + </profile> + + <profile> + <id>arq-remote</id> + <dependencies> + <dependency> + <groupId>org.wildfly</groupId> + <artifactId>wildfly-arquillian-container-remote</artifactId> + <version>${version.wildfly}</version> + <scope>test</scope> + </dependency> + </dependencies> + </profile> + </profiles> + +</project>