<?php
- require_once($_SERVER['DOCUMENT_ROOT'] . "/2015/assets/js/tweetie/api/twitteroauth/twitteroauth.php"); // Path to twitteroauth library
- require_once($_SERVER['DOCUMENT_ROOT'] . '/2015/assets/js/tweetie/api/config.php'); // Path to config file
+
+if (strpos($_SERVER['SERVER_NAME'], 'localhost')) {
+ $abs_path = $_SERVER['DOCUMENT_ROOT'];
+}else {
+ $abs_path = '/var/www/static';
+}
+
+require_once($abs_path . "/2015/assets/js/tweetie/api/twitteroauth/twitteroauth.php"); // Path to twitteroauth library
+require_once($abs_path . '/2015/assets/js/tweetie/api/config.php'); // Path to config file
// Check if keys are in place
if (CONSUMER_KEY === '' || CONSUMER_SECRET === '' || CONSUMER_KEY === 'CONSUMER_KEY_HERE' || CONSUMER_SECRET === 'CONSUMER_SECRET_HERE') {
*/
/* Load OAuth lib. You can find it at http://oauth.net */
-require_once($_SERVER['DOCUMENT_ROOT'] . '/2015/assets/js/tweetie/api/twitteroauth/OAuth.php');
+
+if (strpos($_SERVER['SERVER_NAME'], 'localhost')) {
+ $abs_path = $_SERVER['DOCUMENT_ROOT'];
+}else {
+ $abs_path = '/var/www/static';
+}
+
+require_once($abs_path . '/2015/assets/js/tweetie/api/twitteroauth/OAuth.php');
/**
* Twitter OAuth class