I suggest you ...

Firefox addon

An addon for firefox similar to the bookmark star on the address-bar that when visiting IMDB indicates if you have the movie and allows to add new movies from there, just like bookmarks.

1 vote
Vote
Sign in
Check!
(thinking…)
Reset
or sign in with
  • facebook
  • google
    Password icon
    I agree to the terms of service
    Signed in as (Sign out)
    You have left! (?) (thinking…)
    YuzemAdminYuzem (Admin, figuritas) shared this idea  ·   ·  Admin →

    15 comments

    Sign in
    Check!
    (thinking…)
    Reset
    or sign in with
    • facebook
    • google
      Password icon
      I agree to the terms of service
      Signed in as (Sign out)
      Submitting...
      • Andrea FerrettiAndrea Ferretti commented  · 

        I'm sending you a private message on Ubuntuforums with my email. It will be easier to communicate.

      • YuzemAdminYuzem (Admin, figuritas) commented  · 

        "I have done all items I mentioned yesterday"

        Looking good so far... :)

        "I confess I have no clue what the other add-on is"

        Now I remember, it was a test for an addon that I made some time ago.
        It wasn't because of that addon that it didn't work, after installed the new version it happen again. The addon didn't work until the second restart.

        "I don't know how to figure out whether the user has a file to play for the movie."

        You can use this:
        host:port?module=movies&tab=view&op=and|movies|tt0133093&limit=1

        This will return html code, I don't know how hard it is to do the following without jquery: you would have to search for 'li#tt0133093' if found then you have the movie, then search for 'div#play' to see if you can play it.

        To play the movie:
        host:port?module=movies&action=play&Id=tt0133093

        "The second is that it seems to me that it would clutter things a bit"

        I have been thinking about this. Having add/remove icons indicate actions instead of status, In my opinion, it is better to display status, it is consistent with the other url-bar icons like the bookmark star or the rss icon.

        Also, the add/remove icons gives no visual feedback of the actions context, add to what? remove to what? On first sight the remove icon looks like something went wrong, maybe because of the usual status interpretation for those icons.

        If you use the figuritas's icon then you have status feedback first and the context of the action that could be triggered when clicking on it, and since it is the same behaviour than the star bookmark icon, it is easy to figure it out.

        Sorry to insist but of-course, you have the final decision on this, since you are writing it.

        One more thing, I believe that ideally, it would be better to show an additional icon if the movie is playable. That would give instant visual feedback about the status of the movie so you immediately see if you have the movie in your disk.

        Feel free to criticize everything I said.

      • Andrea FerrettiAndrea Ferretti commented  · 

        Ok, at the same address you find the new version 0.2. I have done all items I mentioned yesterday (except for 8, which makes no sense now that there is a "loading" icon) and I have also fixed one bug that I have found today.

        I confess I have no clue what the other add-on is, it certainly not appears for me! I did not even think it was possible to add two add-ons with a single xpi... I hope now it does not appear anymore.

        I have not yet implemented your idea, for two reasons. The first is that I need the backend to support this: for instance I don't know how to figure out whether the user has a file to play for the movie. The second is that it seems to me that it would clutter things a bit. We may try both ways and decide.

        I don't see the need to play a movie from the IMDB page, but I guess other things could be done from a menu in the future. Opening the movie in Figuritas, instead, is nice.

        My proposal is the following (for now). In the urlbar we put the icons to add and remove films. The big icon in the status bar (which now opens Figuritas) could open the current movie in Figuritas if the user is on a IMDB page (and open Figuritas as usual on the other pages).

        Let me know what you think!

      • YuzemAdminYuzem (Admin, figuritas) commented  · 

        Ok, great job!
        It didn't work at first try, it seems that two addons got installed, one named Figuritas 0.0.1 that shows an icon, the other has no icon an shows a different version, something like 0.1 I'm not sure.
        I removed the last one and everything worked fine.

        "2) Add some more visual feedback after adding or removing"

        Maybe you can change the icon to:
        /usr/share/figuritas/web/theme/loading.png
        ...after adding or removing and wait for a response to set the correct icon.

        "Here is my list, if you have something to add, please tell me."

        Only one thing, instead of displaying the remove icon if you have the movie display the same icon from the toolbar in 16x16, when clicking on it pop a menu with the item to remove the movie, this will make it possible to add more things like "play" or open in figuritas, etc... more ala star-bookmark icon.
        Then it will make more sense to have the same icon faded out if you don't have the movie.

        Maybe when the addon checks if you have the movie, figuritas could respond sending the additional menu entries...

      • Andrea FerrettiAndrea Ferretti commented  · 

        Ok, I have a rather primitive version working. You can find it on

        http://www.andreaferretti.it/files/figuritas.xpi

        There are a lot of things that can be improved, but I'll leave those for tomorrow. Here is my list, if you have something to add, please tell me.

        1) Add a confirmation message before removing
        2) Add some more visual feedback after adding or removing
        3) Launch Figuritas automatically if it is not in execution
        4) Adjust size and labels of Preferences window
        5) Make an About window
        6) Change the icons in the urlbar. Right now I'm using the system ones, but I don't think they are recognizable enough. I would like to use the green icon with a + which appears in Figuritas. For that I would need a 16x16 version of that icon and a matching icon for remove.
        7) Add tooltips
        8) Add a fading effect when changing icon
        9) Add italian localization
        10) Polish source to remove code duplication

        Finally, note that I have added a Figuritas button that you can add to the Navigation or Bookmarks toolbar. By clicking on it, you can open Figuritas.

      • YuzemAdminYuzem (Admin, figuritas) commented  · 

        Ok, for the check action you can add the following:
        action_search ()
        {
        sqlite "SELECT $Class FROM $Class WHERE $Class='$Id'"
        }

        to this file:
        /usr/share/figuritas/modules/movies.actions

        Use it like this:
        host:port?module=movies&Class=movies&Id=imdbID&action=search

        About ajax, I think you need to use XMLHTTPRequest:
        http://www.w3schools.com/XML/xml_http.asp

      • Andrea FerrettiAndrea Ferretti commented  · 

        I have started writing it. There is not really the need to change your URL scheme (apart from adding a 'check' action). I have added the possibility of managing different modules anyway, so adding youtube, deviantart and so on should be easy.

        I now need to figure out how to work with Ajax requests without jQuery... for some reason, adding jQuery creates me some problems, although some people report having used it in extensions.

      • YuzemAdminYuzem (Admin, figuritas) commented  · 

        "The above URL are fine, as long they will not change. For instance I see that one action is add2, which makes me think that there was an add1 action."

        Yes, there is an add action that is the main action called every time a movie is added, add2 is for the web but I probably should make add for the web and rename the main action used inside figuritas.

        I think it would be better something like this:
        host:port?action=urlAdd&url=http:etc
        host:port?action=urlRemove&url=http:etc
        host:port?action=urlCheck&url=http:etc

        The reason for this is that it would be easier to expand it, for example to support youtube for the videos module or deviantart for the pictures module.

        "I also need to know what kind of response I get from the above URLs"
        action=remove doesn't provide any, action=add gives no response if the movie gets added and an error message if not.

        "Let me just agree with you exactly what the extension is supposed to do. Is the following ok?"

        1 ) ok but also the /title/ section
        2 ) ok
        3 ) ok but ask for confirmation before removing. The icons in the gtk theme are:
        moz-icon://stock/remove?size=16
        moz-icon://stock/add?size=16
        ...but maybe it is better to use: http://host:port/web/icons/favicon.ico
        If you don't have the movie give it some transparency.
        4 ) ok
        5 ) ok

      • Andrea FerrettiAndrea Ferretti commented  · 

        The above URL are fine, as long they will not change. For instance I see that one action is add2, which makes me think that there was an add1 action.

        I also need to know what kind of response I get from the above URLs, both in case of success and failure. I can figure out easily (not now, because I don't have figuritas here), but it is better if you tell me, since there may be something which I overlook.

        Let me just agree with you exactly what the extension is supposed to do. Is the following ok?

        1) On every page load, it checks whether the URL belongs to imdb.
        2) If it is, it calls a (not yet implemented) figuritas URL to check whether the movie is in the database.
        3) Accordingly, it display either an 'add' or 'remove' icon in the URLbar, near the star. These icons will be the same used in figuritas (does a 'remove' icon exist?)
        4) On a click of the icon, it calls the corresponding action of figuritas.
        5) It gives some kind of feedback to the user. I was thinking of the following: if everything goes ok, change the icon in the URLbar. If a problem arises, raise an error message, or a notification.

      • YuzemAdminYuzem (Admin, figuritas) commented  · 

        "There should be an API which is guaranteed to be stable though. What URL should I access to make requests for adding or deleting movies?"

        I will implement it then so it is possible to pass the full URL
        Right now it is something like this:
        Add:
        host:port?module=movies&Class=movies&Id=tt1375666&action=add2
        Remove:
        host:port?module=movies&Class=movies&Id=tt1375666&action=remove

        Let me know if you have any suggestion.

      • Andrea FerrettiAndrea Ferretti commented  · 

        "Oh, so you will access figuritas directly, I thought about accessing it from the web server (localhost:9009) but ok, maybe thats better."

        I actually did not think of it, but accessing from the web server is maybe more reasonable, as in a firefox extension it is easier to manage AJAX requests than external applications.

        There should be an API which is guaranteed to be stable though. What URL should I access to make requests for adding or deleting movies?

      • YuzemAdminYuzem (Admin, figuritas) commented  · 

        "Anyway for now I can only add movies, as I cannot find the way to remove movies from the command line."

        Oh, so you will access figuritas directly, I thought about accessing it from the web server (localhost:9009) but ok, maybe thats better.
        Then I will add an -r flag to remove movies.

        "You mean to use the check action to display a different icon (e.g. greyed out), right?"

        Exactly, grayed out if you don't have the movie

        "Finally it is not a problem to extract the imdb id from the URL"
        But if you are accessing figuritas from the command line then you can already use the full URL.

        Then the commands will be:
        figuritas movies -a URL (working)
        figuritas movies -r URL (nor implemented)
        figuritas movies -s URL (missing support for URLs)

      • Andrea FerrettiAndrea Ferretti commented  · 

        It seems feasible, I will try in the next days. Anyway for now I can only add movies, as I cannot find the way to remove movies from the command line.

        You mean to use the check action to display a different icon (e.g. greyed out), right? Because adding a movie twice works as expected, i.e. the second time nothing happens.

        Finally it is not a problem to extract the imdb id from the URL. The only advantage I can see in letting figuritas handle this is overriding the language defaults. For instance I use the italian language by default, but maybe when browsing the english site I would like to add movies in english.

      • YuzemAdminYuzem (Admin, figuritas) commented  · 

        That would be great.
        I think that I need to implement three actions in figuritas: add, remove and check imdb urls.
        There is already a way to add/remove movies but it requires the id alone, maybe it is easy to pass the url and let figuritas handle the rest.

        For example:
        If the url is from *imdb.*/title/ then display the icon next to the star bookmark icon and send a request to figuritas to check if you have the movie. Depending on the response allow to add/remove the movie.

        Let me know if you need anything else.

      • Andrea FerrettiAndrea Ferretti commented  · 

        Wonderful idea! I have started learning how to make Firefox extensions, so if you are interested, I may develop this.

        Nonno Bassotto

      Feedback and Knowledge Base