Orgmdb.el
An Emacs/org-mode watchlist manager and OMDb API client
Install / Use
/learn @isamert/Orgmdb.elREADME
#+TITLE: orgmdb.el
[[https://stable.melpa.org/#/orgmdb][file:https://stable.melpa.org/packages/orgmdb-badge.svg]] [[https://melpa.org/#/orgmdb][file:https://melpa.org/packages/orgmdb-badge.svg]]
Tools for managing your watchlist in org-mode and some functions for interacting with [[http://www.omdbapi.com/][OMDb API]].
- Contents :noexport: :PROPERTIES: :TOC: :include siblings :depth 3 :ignore this :END: :CONTENTS:
- [[#installation][Installation]]
- [[#demo][Demo]]
- [[#displaying-detailed-movie-information][Displaying detailed movie information]]
- [[#filling-movie-metadata][Filling movie metadata]]
- [[#opening-a-local-video][Opening a local video]]
- [[#configuration][Configuration]]
- [[#interactive-usage][Interactive usage]]
- [[#defining-new-actions][Defining new actions]]
- [[#library-usage][Library usage]] :END:
- Installation orgmdb is available through [[https://melpa.org/#/orgmdb][MELPA]]. If you have it set up already, just do ~M-x package-install orgmdb~ and you are good to go. Otherwise please see [[https://melpa.org/#/getting-started][MELPA getting started]] page to learn how you can install packages through MELPA or see the following installation options.
Another way to install =orgmdb.el= would be using either [[https://github.com/radian-software/straight.el][straight]] or [[https://github.com/quelpa/quelpa-use-package][quelpa]] package managers:
#+begin_src elisp ;; Using straight: (use-package orgmdb :straight (:host github :repo "isamert/orgmdb.el"))
;; Using quelpa: (use-package orgmdb :quelpa (orgmdb :fetcher github :repo "isamert/orgmdb.el")) #+end_src
Yet another option is just downloading =orgmdb.el= file and putting into your =load-path=, afterwards you can simply do the following in your =init.el=:
#+begin_src elisp (require 'orgmdb) #+end_src
- Demo ** Displaying detailed movie information [[file:https://user-images.githubusercontent.com/8031017/154753759-5ddaca00-3245-433f-9c3a-13c1c48f5c01.gif]]
** Filling movie metadata [[file:https://user-images.githubusercontent.com/8031017/154753756-5108bb8d-4dd0-457c-95df-9bae7a7ad17c.gif]]
** Opening a local video [[file:https://user-images.githubusercontent.com/8031017/154756033-318e5482-67e5-4ae4-a40e-c29375faed58.gif]]
- Configuration You need get yourself an API key to be able to use this package, see [[https://omdbapi.com/][OMDb website]]. After getting yourself an API key, you can start using by doing:
#+begin_src elisp (setq orgmdb-omdb-apikey "YOUR-API-KEY") #+end_src
Do ~M-x customize-group orgmdb RET~ to see all customization options.
- Interactive usage ~orgmdb.el~ offers several actions that you can call upon a movie/show/episode objects. These actions can be accessed by calling ~orgmdb-act~ function. A movie/show object is simply an org header with a tag, like the following:
#+begin_src org ,* Crouching Tiger, Hidden Dragon (2000) :movie: ,* Succession (2018-) :series: #+end_src
You can put your cursor on one of the headers and call ~orgmdb-act~. From the menu, you can select ~Fill movie properties~ to pull movie metadata under the ~:PROPERTIES:~ drawer of the selected header. From now on, you can use other actions defined under the ~orgmdb-act~ menu.
An episode object is a special one, because it can be either a header containing an episode marker object (meaning something like ~S02E05~) with an ~:episode:~ tag:
#+begin_src org ,* Succession (2018-) :series: ,** S01E08 - Prague :episode: #+end_src
or it can be simply an episode marker object:
#+begin_src org ,* Succession (2018-) :series:
- ...
- I watched S01E08 yesterday and it was cool.
-
^^^^^^ here is our episode marker object
#+end_src
In both cases, if your cursor is on the episode object, ~orgmdb-act~ will understand the context and show the actions accordingly.
Here are the actions and their simple explanations:
- ~Fill properties~ :: Fill the metadata of the current object. See
orgmdb-fill-property-listvariable to control which properties gets filled in. - ~Show detailed info~ :: Open a nicely formatted org buffer and display a detailed info of the current object with a small poster of it.
- ~Select an episode...~ :: Select an episode of the currently focused show and act on it.
- ~Open local video~ :: Find the local video file containing the current movie/show/episode. It searches video files under ~orgmdb-video-dir~ and looks for files with ~orgmdb-video-file-extensions~ extensions. ~orgmdb-player-function~ is used for opening the video file.
** Defining new actions You can define new actions for movie/show/episode objects using ~orgmdb-defaction~ function. See the following example:
#+begin_src emacs-lisp (orgmdb-defaction :name 'show-info ;; ^ Define a unique name for this action :definition "Show title of the currently selected object" ;; ^ User-facing definition of the action :on '(movie show episode) ;; ^ On what objects this action should appear? :act (cl-function (lambda (type &key title imdb-id episode &allow-other-keys) (message "The title is %s, imdb-id is %s" title imdb-id)))) #+end_src
- Library usage #+begin_src elisp (let ((movie (orgmdb :title "in the mood for love"))) (format "Movie name: %s, Year: %s, Plot: %s" (orgmdb-title movie) (orgmdb-year movie) (orgmdb-plot movie))) #+end_src
#+begin_src elisp (orgmdb :title "thinking of ending things" :year 2020)
;; This returns something like this: ((Title . "I'm Thinking of Ending Things") (Year . "2020") (Rated . "R") (Released . "04 Sep 2020") (Runtime . "134 min") (Genre . "Drama, Thriller") (Director . "Charlie Kaufman") (Writer . "Charlie Kaufman (written for the screen by), Iain Reid (based on the book by)") (Actors . "Jesse Plemons, Jessie Buckley, Toni Collette, David Thewlis") (Plot . "Full of misgivings, a young woman travels with her new boyfriend to his parents' secluded farm. Upon arriving, she comes to question everything she thought she knew about him, and herself.") (Language . "English, Spanish") (Country . "USA") ...) #+end_src
Local Variables:
before-save-hook: org-make-toc
End:
Related Skills
node-connect
350.1kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
350.1kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
350.1kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
