Launch a recording application using greasemonkey

I have my greasemonkey script scan every page that I visit for a specific line. I would like to write row changes in sqlite db. After a while, I will have a different application process. What I do not know HOW do I store data in sqlite db? I thought I could run the executable automatically if the string was found, but I do not know how to do it with javascript. Another alternative, I thought the socket is listening on a specific port and has some js magic, but I could not think of a silent way to send such data.

+5
source share
5 answers

I'm not sure how you can use it with Greasemonkey, but Firefox has an API called Storage to use the sqlite database. Take a look here: https://developer.mozilla.org/en/Storage

+1
source

I recommend using a web server to collect data. You can configure a domain or IP to send data. For starters, you can even run on a local host if you need to.

The advantage is that after creation, the same architecture can be used from different PCs, so that any computer on which you run the script can share the results.

Update: , GM_xmlhttpRequest. , , GM_xmlhttpRequest: Speakeasy.js. ActiveResource , - RESTful. Greasemonkey script, - . .

, :

// ==UserScript==
// @name           Demo Script
// @namespace      http://example.com
// @description    Sample
// @include        *
//
// @require     http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js
// @require     http://strd6.googlecode.com/svn/trunk/gm_util/d_money.js
// @require     http://strd6.googlecode.com/svn/trunk/gm_util/speakeasy.js
//
// ==/UserScript==


error = D$.error;
log = D$.log;
D$.debug(false);


Speakeasy
  .generateResource('result')
  .configure({
    baseUrl: 'http://localhost:3000/'
  })
;


// Attach all annotations for this page from remote server
var href = window.location.href;
currentUrl = href.substring(href.indexOf('://') + 3);
log(currentUrl);

var result1 = 'something'; // Insert your function to get your result data
var result2 = 'something else'; // Insert your function to get your result data

Speakeasy.result.create({
  data: {
    url: currentUrl, 
    result1: result1, 
    result2: result2
  }
});

Rails , .

+3

Google Gears, SQLite .

+2

LubeMonkey, Greasemonkey sqlite. script SQL- db, .. db, db . http://www.gamecore.org

+1

greasemonkey script URL- ( , ). ajax. - .

, WAMP -. , php_sqlite.

This may help you with some implementation features: http://www.pathf.com/blogs/2006/07/bjax_with_greas/

0
source

All Articles