Tuesday, May 28, 2024
24
rated 0 times [  30] [ 6]  / answers: 1 / hits: 18476  / 13 Years ago, fri, june 17, 2011, 12:00:00

I have captured list of data from the page using Greasemonkey.



GM Script



var hit = GM_getValue(hit) || 0;
var _url = http://localhost:8080/test?p=$$pageNo$$;
_url = _url.replace($$pageNo$$, hit);
GM_setValue(hit, ++hit);
if(hit <= 100) {
window.location.href = _url;
}


This script will runs for nth time and capture <10K data, now i facing the issue in storing the captured data in some file.
Anyone has any idea about how we can store the captured data into file/repo?



Thanks
- Viswanathan G


More From » greasemonkey

 Answers
27

Nope, can't write it to a file, but if you're really bored, you can post it to http://pastebin.com (or any other URL that accepts a POST request with a bunch of data).



GM_xmlhttpRequest({
method: POST,
url: http://pastebin.com/post.php,
data: <your data here>,
headers: {
Content-Type: application/x-www-form-urlencoded
},
onload: function(response) {
alert(posted);
}
});


Note you need to have a pastebin account to use the API.






If you really need to write a file to your local filesystem, run a web server on your desktop, and then save the results of an http PUT request to disk.


[#91650] Thursday, June 16, 2011, 13 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
frederickmohamedw

Total Points: 21
Total Questions: 123
Total Answers: 105

Location: The Bahamas
Member since Tue, Apr 27, 2021
3 Years ago
frederickmohamedw questions
Wed, Sep 23, 20, 00:00, 4 Years ago
Sat, Jul 18, 20, 00:00, 4 Years ago
Sun, Apr 26, 20, 00:00, 4 Years ago
Sat, Jan 11, 20, 00:00, 4 Years ago
Fri, Dec 27, 19, 00:00, 5 Years ago
;