# -*- Mode: Org -*-
#+TITLE:    HACKING Genshiken
#+AUTHOR:   Michael Pagan
#+EMAIL:    mailto:michael.pagan@member.fsf.org
#+DATE:     2016-11-12 Sat
#+LANGUAGE: en
#+MACRO:    bgcolor @@html:<div style="background-color: $1;">$2</div>@@
#+MACRO:    txt-url      @@html:<a href="$1" $2>$3</a>@@
#+MACRO:    img-url-1    @@html:<img alt="$1" title="$2" style="$3" src="$4" width="$5" align="right"/></a>@@
#+MACRO:    img-url-2    @@html:<a href="$1" title="$2"><img alt="$3" src="$4" align="right" width="$5" /></a>@@
#+MACRO:    copyleft     @@html:<b><center><div style="background-color: $1;">Copyleft <span class="copy-left">&copy;</span><span>$2</span></div></center></b>@@
#+MACRO:    show-org     @@html:<div id="show_source"><input value="Show Org source" onclick="show_org_source()" type="button"/>@@
#+OPTIONS:  toc:1 date:nil html-postamble:nil
#+STARTUP:  overview inlineimages
#+HTML_HEAD:      <link rel="stylesheet" type="text/css" href="webdesignerwall.css" />
#+HTML_LINK_HOME: http://www.nongnu.org/genshiken/
#+INFOJS_OPT:     view:info
#+HTML_HEAD_EXTRA:<script>
#+HTML_HEAD_EXTRA:/** @licstart  The following is the entire license notice for the
#+HTML_HEAD_EXTRA: *  JavaScript code in this page
#+HTML_HEAD_EXTRA: *
#+HTML_HEAD_EXTRA: *   # Copyright © 2015 www.nongnu.org/genshiken/HACKING.html
#+HTML_HEAD_EXTRA: *
#+HTML_HEAD_EXTRA: *   The JavaScript code in this page is free software: you can
#+HTML_HEAD_EXTRA: *   redistribute it and/or modify it under the terms of the GNU
#+HTML_HEAD_EXTRA: *   General Public License (GNU GPL) as published by the Free Software
#+HTML_HEAD_EXTRA: *   Foundation, either version 3 of the License, or (at your option)
#+HTML_HEAD_EXTRA: *   any later version.  The code is distributed WITHOUT ANY WARRANTY;
#+HTML_HEAD_EXTRA: *   without even the implied warranty of MERCHANTABILITY or FITNESS
#+HTML_HEAD_EXTRA: *   FOR A PARTICULAR PURPOSE.  See the GNU GPL for more details.
#+HTML_HEAD_EXTRA: *
#+HTML_HEAD_EXTRA: *   As additional permission under GNU GPL version 3 section 7, you
#+HTML_HEAD_EXTRA: *   may distribute non-source (e.g., minimized or compacted) forms of
#+HTML_HEAD_EXTRA: *   that code without the copy of the GNU GPL normally required by
#+HTML_HEAD_EXTRA: *   section 4, provided you include this license notice and a URL
#+HTML_HEAD_EXTRA: *   through which recipients can access the Corresponding Source.
#+HTML_HEAD_EXTRA: *
#+HTML_HEAD_EXTRA: *  @licend  The above is the entire license notice
#+HTML_HEAD_EXTRA: *  for the JavaScript code in this page.
#+HTML_HEAD_EXTRA: */
#+HTML_HEAD_EXTRA:</script>
#+BEGIN_HTML
<script>
/*
@licstart  The following is the entire license notice for the
JavaScript code in this tag.

Copyright (C) 2012-2013 Free Software Foundation, Inc.

The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
General Public License (GNU GPL) as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version.  The code is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE.  See the GNU GPL for more details.

As additional permission under GNU GPL version 3 section 7, you
may distribute non-source (e.g., minimized or compacted) forms of
that code without the copy of the GNU GPL normally required by
section 4, provided you include this license notice and a URL
through which recipients can access the Corresponding Source.


@licend  The above is the entire license notice
for the JavaScript code in this tag.
*/
<!--/*--><![CDATA[/*><!--*/
 function rpl(expr,a,b)
 {
   var i=0
   while (i!=-1)
   {
      i=expr.indexOf(a,i);
      if (i>=0)
      {
         expr=expr.substring(0,i)+b+expr.substring(i+a.length);
         i+=b.length;
      }
   }
   return expr
 }
 function show_org_source()
 {
   document.location.href = rpl(document.location.href,"html","org.html");
 }
/*]]>*///-->
</script>
#+END_HTML
#+COMMENT: Copied from <https://gist.github.com/JGallardo/6077195>
#+BEGIN_HTML
<style>
  .copy-left {
     display: inline-block;
     text-align: right;
     margin: 0;
    -moz-transform: scaleX(-1);
    -o-transform: scaleX(-1);
    -webkit-transform: scaleX(-1);
    transform: scaleX(-1);
    filter: FlipH;
    -ms-filter: "FlipH";
  }
</style>
#+END_HTML
#+LINK:     watchcartoon		http://www.watchcartoononline.com/
#+LINK:     FDL				http://www.gnu.org/licenses/fdl.txt
#+LINK:     fs-definition		https://www.gnu.org/philosophy/free-sw.html
#+LINK:     free-software		docview:what-is-fs-new.pdf
#+LINK:     fsfd			http://directory.fsf.org/wiki/Category/Interface/command-line
#+LINK:     open-source			https://www.gnu.org/philosophy/open-source-misses-the-point.html
#+LINK:     atom-feed			https://savannah.nongnu.org/news/atom.php?group=genshiken
#+LINK:     emacs			http://www.gnu.org/software/emacs/
#+LINK:     org                         http://orgmode.org/
#+LINK:     %provide-arguments		file:share/genshiken/genshiken-main.sh::start-on
#+LINK:     %tweak-playlist		file:share/genshiken/functions/gfunc83000-download-anime.sh::START_
#+LINK:     %external-program		file:share/genshiken/functions/gfunc83120-extract-information.sh::youtube-dl
#+LINK:     %restore-previous-session	file:share/genshiken/functions/gfunc5-restore-previous-session.sh::Restore_Previous_Session
#+LINK:     %functional			file:share/genshiken/functions
#+LINK:     %grep-n-sed			file:share/genshiken/functions/gfunc83120-extract-information.sh::local%20Host_Domains
#+LINK:     %find-n-xargs		file:share/genshiken/functions/gfunc5-restore-previous-session.sh::for%20session_file%20in
#+LINK:     %sed-example		file:share/genshiken/functions/gfunc7-extract-series-list.sh::sed%20-e%20's_Episode
#+LINK:     %gawk-example		file:share/genshiken/functions/func0-cleanup.sh::rm%20$(ls
#+LINK:     %align-backquote		file:share/genshiken/genshiken-main.sh::readonly%20HUMAN
#+LINK:     %align-commands		file:share/genshiken/genshiken-main.sh::grep%20-v%20'alert'
#+LINK:     %blocks-of-code		file:share/genshiken/genshiken-main.sh::cp%20--version
#+LINK:     %go-in-depth		file:share/genshiken/functions/gfunc83120-extract-information.sh::extra-information
#+LINK:     %explain-criteria		file:share/genshiken/functions/gfunc82000-anime-prompt.sh::criteria
#+LINK:     %single-statement		file:share/genshiken/functions/gfunc5-restore-previous-session.sh::Here's%20why
#+LINK:     %side-comments		file:share/genshiken/functions/gfunc83000-download-anime.sh::may%20contain
#+LINK:     %source-code		file:share/genshiken/genshiken-main.sh::%20%20%20%20%20-E|--source-code
#+LINK:     %verbose			file:share/genshiken/genshiken-main.sh::xtrace
#+LINK:     %main-procedure		file:share/genshiken/genshiken-main.sh::case%20$MAIN
#+LINK:     %extract-series-list	file:share/genshiken/functions/gfunc7-extract-series-list.sh::Extract_Series_List
#+LINK:     %parse-html			file:share/genshiken/functions/gfunc7-extract-series-list.sh::for%20i%20in%20{0..26}
#+LINK:     %sourced			file:share/genshiken/genshiken-main.sh::functions=
#+LINK:     %while-loop			file:share/genshiken/functions/gfunc80000-anime-selection.sh::do%20Series_Prompt
#+LINK:     %fs-parsing			file:share/genshiken/functions/gfunc83100-extract-files.sh::Extract_Information
#+LINK:     %extract-information	file:share/genshiken/functions/gfunc83120-extract-information.sh::Extract_Information
#+LINK:     %anime-prompt		file:share/genshiken/functions/gfunc82000-anime-prompt.sh::echo%20-en
#+LINK:     mkfunctions			file:Makefile::^functions
#+LINK:     downloaded			file:Makefile::grab-pkg:
#+LINK:     installed			file:Makefile::install:
-----
#+BEGIN_CENTER
*{{{bgcolor(cyan, For those who wish to contribute to Genshiken: Review this file carefully!)}}}*
#+END_CENTER
*Please Note:*
{{{bgcolor(#E0E0E0, Each page\, if viewing this document online\, is programmed to behave like an info buffer.)}}}
{{{bgcolor(#E0E0E0, Enter `?`\, to learn the keybindings for navigating this website.  Enter `H`\, to return to the main page.)}}}

  + This file is best seen under [[emacs][GNU Emacs]].
    - The /Org mode/ version of this =HACKING= file is the source for this document
      + If you prefer to view the same information from within /GNU Emacs/, then you may
        download the =HACKING= file from *CVS*.
        - ~wget -O HACKING http://cvs.savannah.gnu.org/viewvc/*checkout*/genshiken/share/doc/genshiken/HACKING?root=genshiken~
    - You may use the =HACKING= file as a Transparent copy of this document, in order to
      create similar documents.  When doing so, you must follow the terms of the /GNU Free
      Documentation/ license.
  + All code blocks can be executed in [[emacs][GNU Emacs]], from within the =HACKING= file
    - Place point on the code block and enter: ~C-c C-c~

{{{bgcolor(#E0E0E0, To view the source code for this website\, if in GNU IceCat\, Enter: `C-c u`.)}}}
{{{bgcolor(#E0E0E0, To view the corresponding source code used to create this website\, click the "Show Org source" button at the bottom of this page.)}}}

#+CAPTION:    HOWTO for {{{title}}}
#+ATTR_HTML: :alt genshiken-logo :title Grinding the gears, to get your videos working! :style color:red; :align center
[[file:share/icons/hicolor/128x128/apps/sos-gear.png]]

/Last modified on {{{time(%B)}}} {{{time(%d)}}}, {{{time(%Y)}}} at {{{time(%T)}}}/
-----
#+COMMENT: This is my custom postamble
{{{img-url-2(http://orgmode.org, Org mode,Org mode unicorn logo,http://orgmode.org/img/org-mode-unicorn-logo-worg.png,17%)}}}
{{{img-url-2(https://www.fsf.org/about/what-is-free-software,What is Free Software?,TEDxGeneva Presentation,img/fsf-wh.jpg,11%)}}}
{{{img-url-2(https://www.gnu.org/software/emacs/,GNU Emacs,Emacs,img/crtemacs.jpg,12%)}}}
{{{show-org}}} *Learn more about this website:* [[http://web.cvs.savannah.gnu.org/viewvc/?root=genshiken][View the HTML sources]]; [[http://validator.w3.org/check?uri=referer][Validate HTML]]; {{{txt-url(/genshiken/about/javascript.html,rel="jslicense",JavaScript License Information)}}}
#+HTML: </div>
{{{copyleft(#E0E0E0, 2015-2016 Michael Pagan)}}}
#+HTML: <div style="background-color: orange;">
{{{img-url-1(Free Documentation\, for Free Software,Free Documentation License,border-width:0,http://www.gnu.org/graphics/gfdl-logo-small.png,22%)}}}
This website is licensed under the {{{txt-url(https://www.gnu.org/licenses/fdl.html,rel="license",GNU Free Documentation License)}}}.
Based on a work at {{{txt-url(http://cvs.savannah.gnu.org/viewvc/?root=genshiken,xmlns:dct="http://purl.org/dc/terms/" rel="dct:source",cvs.savannah.gnu.org)}}},
with the /Invariant Sections/ being just "*What is the purpose of Genshiken?*"
Code blocks are licensed under the {{{txt-url(http://www.gnu.org/licenses/gpl.html,,GNU General Public License v3\, or later)}}}.
#+HTML: </div>

#+COMMENT: Place point below, and press <TAB> to unfold this headline
* COMMENT Bewildered by asterisks?
  + [[#asterisks][Place point here and enter: ~C-c C-o <RET> nn <TAB> C-c C-x C-n C-c C-o]]~
  + The header should read as: /2.1 Outlines/
  + Now enter the following to exit /Info mode/ and return here: ~C-x k <RET> C-&~
    - Couldn't follow that?  Click [[info:org][Here]]!
    - info-emacs-manual (~C-h r~) :: Execute this command to read the /GNU Emacs manual/
      1) Read the manual?  Follow: [[#asterisks][You are in Org mode]]
      2) 12 common commands for this file
         + org-cycle (~<TAB>~)                      :: Rotate current subtree among 3 states
         + global-org-cycle (~S-<TAB>~)             :: Rotate the entire buffer among 3 states
         + org-open-at-point (~C-c C-o~)            :: Push position onto mark ring and follow
                                                       link at point
         + org-mark-ring-goto (~C-c &~)             :: Jump to the original position in the
                                                       mark ring
         + org-next-link (~C-c C-x C-n~)            :: Move forward to the next link
         + org-previous-link (~C-c C-x C-p~)        :: Move backward to the previous link
         + org-next-visible-heading (~C-c C-n~)     :: Move to the next visible heading
         + org-previous-visible-heading (~C-c C-p~) :: Move to the previous visible heading
         + outline-up-heading (~C-c C-u~)           :: Move to the visible heading line of
                                                       which the present line is a subheading
         + isearch-forward (~C-s~)                  :: Do an incremental search forward
         + isearch-backward (~C-r~)                 :: Do an incremental search backward
         + org-todo (~C-c C-t~)                     :: Change the TODO state of an item
      3) Finished following the above instructions?  Enter: ~C-r * <TAB>~
* FAQ
** Q: Why do certain text strings contain strikethroughs in this document?
   *ANSWER*
   #+BEGIN_CENTER
   *{{{bgcolor(yellow, They either refer to phrases that I don't agree with\, or links that don't work in HTML)}}}*
   #+END_CENTER
   + Please note that all strings (with exception to lines speaking of +open source+ software)
     formatted with a strikethrough, refer to Org targets in Genshiken's source code.
   + Org targets are equivalent to external links, but referencing them online is a bit of a
     challenge
     - *Reason #1* -- I have to assume you have the source code already installed
     - *Reason #2* --  These Org targets were meant to be seen within GNU Emacs, via /Org mode/
** Q: I'm confused?  What does this rainbow of asterisks mean!?
   :PROPERTIES:
   :CUSTOM_ID: asterisks
   :END:
   *ANSWER*
   #+BEGIN_CENTER
   *{{{bgcolor(yellow, If you are inside of GNU Emacs\, then you are in Org mode)}}}*
   #+END_CENTER
   + These asterisks form [[info:org#Outlines][Outlines]]
     - Ps ::
       Try reading the rest of that manual while you're at it
** Q: What exactly is <<the main purpose>> of Genshiken, anyway?
   *ANSWER*
   #+BEGIN_CENTER
   *{{{bgcolor(yellow, To free web media!)}}}*
   #+END_CENTER
   + Many proprietary software companies push video/audio formats that
     [[http://www.fsf.org/campaigns/playogg/en/][restrict access and restrict software developers]].
   + Now that HTML5 is here, we finally have a [[http://diveintohtml5.info/video.html][standard way to embed video]] onto a webpage
     - Most plugins are nonfree, so who knows what they could be doing as they /load your
       videos/ ::
  #+BEGIN_QUOTE
  =Virtually all the video you’ve ever watched “on the web” has been funneled through a
   third-party plugin=

  -- by [[http://diveintohtml5.info/legal.html][Mark Pilgrim]]
  #+END_QUOTE
  Why is it that companies or website administrators have not started using HTML5, yet?  Could
  it be that they want to hide the locations of their videos via nonfree applications?  Do
  they think that it's ethical to embed videos in a format that restricts users, and
  encourages them to install proprietary software?

  _True_ cyber security/privacy can *NOT* be maintained, unless _free software_ is utilized!
  For how can we control our security/privacy with software, if we do not even have control of
  said software.  _Free software_ is the only kind of software that gives us control.  I dare
  you to compare a _free software_ license with a nonfree one, and tell me different!  Also,
  their's no way of telling what malicious functionalities a plugin or browser-side script may
  have if it's nonfree!

  Videos that /require nonfree software/, can be loaded via an external player instead; thus,
  bypassing the need for your browser to behave like a media player via plugins.  Genshiken
  exists so that you no longer have to rely on plugins anymore, especially not the proprietary
  ones.  Most importantly, you are always in control-- combined with the [[fs-definition][4 Freedoms]], Genshiken
  respects and promotes your freedom!
** Q: What makes Genshiken unique compared to common downloader/streaming clients?
   *ANSWER*
   #+BEGIN_CENTER
   *{{{bgcolor(yellow, It's a free/libre shell script!  Below are some reasons for installing it.)}}}*
   #+END_CENTER
   1) Hackability (i.e. Consider the file you're in ...)
      - Automatic playlisting
        + Each supported website is treated like a playlist by default
        + You can [[%provide-arguments][provide arguments]] to [[%tweak-playlist][tweak the playlist]]
   2) Ease of use
      + Genshiken users don't need to enter a URL to find their videos
        - Genshiken figures that out for them
        - Some links may require [[%external-program][external programs]]
          1) See [[#language][Proficient with a different language]]
      + There's even a [[%restore-previous-session][Restore Previous Session]] function
        - In essence, there's no need to remember the commands used to enter a playlist
        - This small outline can't do this particular topic justice; refer to [[man:genshiken][The Manpage]]
   3) It's a shell-script for crying out loud!
      + A majority of [[fsfd][free software command-line programs]] can be used within Genshiken!
      + Most programming languages can be used within Genshiken
        - In essence, Genshiken is not language specific
        - Bash can simply be used as a container to your language of choice
          1) See [[#language][Proficient with a different language]]
   4) The core of Genshiken is browser and library independent!
      + Why else is my Makefile so small?
   5) Most manuals are tens, hundreds, or even thousands of pages long
      + Genshiken's manual is about 6 pages
      + You *CAN* master this program!
** Q: Can it /really/ all be done in bash?
   :PROPERTIES:
   :CUSTOM_ID: bash
   :END:
   *ANSWER*
   #+BEGIN_CENTER
   *{{{bgcolor(yellow, Yes!  Review how functional Genshiken is already!)}}}*
   [[%functional][link-to-functions]]
   #+END_CENTER
   + The very first program that most users [of a *GNU/Linux* operating system] encounter, is
     *GNU Bash*
     - Before *GNU/Linux* had a GUI, this was exactly the case.  You were dropped into a shell
       at login
     - Released in 1989, it has since been the default shell for the *GNU/Linux* operating
       system
   + A majority of software packages still require the use of shell-scripts for installation
     - *Question:* What do you think a Makefile is?
        + *Answer:* A series of shell commands!
   + You have *NO* reason not to learn it!
** Q: Do I /really/ have to read ALL the Manpages you've listed?
   *ANSWER*
   #+BEGIN_CENTER
   *{{{bgcolor(yellow, Yes!  But if you don't like that answer, then read the following:)}}}*
   #+END_CENTER
   #+BEGIN_VERSE
   *Bruce Lee:* =Absorb what is useful, Discard what is not, Add what is uniquely your own.=
   *Bruce Lee:* =Be water, my friend=
   #+END_VERSE
** Q: Bash shell scripts can utilize a variety of programs/languages!  Which should I expect?
  *ANSWER*
  #+BEGIN_CENTER
  *{{{bgcolor(yellow, GNU programs like echo\, grep\, sed\, gawk\, etc.)}}}*
  #+END_CENTER
  - Novice level one-liner       -- [[%grep-n-sed][Grep and Sed Example]]
  - Intermediate level one-liner -- [[%find-n-xargs][Find and Xargs Example]] (That /IS/ a single one-liner)
  - Advanced level one-liner     -- [[%sed-example][Sed Example]]            (Ditto ...)
  - Expert level one-liner       -- [[%gawk-example][GAWK Example]]
**** See [[#language][Proficient with a different language]]
** Q: How should I indent when contributing source code?
   *ANSWER*
   #+BEGIN_CENTER
   *{{{bgcolor(yellow, Preferably 2 spaces every time you nest within logical blocks of code.)}}}*
   #+END_CENTER
   - Exceptions include:
     + [[%align-backquote][aligning commands after a backquote]]
     + [[%align-commands][aligning similar consecutive commands]]
   - The key is to make the contribution human readable!
** Q: There are too many comments!  Do I have to document my code the same way?
   *ANSWER*
   #+BEGIN_CENTER
   *{{{bgcolor(yellow, Not exactly!  It's mainly for reference\, and to explain the program flow.)}}}*
   #+END_CENTER
   What appears obvious now, may not be in the future-- _think ahead_, before you write!
   It's also designed for newbies to read it ... /hint, hint/
   1) Specifically, please follow these conventions:
     + Add at least a one-line comment providing a brief synopsis of a function
       - Each new function must be added to [[#functions][the functions]] directory as a single file
     + Add at least 1-2 lines worth of comments to [[%blocks-of-code][blocks of code]]
       - You are encouraged to [[%go-in-depth][go in depth]] for key variables of a function
       - When test conditions seem a bit complicated: [[%explain-criteria][Explain the criteria]]
       - Don't be afraid to fully explain the reasoning behind a [[%single-statement][single statement]]
       - [[%side-comments][Side comments]] are recommended at specific times-- use you're best judgement!
       - Consider adding your 2-cents to the man page, if it takes too much text to explain
** Q: I want to extend the command-line options of Genshiken.  Any advice?
   *ANSWER*
   #+BEGIN_CENTER
   *{{{bgcolor(yellow, Here's some:)}}}*
   #+END_CENTER
   Follow [[info:standards#Command-Line%20Interfaces][these conventions]] and ensure your contribution is compatible with [[info:standards#Option%20Table][this table]].
** Q: If I create a new file for Genshiken, is there anything that I should include with it?
   *ANSWER*
   #+BEGIN_CENTER
   *{{{bgcolor(yellow, Yes!  Each new file requires at least 2 things:)}}}*
   #+END_CENTER
   A [[info:maintain#Copyright%20Notices][Copyright Notice]] and a [[info:maintain#License%20Notices][License Notice]]. \\
   *RMS:* =Without a license notice giving permission to copy and change the file, the file
   is= [[https://gnu.org/philosophy/proprietary.html][nonfree]].

   + In essence, you should follow these conventions ::
     1) [[info:maintain#License%20Notices%20for%20Code][Program files should cite the GPL]]
     2) [[info:maintain#License%20Notices%20for%20Documentation][Documentation should use the GNU Free Documentation License]]
     3) [[info:maintain#License%20Notices%20for%20Other%20Files][Small supporting files can use a simple all permissive license]]
     4) [[info:maintain#External%20Libraries][For modules that are treated as a "library", ensure it's compatible with the GPL]]
   + Ps ::
     Consider using the overall Copyright Notice and License found in the [[file:readme.org::License Notice][readme]]
** Q: Is there anything else I should consider when making a contribution?
  *ANSWER*
  #+BEGIN_CENTER
  *{{{bgcolor(yellow, Yes!  Unlike proprietary software ...)}}}*
  #+END_CENTER
  + There is an [[info:maintain#Ethical%20and%20Philosophical%20Consideration][ethical and philosophical consideration]].
    - Do *NOT* [[info:standards#Reading%20Non-Free%20Code][refer to proprietary programs]]!
  + Do realize this is a [[free-software][free software]] project (i.e. NOT [[open-source]["Open Source"]])
  + This one may not be so obvious, but... Genshiken is not /POSIX/.
    - *RMS:* This "[[info:standards#Non-GNU%20Standards][standard]]" we can do without =when that makes the GNU system better overall=
      =in an objective sense.=
** Q: How do I get started?
   *ANSWER*
   #+BEGIN_CENTER
   *{{{bgcolor(yellow, Simple!  Follow the link below.)}}}*
   [[newbie][newbie]]
   #+END_CENTER
** [your questions here!]
* newbie
** Read the [[FAQ][FAQ]], before you continue!
** Are you good at bash shell-scripting?
*** If so, then I could use your help!
**** [[mailto:?to=michael.pagan@member.fsf.org&subject=my-bash-project&body=I%20heard%20you%20needed%20some%20help][E-Mail me]] a link to your /free software/ project so I can review it.
*** If not, then that's okay!  Begin tackling this [[newbie][newbie]] outline for success!
*** Proficient with a different language like Ruby, JavaScript, or Python?
    :PROPERTIES:
    :CUSTOM_ID: language
    :END:
**** These are the types of languages that operate best on a website
**** I could use support for languages like those in Genshiken!
***** Your skills could prove useful for complex operations
***** For simple operations, regular GNU programs are still preferred
***** Python developer?  See [[#python][written in Python]]
***** JavaScript/Ruby developer?  See [[#javascript][modifying JavaScript inside HTML tags]]
***** Perl/Ruby developer?  GNU Awk hacker?  See [[#regex][Make REGEX more generic and efficient]]
** Read [[man:man][Manpages]] within this HACKING file
*** Install /org-man.el/
**** Relevant information for extending links can be found in [[info:org#Adding%20hyperlink%20types][Adding hyperlink types]]
     #+NAME:     download-org-man
     #+CAPTION:  Download org-man.el
     #+BEGIN_SRC bash
       lynx -dump \
       'https://www.gnu.org/software/emacs/manual/html_node/org/Adding-hyperlink-types.html' |\
       sed -n '/;;;/,/;;;/ p' > org-man.el

       [[ $? -eq 0 ]] &&
       echo -e "org-man.el has been downloaded successfully!" ||
       echo "org-man.el could not be downloaded!  Check your internet connection" >&2
     #+END_SRC
**** Move /org-man.el/ to your load path
**** Finally, load it via your .emacs init file
** Genshiken is NOT part of the /GNU Project/, yet!
*** Enter ~C-h g~ to learn more about the /GNU Project/
    + If you are not in *GNU Emacs*: Click [[https://www.gnu.org/gnu/thegnuproject.html][here]]!
*** If Genshiken becomes a GNU package, then all members of this project will be GNU Hackers!
**** Please install /standards.info/ & /maintain.info/, for I shall be referring to them
**** If these links fail [in Emacs], (info:standards / info:maintain): Follow the below steps
***** Browse The [[http://www.gnu.org/prep/][GNU Project Information]] site
***** Download the /maintain/ and /standards/ tarballs from GNU's Project Information page
      #+NAME:     download-gnuprep-tarballs
      #+CAPTION:  Download the GNU Project Information tarballs
      #+BEGIN_SRC bash
        wget http://www.gnu.org/prep/maintain/maintain.info.tar.gz 2> /dev/null &&
        wget http://www.gnu.org/prep/standards/standards.info.tar.gz 2> /dev/null

        [[ $? -eq 0 ]] && echo "Successfully downloaded two Project Information tarballs!" ||
                          echo "Could not download the Project Information tarballs!  \
                                Check your internet connections" >&2
      #+END_SRC
***** Unarchive and uncompress them via ~tar -xzvf *info.tar.gz~
***** Move the extracted info files to your emacs *INFOPATH* (e.g. =/usr/share/info/emacs-24=)
***** Add the below entries into your /dir/ file:
      GNU organization
      * Maintaining: (maintain)			Maintaining GNU software.
      * Standards: (standards)			GNU coding standards.
** Grok [[man:bash][GNU Bash]] (I mean it!  Don't even continue, if you can't)
*** See [[#bash][Can it really all be done in bash]]
*** While you're at it, grok [[http://directory.fsf.org/wiki/Abs][Abs]]
    + Become familiar with [[info:coreutils][The GNU Core Utilities]]
      - Here are some things to [[http://www.pixelbeat.org/docs/coreutils-gotchas.html][consider]] with the coreutils
    + Become familiar with [[info:grep][GNU Grep]]
    + Become familiar with [[info:sed][Sed]]
    + Become familiar with [[man:gawk][GNU Awk]]
      - Study [[http://www.gnu.org/software/gawk/manual/html_node/index.html][GAWK: Effective AWK Programming]]
** Grok [[man:genshiken][Genshiken]]
*** So ... Genshiken is under a /revision control system/?  What exactly is CVS?
**** CVS newbies, read the Official documentation: [[info:cvs][CVS--Concurrent Versions System]]
***** Want to get on the fast track?
****** The project homepage is: http://www.nongnu.org/cvs/
****** A [[https://web.archive.org/web/20101130125107/http://ximbiot.com/cvs/wiki/CVS%20FAQ][FAQ]]
****** Here's [[https://web.archive.org/web/20131214022908/http://ximbiot.com/cvs/cvshome/docs/blandy.html][An introduction]]
****** Tips for CVS best practices can be found [[http://ftp.wayne.edu/ldp/REF/CVS-BestPractices/html/CVS-BestPractices.html][Here]]
       :PROPERTIES:
       :CUSTOM_ID: cvs
       :END:
**** CVS Resources on [[#savannah][GNU Savannah]]:
***** [[http://savannah.gnu.org/maintenance/CvsAnonymous/][CvsAnonymous]] - For those who want to access a /free software/ project
****** Get access to the Genshiken Repository
******* [[https://savannah.nongnu.org/cvs/?group=genshiken][Genshiken CVS Repo]]
******* You will use a similar command as [[file:Makefile::checkout][this one]]
******* Passed the [[#wrong][wrong if]] test?  Become a project member!
***** [[http://savannah.gnu.org/maintenance/CvsGettingStarted/][CvsGettingStarted]] - For those who want to make a new /free software/ project
****** Read the [[http://www.tldp.org/HOWTO/Software-Proj-Mgmt-HOWTO/][free software Project Management-HOWTO]]
******* See [[#cvs][CVS best practices]]
******* See [[#free-software][have a free software project]]
****** [[http://savannah.gnu.org/maintenance/UsingCvs/][UsingCvs]]
****** [[http://savannah.gnu.org/maintenance/AccessToCVSROOT/][AccessToCVSROOT]]
******* export $CVSROOT in your .shrc file (.e.g. ~export CVSROOT=/home/user/cvs-projects~)
******** This variable is also used in Genshiken's [[file:Makefile::CVSROOT][Makefile]]
****** [[http://savannah.gnu.org/maintenance/CvsFromBehindFirewall/][CvsFromBehindFirewall]]
****** [[http://savannah.gnu.org/maintenance/CvsImportExistingProject/][CvsImportExistingProject]]
****** [[http://savannah.gnu.org/maintenance/CvsImportExistingRepo/][CvsImportExistingRepo]]
****** [[http://savannah.gnu.org/maintenance/CvsRsyncWriteAccess/][CvsRsyncWriteAccess]]
****** [[http://savannah.gnu.org/maintenance/CvsDisabling/][CvsDisabling]]
*** You are wrong if:
    :PROPERTIES:
    :CUSTOM_ID: wrong
    :END:
**** You are not in [[emacs][GNU Emacs]]!
***** Quit whichever program you are using _right now_!  This file was designed for [[org][Org mode]].
***** For terminal users, enter this:     ~emacs -nw share/doc/genshiken/readme.org~
***** For GUI users, enter this instead:  ~emacs     share/doc/genshiken/readme.org~
**** You say:
***** "Genshiken is +open source+ software!"
***** "It's +more practical+ than most downloader/streaming clients."
****** Review Genshiken's [[file:readme.org::License Notice][License Notice]]
**** You read this file before the [[file:readme.org][readme]]
**** You are *NOT* interested in the [[file:NEWS][NEWS]]
***** Important announcements will not be sent as a bulk E-Mail!
****** They'll be published as an official news article, so _stay in the loop_
****** I will be following [[info:standards#NEWS%20File][these conventions]]
***** Comments from a project member can make their way [[file:news-maker.sh::add-comments][into the NEWS file]]
****** *Q:* Do I expect you to read it?
******* *A:* Yes, I do!
******* *Ps:* If you are a project member, and I haven't responded to it yet: _Reply back_.
***** Subscribe to the [[atom-feed][Atom feed]] (e.g. utilize [[https://support.mozilla.org/en-US/kb/live-bookmarks?redirectlocale=en-US&redirectslug=Live+Bookmarks][Live Bookmarks]] or a [[https://en.wikipedia.org/wiki/Liferea][Feed Reader]])
***** Subscribe to the <<<mailing-list>>>.  Learn more [[file:readme.org::Contact Information][here]].
**** You haven't [[downloaded][downloaded]] AND [[installed][installed]] Genshiken!
**** You don't have a copy of the repository
***** See [[Get access to the Genshiken Repository][Get access to the Genshiken Repository]]
**** You've never executed [[%source-code][genshiken --source-code]]
**** You haven't tried streaming/downloading with the [[%verbose][--verbose]] option
**** You've tried tackling the [[ideas / wishlist][ideas / wishlist]] or [[fix bugs][fix bugs]] while still a newb!
**** You copied code from another /free software/ project, without giving them [[info:maintain#Non-FSF-Copyrighted%20Package][proper credit]]
**** You've contributed code, but you're mad when I say: [[info:maintain#Clean%20Ups][it needs to be cleaned up, first]].
**** You've added to [[file:TODO][The TODO list]] when it's actually my responsibility as /Project Admin/
***** May change if you become a project member, and [[info:maintain#Recruiting%20Developers][I've deemed your skills useful]] enough
****** How do I become a <<<project member>>>?
******* [[https://savannah.nongnu.org/project/memberlist.php?group=genshiken][Use the request for inclusion form]] located on GNU Savannah, to become a member!
******* What is GNU Savannah?
        :PROPERTIES:
        :CUSTOM_ID: savannah
        :END:
******** GNU Savannah is [[https://www.fsf.org/blogs/community/savannah][where the gnu roam]]
******** This is why you should [[http://savannah.gnu.org/maintenance/WhyChooseSavannah/][choose Savannah]]
******** Do you have a /free software/ project, too?  Register it [[https://savannah.nongnu.org/register/][Here]]!
         :PROPERTIES:
         :CUSTOM_ID: free-software
         :END:
******* If you are a project member, and no longer a [[newbie][newbie]]: See [[Genshiken Hacker][Genshiken Hacker]]
* Genshiken Hacker
** Support an additional website
*** TODO Pending [[functions/variable names should be generic][functions/variable names should be generic]]
*** TODO Pending [[file:TODO::Show-Type configure routine][Show-Type configure routine]]
    :PROPERTIES:
    :CUSTOM_ID: parsing
    :END:
**** Will change specific variables that utilize REGEX; make HTML parsing work on all websites
**** Genshiken may have to be re-structured a bit in order to support more than one website
***** Let me know if you feel that this is the case!
*** Study [[%main-procedure][The Main Procedure]] of Genshiken
*** Add a new Anime-Type (will soon be "Show-Type")
*** Review [[%extract-series-list][Extract Series List]]; study how it operates on [[watchcartoon][The Watchcartoononline.COM Network]].
**** This is the first step to take in order to add support to a new website!
**** You must be able to [[%parse-html][Parse the HTML]] via GNU programs like the ones used here
*** Understand the order of expected execution that genshiken employs
    :PROPERTIES:
    :CUSTOM_ID: functions
    :END:
**** Review the functions [[%functional][directory]]
***** These functions are named using numbers that reflect the expected execution order
***** All functions are [[%sourced][sourced]] at run-time (The [[mkfunctions][Makefile]] is tasked with modifying this value)
***** These functions may execute at anytime:
      + func0-cleanup.sh
      + func1-early-termination.sh
      + func2-restore-monitor.sh
***** All =gfunc-*= files are executed with:
      + ~genshiken --get Anime-Type~
      + ~genshiken --stream Anime-Type~
***** All =vfunc-*= files are executed with:
      + ~genshiken --view Anime-Type~
**** Study this [[%while-loop][While Loop]].
***** Each function called here, needs slight modifications in order to support a new website.
***** The key is: [[%fs-parsing][Can it be parsed with free software]]?  See [[%extract-information][Extract Information]] for details.
*** Revise the man page to include the new Show-Type and it's arguments
*** Those who can accomplish this:
    + Work on the [[ideas / wishlist][ideas / wishlist]], [[fix bugs][fix bugs]], tackle [[file:TODO][The TODO list]], or
      [[Support an additional website][Support an additional website]]
*** Those who can NOT accomplish this:
    + Add to the  [[ideas / wishlist][ideas / wishlist]] or  [[fix bugs][fix bugs]]
    + Perhaps add questions to the [[FAQ][FAQ]] if confused
*** Genshiken is already functional!  Supporting additional websites will be our main task.
** [more recommendations can be discussed on the mailing-list]
** TODO A lot of what happens here will be added to a future info file as a tutorial!
* ideas / wishlist
** TODO manga/book download procedure
** TODO Support more video websites (See [[Support an additional website][Support an additional website]])
** TODO Support more image websites (See [[Support an additional website][Support an additional website]])
*** Pending [[manga/book download procedure][manga/book download procedure]]
** TODO Create more rigorous parsing routines
*** TODO Learn from [[https://rg3.github.io/youtube-dl/supportedsites.html][youtube-dl]] - Written in Python, for downloading videos or music
    :PROPERTIES:
    :CUSTOM_ID: python
    :END:
**** Python developer might be needed here!
**** Either [[https://github.com/rg3/youtube-dl#developer-instructions][extend youtube-dl]], or add your code directly into Genshiken
**** If you want, you can even replicate youtube-dl inside of Genshiken
**** youtube-dl supports [[https://rg3.github.io/youtube-dl/supportedsites.html]['youtube-like websites']], let's support nonyoutube-like websites
***** This way, we have both ends of the spectrum coverered-- so to speak
*** TODO Utilize PhantomJS for analyzing and modifying JavaScript inside HTML tags
    :PROPERTIES:
    :CUSTOM_ID: javascript
    :END:
**** JavaScript developer might be needed here!
**** PhantomJS is only a suggestion!  Use what you think will be the best fit for Genshiken.
     If a JavaScript/Ruby developer has a unique solution for dealing with nontrivial nonfree
     loading scripts: _I want to hear it!_
*** TODO Make REGEX more generic and efficient for better use with different websites
    :PROPERTIES:
    :CUSTOM_ID: regex
    :END:
**** Perl or Ruby developer might be needed here!
**** GNU Awk Hacker might be needed here!
**** Please refer to [[#parsing][change specific variables that utilize REGEX]], for your first task
** TODO Provide redirection, whenever the current series within a given site can't be loaded
** TODO Add option =Episode Guide= to the [[%anime-prompt][Anime Prompt]]
** [your hacking ideas here!]
* fix bugs
** TODO functions/variable names should be generic
** [found a bug?  Report it to the mailing-list, and I'll add it here!]
* ChangeLog discipline
** Based on the [[info:standards#Change%20Logs][GNU coding standards]]
** Ensure to update the [[file:ChangeLog][ChangeLog]] with any changes you make to Genshiken!
   + This is accomplished automatically via [[man:cvs2cl][cvs2cl]] (install it if you don't have it)
** The ChangeLog will be for _tarball users only_ (refer to the [[file:Makefile::$(PKG_DIR)/ChangeLog][Makefile]] for details)
* Recording Contributors
** Based on the [[info:maintain#Recording%20Contributors][The GNU Maintainers Guide]]
** Once you start contributing to Genshiken, I will add your name to the [[file:AUTHORS][AUTHORS file]]
*** The format is =savannah-user-name:real-name <email-address>:GnuPG-Key-ID:Description of contribution=
    + If your contribution does not include code, the first field will be omitted
#+BEGIN_CENTER
*{{{bgcolor(yellow, Don't be shy!  I will add your name even if you're contribution consists of:)}}}*
#+END_CENTER
  + One-line of code
  + A trivial idea you suggested, that makes its way into Genshiken
  + Free documentation that you provide for Genshiken

In essence, any contribution to Genshiken will be recorded in the [[file:AUTHORS][AUTHORS file]].
Not sure whether something should be added/not?  Discuss it on the mailing-list!
* License Notice
  :PROPERTIES:
  :COPYING:     t
  :DESCRIPTION: A Copyleft license to guarantee and ensure freedom
  :END:
  #+ATTR_HTML: :alt Free as in Freedom :style color:red; :align right
  [[http://www.gnu.org/licenses/fdl.html][http://www.gnu.org/graphics/gfdl-logo-med.png]]

  Copyright © 2015 {{{author}}}

  Permission is granted to copy, distribute and/or modify this
  document under the terms of the /GNU Free Documentation License/,
  Version 1.3 or any later version published by the /Free Software
  Foundation/; with *no Invariant Sections*, and with the Back-Cover Texts
  as in (a) below.  Please refer to the [[file:COPYING.manual][COPYING.manual]] file for full details
  of the GNU Free Documentation License.

  (a) {{{author}}}'s Back-Cover Text is: "You have the freedom to copy and
  modify this libre manual."

