Extensions inspire

Google Hangout Keep Online

4

Details

Author:
Dmitry Koterov

Category:
Social & Communication

Version:
1.5.1

Users:
1,000+

Rating:
4

Size:
37.56KiB

Price:
Free

Updated:
May 05, 2013

Webstore Link:
https://chrome.google.com/webstore/detail/google-hangout-keep-onlin/gmknbicinclmgcjpehlboidgjjhiepih

Developer's site:
http://en.dklab.ru

Download

version 1.5.1  - Download ZIP file

Description

This script is for you if you want to set up an always-on camera+monitor in your office to keep in touch with your colleagues when your are out of the office.

Features:
1. Auto-joins a Google Hangout session when somebody refreshes the page by accident.
2. Automatically presses “I am not sleeping” time to time.
3. Allows you to have a permanent URL for your hangout, even if it is reloaded and its link is changed.

ATTENTION: requires English Google Hangout localization! Does not work for any other language except English. To turn on English, you should: 1) specify English as a default language in your Google account, 2) specify English as a first-priority language in your browser (for Chrome: Menu – Settings – Show advanced settings… – Languages, move English list item at the 1st place).

If you want to make a constant link for your hangout (bound to your browser), even after the hangout is reloaded and its Google link is changed, you may place the following PHP script somewhere to your web-server (e.g. to /google_hangout_keep_online.php) and specify its URL with “Change permalink” button. This script is a simple URL shortener which also allows to modify existed short URLs to keep them permanent.

<?php
// Program entry point.
function main()
{
ini_set('html_errors', false);
ini_set('display_errors', true);
$file = session_save_path() . "/google_hangout_keep_online.csv";

$f = @fopen($file, "a+");
if (!$f) {
throw new Exception("Cannot open $file for writing: " . last_error());
}

$f = @fopen($file, "r+");
if (!$f) {
throw new Exception("Cannot open $file for reading and writing: " . last_error());
}
flock($f, LOCK_EX);

$map = array();
foreach (explode("\n", stream_get_contents($f)) as $line) {
@list ($k, $v) = explode("=", $line);
if (!strlen($k) || !strlen($v)) continue;
$map[trim($k)] = trim($v);
}

$alias = trim(get_param('alias'));
if (strlen($alias) < 8) {
throw new Exception("Alias is too short.");
}

$url = get_param('url', null);
if ($url) {
$map[$alias] = $url;
fseek($f, 0, SEEK_SET);
ftruncate($f, 0);
foreach ($map as $k => $v) {
fwrite($f, "$k = $v\n");
}
flock($f, LOCK_UN);
fclose($f);
$url = '//'
. $_SERVER['HTTP_HOST']
. preg_replace('/\?.*/s', '', $_SERVER['REQUEST_URI'])
. '?alias=' . urlencode($alias);
echo '<!DOCTYPE html>'
. '<a target="_blank" '
. 'style="white-space:nowrap; font-family:Arial; font-size:14px" '
. 'href="' . htmlspecialchars($url) . '">'
. 'Permanent link to this hangout'
. '</a>'
. '<!-- The database is in session directory, so refresh ourself to avoid PHP session expiration. -->'
. '<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.0/jquery.min.js"></script>'
. '<script type="text/javascript">setInterval(function() { $.get(location.href) }, 600000)</script>';
} else {
flock($f, LOCK_UN);
fclose($f);
if (!isset($map[$alias])) {
throw new Exception("Cannot find the alias '" . $alias . "' to redirect to.");
}
header("Location: " . $map[$alias]);
exit();
}
}

// Returns the last PHP error message.
function last_error()
{
$e = error_get_last();
if ($e) {
return $e['message'];
} else {
return null;
}
}

// Returns GET parameter.
function get_param($name, $default = false)
{
$value = @$_GET[$name];
if ($value === null) {
if ($default !== false) {
$value = $default;
} else {
throw new Exception("Parameter missing: $name");
}
}
return $value;
}

// Call the main program.
try {
main();
} catch (Exception $e) {
echo $e->getMessage();
}

Top Extensions

 
(10943)
 
(50577)
 
(98995)
 
(25231)
 
(8324)
 
(1434)
 
(11367)

What has inspired us?

Extore is a team of professionals who are passionate about creating extensions for web browsers. This devotion also gives us opportunity to appreciate work of other people. We get inspired by useful, open source extensions made by developers all over the world. Our strong belief is that one should share helpful add-ons with others. That’s why we’d like to present you our ever-growing list of favourite extensions that have inspired us. Moreover, as you probably have already learned, sometimes struggling for the best brings an end to the good. Talking about add-ons it often turns out that an upgrade is worse then previous version. Also it can become really tricky to get back to the beloved version of your favourite extension. That’s why we’re going to make not only the latest, but all versions of our favourite (and we hope yours too) add-ons available for download. No more compromises, just stick to the version you really like!