web-dev-qa-db-fra.com

Visionneuse Wikipedia pour tty

Je me demande s'il existe une commande pour récupérer "l'introduction" (et peut-être l'article complet) d'une entrée Wikipedia sur un terminal.

J'ai trouvé cet article et beaucoup d'articles redirigeant vers lui, mais malheureusement lors de l'exécution de cela dans la console, cela donne:

$ Dig +short txt fooba.wp.dg.cx
$

Il se termine avec le code 0 donc pas d'erreur, mais ça ne montre rien non plus.

Existe-t-il des commandes de requête Wikipedia pour Linux. J'utilise lynx pour naviguer sur Internet, mais parfois vous voulez simplement récupérer l'introduction rapidement et y faire un peu de traitement.

2
Willem Van Onsem

Eh bien, en regardant autour:

$ apt search wikipedia              
Sorting... Done
Full Text Search... Done
libwww-wikipedia-Perl/trusty 2.00-1 all
  Perl module that provides an automated interface to Wikipedia

wikipedia2text/trusty,now 0.11-3 all [installed]
  displays Wikipedia articles on the command line

wikipediafs/trusty 0.4-5 all
  View and edit Wikipedia articles as if they were real files

En regardant la page de manuel de wikepedia2text :

-s        Display only the summary of the Wikipedia article.

-S        Display the full content of the  Wikipedia  article  and  not
          only the summary.

Le tester:

$ wikipedia2text -s Linux
Changes must be reviewed before being displayed on this page.show/hide details
This is the latest accepted revision, reviewed on 17 September 2015.
Jump to: navigation, search
This article is about the operating system. For the kernel (also often referred
to as just "Linux"), used in all variants of the Linux operating system, see
Linux kernel. For other uses, see Linux (disambiguation).

                                     Linux
Tux the penguin
Tux the penguin, mascot of Linux^
Developer Community
 Written  Primarily C and Assembly
   in
OS family Unix-like
 Working  Current
  state
 Source   Mainly open source, proprietary software also available


$ wikipedia2text Linux   
Page protected with pending changes level 1

Linux

From Wikipedia, the free encyclopedia
Changes must be reviewed before being displayed on this page.show/hide details
This is the latest accepted revision, reviewed on 17 September 2015.
Jump to: navigation, search
This article is about the operating system. For the kernel (also often referred
to as just "Linux"), used in all variants of the Linux operating system, see
Linux kernel. For other uses, see Linux (disambiguation).

                                     Linux
Tux the penguin
Tux the penguin, mascot of Linux^
Developer Community
 Written  Primarily C and Assembly
   in
OS family Unix-like
 Working  Current
  state
 Source   Mainly open source, proprietary software also available
  model
 Initial  1991; 24 years ago (1991)
 release
Marketing Personal computers, mobile devices, embedded devices, servers,
 target   mainframes, supercomputers
Available Multilingual
   in
          Alpha, ARC, ARM, AVR32, Blackfin, C6x, ETRAX CRIS, FR-V, H8/300,
Platforms Hexagon, Itanium, M32R, m68k, META, Microblaze, MIPS, MN103, Nios II,
          OpenRISC, PA-RISC, PowerPC, s390, S+core, SuperH, SPARC, TILE64,
          Unicore32, x86, Xtensa
 Kernel   Monolithic (Linux kernel)
  type
Userland  Various
Default
  user    Many
interface
 License  GPLv2^ and other free and open-source licenses, except for the
          "Linux" trademark^[a]

...
4
muru

Il est possible de télécharger des articles wikipedia via leurs versions gopherized.

Voici un exemple tirant l'article sur sed:

lynx -dump Gopher://gopherpedia.com/0/sed | less -  

De plus, si l'article doit être recherché, accédez à la page principale:

lynx Gopher://gopherpedia.com/1

Ou directement à la recherche:

lynx Gopher://gopherpedia.com/7/lookup 
0
DC Slagel