{"id":50,"date":"2016-04-02T16:18:55","date_gmt":"2016-04-02T16:18:55","guid":{"rendered":"https:\/\/pure-media.info\/?p=50"},"modified":"2017-04-06T03:53:06","modified_gmt":"2017-04-06T03:53:06","slug":"how-to-install-plexwatch-on-ubuntu-14-04-trusty-tahr","status":"publish","type":"post","link":"https:\/\/pure-media.info\/index.php\/2016\/04\/02\/how-to-install-plexwatch-on-ubuntu-14-04-trusty-tahr\/","title":{"rendered":"How to Install plexWatch on Ubuntu (14.04+ Trusty Tahr)"},"content":{"rendered":"<p><a href=\"https:\/\/i0.wp.com\/pure-media.info\/wp-content\/uploads\/2016\/04\/PlelWatch_bkg.png?ssl=1\" rel=\"attachment wp-att-51\"><img data-recalc-dims=\"1\" decoding=\"async\" data-attachment-id=\"51\" data-permalink=\"https:\/\/pure-media.info\/index.php\/2016\/04\/02\/how-to-install-plexwatch-on-ubuntu-14-04-trusty-tahr\/plelwatch_bkg\/\" data-orig-file=\"https:\/\/i0.wp.com\/pure-media.info\/wp-content\/uploads\/2016\/04\/PlelWatch_bkg.png?fit=347%2C347&amp;ssl=1\" data-orig-size=\"347,347\" data-comments-opened=\"1\" data-image-meta=\"{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;,&quot;orientation&quot;:&quot;0&quot;}\" data-image-title=\"PlelWatch_bkg\" data-image-description=\"\" data-image-caption=\"\" data-medium-file=\"https:\/\/i0.wp.com\/pure-media.info\/wp-content\/uploads\/2016\/04\/PlelWatch_bkg.png?fit=300%2C300&amp;ssl=1\" data-large-file=\"https:\/\/i0.wp.com\/pure-media.info\/wp-content\/uploads\/2016\/04\/PlelWatch_bkg.png?fit=347%2C347&amp;ssl=1\" class=\"aligncenter wp-image-51\" src=\"https:\/\/i0.wp.com\/pure-media.info\/wp-content\/uploads\/2016\/04\/PlelWatch_bkg.png?resize=177%2C177&#038;ssl=1\" alt=\"PlelWatch_bkg\" width=\"177\" height=\"177\"><\/a><\/p>\n<p>This guide will show you how to install and configure plex watch, Plex watch will&nbsp;Notify and Log &#8216;Now Playing&#8217; and &#8216;Watched&#8217; content from a Plex Media Server + &#8216;Recently Added&#8217; (&#8230;and more)<\/p>\n<p><strong>What it does<\/strong><\/p>\n<ul>\n<li>notify when a user starts watching a video<\/li>\n<li>notify when a user stops watching a video<\/li>\n<li>notify when a user pauses watching a video<\/li>\n<li>notify when a user resumes watching a video<\/li>\n<li>notify on recently added content to a PMS server<\/li>\n<li>notifies via email, prowl, pushover, growl, twitter, boxcar, pushbullet, GNTP and\/or a log file<\/li>\n<li>enable\/disable notifications per provider &amp; per notification type (start, stop, paush, resume, recently added)<\/li>\n<li>backed by a SQLite DB (for state and history)<\/li>\n<li>CLI to query watched videos, videos being watched and stats on time watched per user<\/li>\n<li>Limit output per user or exclude users<\/li>\n<\/ul>\n<h3>Perl Requirements<\/h3>\n<ul>\n<li>LWP::UserAgent<\/li>\n<li>XML::Simple<\/li>\n<li>DBI<\/li>\n<li>Time::Duration;<\/li>\n<li>Time::ParseDate;<\/li>\n<li>JSON<\/li>\n<\/ul>\n<h3>Install<\/h3>\n<p>Download plexWatch.pl and config.pl-dist to \/opt\/plexWatch\/<\/p>\n<ul>\n<li>WGET<\/li>\n<\/ul>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">sudo wget -P \/opt\/plexWatch\/ https:\/\/raw.github.com\/ljunkie\/plexWatch\/master\/plexWatch.pl<\/code><\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">sudo wget -P \/opt\/plexWatch\/ https:\/\/raw.github.com\/ljunkie\/plexWatch\/master\/config.pl-dist<\/code><\/p>\n<p>&nbsp;<\/p>\n<ul>\n<li>CURL<\/li>\n<\/ul>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">sudo mkdir -p \/opt\/plexWatch\/<\/code><\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">sudo curl https:\/\/raw.github.com\/ljunkie\/plexWatch\/master\/plexWatch.pl -o \/opt\/plexWatch\/plexWatch.pl<\/code><\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">sudo curl https:\/\/raw.github.com\/ljunkie\/plexWatch\/master\/config.pl-dist -o \/opt\/plexWatch\/config.pl-dist<\/code><\/p>\n<p>Now lets change the Permission of the files<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">sudo chmod 777 \/opt\/plexWatch &amp;&amp; sudo chmod 755 \/opt\/plexWatch\/plexWatch.pl<\/code><\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">sudo cp \/opt\/plexWatch\/config.pl-dist \/opt\/plexWatch\/config.pl<\/code><\/p>\n<p>Lets edit the PlexWatch configuration file<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">sudo nano \/opt\/plexWatch\/config.pl<\/code><\/p>\n<p>&nbsp;<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">$server = 'localhost';   ## IP of PMS - or localhost\r\n$port   = 32400;         ## port of PMS\r\n$notify_started = 1;   ## notify when a stream is started (first play)\r\n$notify_stopped = 1;   ## notify when a stream is stopped<\/pre>\n<p>&nbsp;<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">$notify = {...\r\n* to enable a provider, i.e. file, prowl, pushover\r\nset 'enabled' =&gt; 1, under selected provider\r\n* Prowl     : 'apikey' required\r\n* Pushover  : 'token' and 'user' required\r\n* Growl     : 'script' required :: GrowlNotify from http:\/\/growl.info\/downloads (GNTP replaces this)\r\n* twitter   : 'consumer_key', 'consumer_secret', 'access_token', 'access_token_secret' required\r\n* boxcar    : 'email' required\r\n* pushover  : 'apikey' and 'device' required\r\n* GNTP      : 'server', 'port' required. 'password' optional. You must allow network notifications on the Growl Server<\/pre>\n<p>Now lets install some of the&nbsp;perl requirements<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">sudo apt-get install libwww-perl libxml-simple-perl libtime-duration-perl libtime-modules-perl libdbd-sqlite3-perl perl-doc libjson-perl<\/code><\/p>\n<p><strong>run<\/strong> the script manually to verify it works: \/opt\/plexWatch\/plexWatch.pl<\/p>\n<ul>\n<li><strong>start video(s)<\/strong><\/li>\n<li><code>\/opt\/plexWatch\/plexWatch.pl<\/code><\/li>\n<li><strong>stop video(s)<\/strong><\/li>\n<li><code>\/opt\/plexWatch\/plexWatch.pl<\/code><\/li>\n<\/ul>\n<p>setup crontab to run the script every minute<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">sudo nano \/etc\/crontab<\/code><\/p>\n<p>lets add<\/p>\n<p><code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">* * * * * YOUR_USERNAME \/opt\/plexWatch\/plexWatch.pl<\/code><\/p>\n<p>Now its setup and ready to go, now lets add some notifications<\/p>\n<p><strong>Supported Push Notifications<\/strong><\/p>\n<ul>\n<li>Email<\/li>\n<li><a href=\"https:\/\/pushover.net\/\">https:\/\/pushover.net<\/a><\/li>\n<li><a href=\"https:\/\/prowlapp.com\/\">https:\/\/prowlapp.com<\/a><\/li>\n<li><a href=\"http:\/\/growl.info\/\">http:\/\/growl.info\/<\/a> (via GrowlNotify @ <a href=\"http:\/\/growl.info\/downloads#generaldownloads\">http:\/\/growl.info\/downloads#generaldownloads<\/a>)<\/li>\n<li><a href=\"https:\/\/twitter.com\/\">https:\/\/twitter.com\/<\/a> (create a new app @ <a href=\"https:\/\/dev.twitter.com\/apps\">https:\/\/dev.twitter.com\/apps<\/a>)<\/li>\n<li><a href=\"https:\/\/boxcar.io\/\">https:\/\/boxcar.io\/<\/a> &amp; boxcar V2<\/li>\n<li><a href=\"https:\/\/pushbullet.com\/\">https:\/\/pushbullet.com<\/a><\/li>\n<li>SNARL\/GROWL: GNTP notifications supported. Anything that uses GNTP <em>should<\/em> work<\/li>\n<li>External Scripts: home automation, pause download clients, etc (rudimentary plugins)<\/li>\n<\/ul>\n<h4>Twitter setup<\/h4>\n<ul>\n<li>create a new app @ <a href=\"https:\/\/dev.twitter.com\/apps\">https:\/\/dev.twitter.com\/apps<\/a><\/li>\n<li>click &#8220;Create New App&#8221;\n<ul>\n<li>Name: unique name for for your app<\/li>\n<li>Description: fill something in&#8230;<\/li>\n<li>Website: you need some valid website..<\/li>\n<li>(read) and accept terms<\/li>\n<li>click &#8220;Create you Twitter Application&#8221;<\/li>\n<\/ul>\n<\/li>\n<li>click &#8220;Modify app permission&#8221; under the Details Tab\n<ul>\n<li>change to Read and Write<\/li>\n<li>update settings<\/li>\n<\/ul>\n<\/li>\n<li>click the &#8220;API keys&#8221; tab\n<ul>\n<li>click &#8220;create my access token&#8221;<\/li>\n<li>click &#8220;Test OAuth&#8221; button to view the required API keys need for config.pl<\/li>\n<\/ul>\n<\/li>\n<li>Edit the config.pl\n<ul>\n<li>enable notification for twitter in config.pl<\/li>\n<li>enter in the required keys, secrets and tokens<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This guide will show you how to install and configure plex watch, Plex watch will&nbsp;Notify and Log &#8216;Now Playing&#8217; and<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":true,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[85],"tags":[12,31,10,35,2,33,11,5,13,14,9,8,34,7,32],"class_list":["post-50","post","type-post","status-publish","format-standard","hentry","category-tech-tip","tag-create","tag-debian","tag-install","tag-notifications","tag-plex","tag-plexwatch","tag-setup","tag-ssh","tag-start","tag-stop","tag-tahr","tag-trusty","tag-twitter","tag-ubuntu","tag-watch"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":false,"jetpack_shortlink":"https:\/\/wp.me\/p7oBs4-O","jetpack-related-posts":[],"jetpack_likes_enabled":true,"_links":{"self":[{"href":"https:\/\/pure-media.info\/index.php\/wp-json\/wp\/v2\/posts\/50","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pure-media.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pure-media.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pure-media.info\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/pure-media.info\/index.php\/wp-json\/wp\/v2\/comments?post=50"}],"version-history":[{"count":0,"href":"https:\/\/pure-media.info\/index.php\/wp-json\/wp\/v2\/posts\/50\/revisions"}],"wp:attachment":[{"href":"https:\/\/pure-media.info\/index.php\/wp-json\/wp\/v2\/media?parent=50"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pure-media.info\/index.php\/wp-json\/wp\/v2\/categories?post=50"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pure-media.info\/index.php\/wp-json\/wp\/v2\/tags?post=50"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}