GithubHelp home page GithubHelp logo

neuralnoise / webscriptrs Goto Github PK

View Code? Open in Web Editor NEW

This project forked from retroshare/webscriptrs

0.0 2.0 0.0 1.73 MB

A Retroshare bridge to internal webkit/python and JSON-RPC

C++ 2.84% QMake 0.16% Shell 0.02% Python 3.44% HTML 6.85% CSS 0.84% JavaScript 85.84%

webscriptrs's Introduction

Scripting/IPC Plugin for RetroShare

###Overview This plugin attempts to make it easy to write scripts or external programs than can interact with retroshare-gui by providing a bridge to Retroshare via the following transports:

Some of the functions provided include:

  • broadcast to compatable peers
  • send targeted messages
  • search indexed files
  • turtle file search
  • download from hash+size+name
  • handle retroshare:// links (if the link is not downloaded, it opens in a tab)
  • get Peer/online/channel/forumList
  • peer details/avatar
  • download any url
  • open new tabs
  • Lots more

Examples include:

  • geographical peer map (pyqt)
  • global peer map (python dump, d3.js view)
  • car driving test - ported from ivanks keyboard demo, players broadcast positions
  • 3d broadcast/wall chat - draggable text nodes. Shift+mouse moves camera
  • external python via JSON-RPC
  • file search
  • packet inspection on index
  • broadcast chat
  • direct chat
  • simple distributed p2p physics tests
  • local storage notepad - uses html5 persistant storage and editable tags (plus a source editor)
  • Live MicroBlogging. only Friends see your messages, and friends of a friend whose message you comment on(buggy)
  • Lots more

Warning Included tests do not sanitise HTML. The JS has not been written with security in mind.

My image My image My image My image My image My image

Warning Watch your cpu and network usage when running the physics/shared drawing tests.
Should be fine.

Usage:

###PreReq:

sudo apt-get install libpython-dev libpython-all-dev sudo apt-get install python-dev #use this lines instead of above on older systems sudo apt-get install python-qt4

if you want to run the Geo Friend Map Test: sudo apt-get install python-mpltoolkits.basemap sudo pip install pygeoip

###Build/Install ##PreReq You will need a linux machine

  apt-get install python-dev python-qt4

is a good start,

  apt-get install python-mpltoolkits.basemap 

Will let you run the geoip peermap demo
please let me know if you need to install anything else to make it run. ##compile you probably want to clone this into the plugins directory of your retroshare source code.

  cd myretrosharesrc/plugins/  
  git clone https://github.com/chozabu/WebScriptRS.git  
cd WebScriptRS 

At this point you can run the initalbuild.sh script or:

  git clone https://bitbucket.org/devonit/qjsonrpc.git  
  cd qjsonrpc/src/  
  qmake-qt4 QJSONRPC_LIBRARY_TYPE=staticlib; make  
  cd ..  
  qmake-qt4; make  

###install/run copy the .so files to your .retroshare/extensions/ directory
run RetroShare from the plugins directory!
install/run can be acomplished by running the script ctestit.sh

###JS Bridge

There is not much documentation yet - but there are examples, and you can look at webbridgers.h
currently you can send a message like this:

var packetdata = {"type":"chatmessage","pos":"thiscouldbeanything"};  
bridge.broadcastMessage(JSON.stringify(packetdata)); 

or directly like this:

var packetdata = {"x":3,"y":5,"name":"Eric"};  
bridge.sendMessage(peer_id_as_string, JSON.stringify(packetdata)); 

And get one like this:

bridge.msgPush.connect(incomingMsg);  
function incomingMsg(message){  
  var packetdata = JSON.parse(message.message);  
  var peer_id_as_string = message.peerID;  
  var name = message.peerName;  
}

webscriptrs's People

Contributors

chozabu avatar fealum avatar

Watchers

James Cloos avatar Starbuck 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.