This code is no longer maintained and probably no longer of any value. It was written for an older version of Unhangout that is no longer maintained.
A script using selenium to collect URLs to Google Hangouts.
WARNING: URLs farmed using this strategy do not appear to be robust against Google Apps (organizational/business) accounts. If the first user to join one of these hangouts uses a google account associated with an organization, the hangout may be limited to participants who are also from that organization.
IMPORTANT: Generated URLs must be manually inserted into the Unhangout database, and the Unhangout server restarted in order for the URLs to be available to the installation.
-
Clone the repository.
git clone https://github.com/unhangout/hangout-farmer.git -
Install dependencies
npm install -
Make sure Java JDK is installed.
Clone this repository. Copy conf.js.example to conf.js, and edit the file to include your configuration. Required parameters are:
googleEmail: Email address for a valid google account to use to create the links.googlePassword: Password for that google account.startingUrl: A seed URL to use for creating the links. The easiest way to get this is to create a calendar event with a video link, and to copy that link. An example link:https://plus.google.com/hangouts/_/calendar/dW5oYW5nb3V0ZGV2QGdtYWlsLmNvbQ.scpgoeq5iatpuei1edil98trsc?authuser=0
Change these optional parameters if you like:
count: The number of links to collect.firefoxBin: Path to a specific firefox binary to use. The firefox binary must have access to the google talk plugin.seleniumJar: Path to a selenium standalone server jar to use. It will be downloaded on first run if not found.seleniumPort: Port to which selenium standalone server should bind.seleniumVerboseLogging: set totrueto enable verbose logging of the selenium process.seleniumJarVersion: The version of the selenium standalone server jar to download if not present.
Once installed and configured, run with ./index.js. Hangout URLs will be printed to standard output.
Start by installing:
npm install https://github.com/unhangout/hangout-farmer.git
Functions:
-
farmUrls(options, urlCallback, doneCallback): Farm urls from Google Hangout. Arguments:options: An object containing options as described above.urlCallback: A function that will be called with each URL or URL retrieval error. Should take(err, url)as arguments.doneCallback: Optional, a function that will be called when done with all URLs.
-
buildDriver(options): Build a selenium webdriver instance. Arguments:options: An objct containing options as described above.- returns a Promise which resolves with the ready to use webdriver instance.
Example use:
#!/usr/bin/env
"use strict";
const farmer = require("hangout-farmer");
const options = {
googleEmail: "example@gmail.com",
googlePassword: "seekrit",
startingUrl: "https://plus.google.com/hangouts/_/dW5oYW5nb3V0ZGV2QGdtYWlsLmNvbQ.h9ugsdd1nafsmsp53ii1rkmlas?authuser=0"
};
farmer.farmUrls(options, function(err, url) {
if (err) {
console.error(err);
} else {
console.log(url);
}
}, function() {
console.error("All done!");
});