Recent posts by Mortimer

Subscribe to Recent posts by Mortimer 15 posts found

Aug 14, 2007
Mortimer 15 posts

Topic: Script development / Flickr Hacks Development

Hello all,

I have been wanting to do that for a while and didn't really know how to organise it, but I think I finally found something that will be "easy" for the developers in this group.

Right now, everyone is doing its scripts alone in its corner, but there are sometimes patches, ideas and improvements that could be shared between everyone and we could start share development in a better way that just bits of codes in emails and flickr topics.

For this, I have set up a version control repository where scripts (or whatever else is developed/discussed here) can be developed. There is however a requirement of the host:
- we don't go over 100Mb (which is quite big)
- the content is free software

The public repository is here:
repo.or.cz/w/FlickrHacks.git
Anyone can access and clone it using git or the web interface. If you want to "push" commits to the public repository, contact me and I'll add you to the developer list, or just send me formatted patches by email.

Currently, there is a quite flat structure:
_greasemonkey_/
.... (all the scripts are here)
_greasemonkey_tools_/
.... (toolkits to help develop greasemonkey scripts for flickr)

there could be other categories of development, we'll see.

(crossposted to flickrhacks group: http://flickr.com/groups/flickrhacks/discuss/72...)

 
Jul 18, 2007
Mortimer 15 posts

Topic: Userscripts.org discussion / Opera support for greasemonkey scripts

Opera supports userscripts (I might say something wrong, but they "introduced" the technology I think) but has a different javascript interpretor than firefox and as LouCypher says doesn't suppose GM APIs. Because of that, many userscripts made for Greasemonkey+Firefox will not be compatible (but you can still try).

For the GM API problem, you can use this: http://userjs.org/scripts/browser/enhancements/... to simulate most of the functions, but it's not perfect (in particular, there is no cross site request possible).

For the missing javascript:
- some array functions are missing and you can add them by making a file in your userscript folder containing the functions given here: http://snippets.dzone.com/posts/show/718 this will augment the compatibility of some GM scripts
- more complex GM scripts, using E4X and javascript 1.7 syntax etc... won't work probably... but often there are solutions to use compatible javascript. Try to fix them, or ask the developer.

 
Jul 10, 2007
Mortimer 15 posts

Topic: Script development / For Loop not waiting for onreadychangestate

The callback of the request is done asynchronously, so it will be called sometime when the result is obtained, and the rest of your loop is executed. Because your client variable is modified in the loop closure, it's value at the time of the call will be wrong...

in your case, there is a simple solution, instead of extracting the state and response from the client var, use the parameter passed to the callback function:

client.onreadystatechange = function (responseDetails) {
if (responseDetails.readyState==4)
{
if (responseDetails.status==200)
{
html = responseDetails.responseText;
//...

In more complex cases, you would need to create a new closure to protect the variables:

for(i=0;i<10>
//do something, prepare a call....
client.onreadystatechange = (function(protectVar) {
return function() {
var html = "the current iteration of the loop is:"+protectVar+" while the loop final was:"+i;
};
})(i);
}

 
Jul 7, 2007
Mortimer 15 posts

Topic: Userscripts.org discussion / Cookie Stealing Scripts

1- find out your Profile directory:
http://gemal.dk/mozilla/profile.html
2- there will be a gm_scripts folder in there with all the installed scripts. You will need to do a search in all files:
3a- if you use windows, not sure what's the best plan for that,
3b- if you are on Linux or OS X, open a Terminal and do:

% cd your_profile_path/gm_scripts
% grep -e "cookie" *.user.js

 
Jul 6, 2007
Mortimer 15 posts

Topic: Ideas and script requests / Fetch a list of my del.icio.us tags?

@undoit, yes it does, at least for me, I have two big list of tags under the postings fields: Your Tags and Your Networks.
When you start typing, you get a list of suggestions extracted from that list of tags/network and if you press tab it completes to the closest suggestion...

I think what Joel means is that if every time you want to post you query for your list of tag, it could be too much queries without much need... so you should cache the results... but that's not your main problem I suppose ;)

 
Jul 5, 2007
Mortimer 15 posts

Topic: Script development / Very simple doubt, I think..

well, how is that checkbox identified? if it has an id or name, it's as simple as:


var check = document.getElementById('my_checkbox');
if(check) check.checked = true;

If it doesn't have an idea, you'll probably need to use xpath or find the closest element with an id (the form?) and go from there...

 
Jul 5, 2007
Mortimer 15 posts

Topic: Ideas and script requests / Fetch a list of my del.icio.us tags?

to get the popular tags for a particular URL, check out: http://userscripts.org/scripts/show/10244
the code is quite straightforward, the fetching is done line 392.

However, I am not sure why you would need that (at least on del.icio.us) as it's a feature they already have... Check out the posting bookmarklet or the del.icio.us firefox extension (well worth installing).

 
Jun 27, 2007
Mortimer 15 posts

Topic: Userscripts.org discussion / Cheating with Tags with del.icio.us

Ok, I was sick of waiting for the tagging system in userscripts.org, so I made a GM script to cheat and get the tags from del.icio.us:
http://userscripts.org/scripts/show/10244

The script just adds in the right column for a script the tags it has on del.icio.us. You can then click on a tag and see on del.icio.us which other pages have similar tags (and the greasemonkey tag...)

Have fun ;)

 
Jun 27, 2007
Mortimer 15 posts

Topic: Script development / how to detect script errors

I use Emacs for script editing and Firebug for the debuging. I think it's very good and it helps a lot to find the errors in the script and debug values of variables (you can dump an object and then explore its content).

I also use it to look at the source of pages. I then use XPather to create XPath for the elements I want.

I sometime use DOM Tool to write dom construction code faster.

 
Jun 27, 2007
Mortimer 15 posts

Topic: Script development / Flcirk Script Localisers Needed

Hello,

I am looking for localisers (Español, Portguese, German, Korean, Traditional Chinese, Italian) for my Flickr scripts. Instructions are here:
http://6v8.gamboni.org/Help-localise-Flickr-scr...

It's quite easy, just log in the translation interface and submit the missing localisations. You can see a report of current localisation levels here:
http://mortimer.rezo.net/trad-lang/trad_bilan.php

If you are a developer of Flickr GM scripts, please have a look at:
http://6v8.gamboni.org/Localising-Flickr-Grease...
and contact me to get your script in the localisation interface.

Cheers,

Pierre

 
Jun 26, 2007
Mortimer 15 posts

Topic: Script development / Multi-language script (do you want to translate?)

Hello,

if you want to help localising some of my Flickr greasemonkey scripts, you can go to the localisation interface I set up:
http://mortimer.rezo.net/trad-lang/trad_lang.php

Thank you in advance.

 
Jun 18, 2007
Mortimer 15 posts

Topic: Script development / where to save a text?

I just found that on the wiki snippets, there is already some code (not mine) to use the global storage:
http://wiki.greasespot.net/Code_snippets#make_a...

 
Jun 18, 2007
Mortimer 15 posts

Topic: Script development / Need translators for Google Image Type script

fr-FR French (from France)

1. Tous les types d'images
2. Figures
3. Actualités ( Actualité )

You're welcome

 
Jun 18, 2007
Mortimer 15 posts

Topic: Userscripts.org discussion / Spam and malware

got spammed here: http://userscripts.org/scripts/show/5464
by: http://userscripts.org/users/29198

 
Jun 18, 2007
Mortimer 15 posts

Topic: Script development / How to make a multi language script

Hi,

I have been trying to do that for Flickr (that just went L10L this week), You can see the small script "library" I did for that:
http://6v8.gamboni.org/Localising-Flickr-Grease...

I'll try to work out how to make that more generic (right now, it get the page language in a Flickr specific way) to use Descriptor way of getting the language.
If you have any idea how to make it better, let me know.