Code Monkey home page Code Monkey logo

omegle's Introduction

Omegle for node

Quickstart

Take a look in the tests/ folder for more bulked out (and useful) examples.

Installion:

npm install omegle

Script:

Omegle = require('omegle').Omegle;

// This creates the instance.
// By default it searchs for English speaking strangers,
// see "Further Asides" for changing the language
var om = new Omegle();

// This starts a new conversation
om.start(function(err){
  if(err)
    console.log(err);
});

// Omegle extends the standard EventEmitter class so just use the  on  function to subscribe to them
// See below for full list
om.on('disconnected', function(){
  om.start();
});

// Show you are typing/not typing (optional callback  function(err){}  when request completes)
om.startTyping([callback]);
om.stopTyping([callback]);

// Disconnect from current chat (callback as above)
om.disconnect([callback]);

Events list

These events are emitted, some with arguments:

waiting
connected
gotMessage
strangerDisconnected
typing
stoppedTyping
recaptchaRequired
recaptchaRejected
statusInfo
spyMessage
spyTyping
spyStoppedTyping
spyDisconnected
question
suggestSpyee
antinudeBanned
error

Untrue to its name, antinudeBanned does not necessarily mean you where banned for nudity. You will also get this response if your IP is banned because you used omegle to advertise or if you made connections too rapidly.

Captcha

Sadly, omegle has captchas. The recaptchaRequired event can be used to solve these by using a human (no, npm install human does not work here) or possibly making many new connections until a captcha is not required. This library was never intended to be used for say spamming or making automated bots, but more so that humans can interface with omegle without being on the site. So the odd captcha should not be too much of a problem provided you present the catpcha to the user and get them to input the result.

Further Asides

You can change the language you want to speak (by default English), user agent string, host to connect to and whetever you are mobile or not by using the constructor or by accessing the object:

var om = new Omegle('user agent string', 'host', 'two-letter language code', 'mobile true/false');

om.userAgent = 'blah';
om.host = 'foo.omegle.com';
om.language = 'fr';
om.mobile = true;

omegle's People

Contributors

boltgolt avatar crogers avatar alexbinary avatar janil avatar zachlatta avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.