Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
midori:webmedia_now-playing [2015/01/04 16:37] – [Using Shell script] jamesaxl | midori:webmedia_now-playing [2015/01/24 00:47] – [Using Shell script] jamesaxl | ||
---|---|---|---|
Line 4: | Line 4: | ||
===== What is Webmedia now-playing ===== | ===== What is Webmedia now-playing ===== | ||
- | Webmedia now-playing is a midori extension developed for using Dbus, this extension allow users to get the video title that midori play in youtube/ Vimeo/ Dailymention/ | + | Webmedia now-playing is a midori extension developed for using Dbus, this extension allow users to get the video title that midori play in youtube/ Vimeo/ Dailymention/ |
+ | In this Tuto We are going to show you how to use it :-). | ||
===== Using Shell script ===== | ===== Using Shell script ===== | ||
+ | Big thanks to [[https:// | ||
< | < | ||
eval $(dbus-send --session --print-reply --dest=org.midori.mediaHerald / | eval $(dbus-send --session --print-reply --dest=org.midori.mediaHerald / | ||
Line 27: | Line 29: | ||
} | } | ||
') | ') | ||
+ | echo "You are now playing: $VideoTitle - $VideoUri" | ||
</ | </ | ||
- | As you see **mediaHerald** is a Dbus service that extension | + | As you see **mediaHerald** is a Dbus service that our extension |
- | Open a midori tab enter [[https:// | + | Let's do an example you should first open [[https:// |
< | < | ||
- | You are now is now playing: | + | You are now playing: |
</ | </ | ||
+ | Enjoy baby :-D | ||
+ | ===== Some examples ===== | ||
+ | **VALA** | ||
+ | < | ||
+ | [DBus (name = " | ||
+ | interface Demo : Object { | ||
+ | public abstract string video_title {owned get; owned set;} | ||
+ | public abstract string video_uri {owned get; owned set;} | ||
+ | } | ||
+ | void main () { | ||
+ | try { | ||
+ | Demo demo = Bus.get_proxy_sync (BusType.SESSION, | ||
+ | "/ | ||
+ | |||
+ | string title = demo.video_title; | ||
+ | string uri = demo.video_uri; | ||
+ | stdout.printf ("you are playing %s, follow me on %s\n", title, uri); | ||
+ | |||
+ | } catch (IOError e) { | ||
+ | stderr.printf (" | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | **Result: | ||
+ | < | ||
+ | you are playing Midori 0.5.8 : A Fast and Lightweight Web Browser For Linux Mint - YouTube, follow me on https:// | ||
+ | </ | ||
+ | **Python let's make it more short 8-)** | ||
+ | < | ||
+ | import dbus | ||
+ | bus = dbus.SessionBus() | ||
+ | service = bus.get_object(' | ||
+ | props_iface = dbus.Interface(service, | ||
+ | properties = props_iface.GetAll(' | ||
+ | print "You are playing %s, follow me %s" %(properties.get(" | ||
+ | </ | ||
+ | **Result: | ||
+ | < | ||
+ | You are playing Midori 0.5.8 : A Fast and Lightweight Web Browser For Linux Mint - YouTube, follow me https:// | ||
+ | </ |