koryschneider / wikit Goto Github PK
View Code? Open in Web Editor NEWWikipedia summaries from the command line
License: MIT License
Wikipedia summaries from the command line
License: MIT License
/usr/bin/env: ‘node’: No such file or directory
Thanks for that nice little script.
The newlines are not correctly formatted for Mac. The error is
env: node\r: No such file or directory
This can be fixed with solutions posted here: https://stackoverflow.com/questions/30344858/node-script-executable-not-working-on-mac-env-node-r-no-such-file-or-directo
I have tried wikit with some entries like "Gaussian integer" and it did not return anything.
If I try to open in browser using option -b how the wikit know in which browser to open?
I am trying to search for some term working remotely over SSH. No browser will open. How can I force the wikit to open the link in w3m browser?
This should make wikit just print the summaries for all the candidates.
I'm using Wikit with things like no-more-secrets and lolcat to create random walls of text in new and unusual ways. I was using a selection of Wikipedia articles I'd typed in, but got the idea of using Wikipedia's Special:Random feature to try to get random pages. (Details here: https://en.wikipedia.org/wiki/Wikipedia:Special:Random)
Unfortunately, I get an error:
# wikit Special:random
⠙ Searching...wtf_wikipedia error: TypeError: Cannot read property '0' of undefined
Special:random not found :^(
This isn't exactly a vital thing, but I thought I'd post an issue to see if it interests anyone.
Either way, thank you for your interesting tool!
this was built in Zsh for Mac but should run fine if you convert (say) to (espeak) the linux -eq of macs "say" command.
also you would have to do something with var1 it's just a voice selection for mac. I use this more than Siri since I Am always working in my terminal. I am about to add him to my headless ubuntu V.M. I was working on my own way to filter the text from a wiki pull when I found this saved me a bunch of time. Thanks
#!/bin/bash
v1="Daniel"
v3="y"
v4="/Users/~/DarwinAi/result"
v5="sleep .5s"
v6=('y' 'Y' 'yes' 'Yes' 'YEs' 'YES' 'yES' 'yeS')
v7=('n' 'N' 'no' 'No' 'NO' 'No')
repeat (){
read -p "What Is/ Are: " v2
say -v $v1 "I Am searching for info on "$v2""
wikit $v2 > $v4"$v2".txt
say -v $v1 -f $v4"$v2".txt;$v5
rm $v4"$v2".txt
}
say -v $v1 "Hello My Name Is Darwin";$v5
say -v $v1 "I Answer Questions In The Form of What Is"
repeat
until [[ $v3 == $v7 ]]
do
say -v $v1 "Do you have another Question"
read -p "y/n: " v3
if [[ $v3 == "$v6" ]]
then
repeat
elif [[ $v3 == $v7 ]]
then
break
else
say -v $v1 "sorry I do not understand"
fi
done
say -v $v1 "Goodbye"
When I try to do a simple action like :
wiki --lang fr orange
It doesn't show up in the terminal, but it opens a new tab in my Chrome browser.
Specify max line length (e.g. 80) to make reading easier
$ wikit unix epoch
Unix time (also known as POSIX time or epoch time)[citation needed] is a system
for describing instants in time, defined as the number of seconds that have
elapsed since 00:00:00 Coordinated Universal Time (UTC), Thursday, 1 January
1970, minus the number of leap seconds that have taken place since then. It
is used widely in Unix-like and many other operating systems and file formats.
Because the same timestamp can refer to two distinct instants of time around
a leap second, it is neither a linear measure of time nor a true representation
of UTC. Unix time may be checked on most Unix systems by typing date +%s on
the command line.The 32-bit representation of Unix time will end after the completion
of 2,147,483,647 (231 - 1) seconds from the beginning (00:00:00 1 January 1970),
i.e., on 19 January, 2038 03:14:08 GMT. This is referred to as the "Year 2038
problem" where the 32-bit Unix time will overflow and will take the actual count
Last few words got cut off
For example, actually wikit Mato Grosso do Sul
retrieves that exact wikipedia page but wikit mato grosso do sul
does not. Is it ok that uppercase letters matter to match results?
-b
flag still opens in default browser
-b <browser>
to specify browser
Hello a couple of weeks ago I installed wikit.
The command that I used for the installation was:
sudo npm install wikit -g
The answer shown in the terminal was:
npm WARN deprecated [email protected]: the module is now available as 'css-select'
npm WARN deprecated [email protected]: the module is now available as 'css-what'
/usr/local/bin/wikit -> /usr/local/lib/node_modules/wikit/index.js
+ [email protected]
updated 1 package in 11.638s
I assumed that the program had been installed, but when making a query the result was the following:
argo@argo-desktop:~$ wikit Linux
/usr/local/bin/wikit: línea 2: use strict: orden no encontrada
/usr/local/bin/wikit: línea 4: error sintáctico cerca del elemento inesperado (' /usr/local/bin/wikit: línea 4:
const path = require('path'),'
Searching for the Wikipedia Wikipedia page results in an error:
$ wikit wikipedia
⠙ Searching...TypeError: Cannot read property 'substr' of undefined
at Object.trunc (/usr/local/lib/node_modules/wikit/node_modules/wtf_wikipedia/src/templates/formatting/format.js:50:20)
at parseTemplate (/usr/local/lib/node_modules/wikit/node_modules/wtf_wikipedia/src/templates/parse.js:35:30)
at templates.top.forEach.tmpl (/usr/local/lib/node_modules/wikit/node_modules/wtf_wikipedia/src/templates/index.js:35:12)
at Array.forEach (<anonymous>)
at Object.parseTemplates [as templates] (/usr/local/lib/node_modules/wikit/node_modules/wtf_wikipedia/src/templates/index.js:34:17)
at oneSection (/usr/local/lib/node_modules/wikit/node_modules/wtf_wikipedia/src/02-section/index.js:20:16)
at Object.parseSections [as section] (/usr/local/lib/node_modules/wikit/node_modules/wtf_wikipedia/src/02-section/index.js:72:13)
at main (/usr/local/lib/node_modules/wikit/node_modules/wtf_wikipedia/src/01-document/index.js:43:25)
at pages.map.id (/usr/local/lib/node_modules/wikit/node_modules/wtf_wikipedia/src/_fetch/fetch.js:27:14)
at Array.map (<anonymous>)
wtf_wikipedia error: TypeError: Cannot read property 'substr' of undefined
wikipedia not found :^(
I did some testing with old versions, and it seems like this error only occurs in versions 4.1.3 and later.
For example see 'Love apple' under Botany: https://en.wikipedia.org/wiki/Apple_(disambiguation)
If someone wants to tackle this (I don't have the time right now) here is the relevant code.
Wikit does not honor the lang flag when flags like -b, -d or -D are used at the same time. This always opens the English version of the article. Even changing lang default in wikit.json does not change this behaviour. The language I tried this with is German (de). Am I missing something or does this just not work?
/usr/local/lib/node_modules/wikit/index.js:4
const path = require('path'),
^^^^^
SyntaxError: Use of const in strict mode.
at Module._compile (module.js:439:25)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
at startup (node.js:119:16)
at node.js:906:3
hi all
since many wikipedia client have that option, i think it is a good idea to add it here
thanks
$ node index.js test
-> Test, TEST or Tester may refer to:
Interactive menu?
thanks for creating wikit!
Command line disambiguation interface could be something like sdcv dictionary interface:
Works associated with the musical group ABBA
[0] "Mamma Mia" (song), a 1975 ABBA song
[1] Mamma Mia!, a musical based on ABBA songs, which premiered in London in 1999
[2] Mamma Mia! (film), a 2008 film based on the musical
[3] Mamma Mia! Here We Go Again, 2018 film sequel
Other artists
[4] ¡Mamma Mia!, an album by Mexican pop singer Verónica Castro
[5] "Mama Mia" (In-Grid song), a song by the Italian artist In-Grid
[6] "Mamma Mia" (Kara song), a song by the Korean girl group Kara
[7] Mamma Mia! (SF9 EP)
I have tried these commands in gnome terminal to pipe the disambiguation results into a file:
wikit rotation -d --line 80 > list.txt
and
wikit rotation -d --line 80 | cat > list.txt
I want to use this in the following script converted to a text file for safe uploading:
Might you have any idea why the command (on line 13 in the script) keeps running. If I press Ctrl-c the two cli commands and the script terminate successfully!
Thanks!
P.S. I believe I installed wikit with npm, and can't remember for sure whether or not I cloned it from this repository! Sorry!
I want to read articles in two languages. Please, add maybe config file, where it possible to add priority of search, for example:
ru
en
(for first searching in http://ru.wikipedia.org/, and second: https://en.wikipedia.org/)
After using: wikit cia
- i want to see two articles in terminal: firts https://ru.wikipedia.org/wiki/CIA and second https://en.wikipedia.org/wiki/CIA
Thanks!
I have installed wikit using,
sudo npm install wikit -g
command in ubuntu after installing npm. The installation was complete and the program is found in
/usr/local/bin/wikit
But I'm getting the error as mentioned in the title
When searching wikit stroop effect
some HTML appears. For example:
<div style="background:#f9f9f9;border:1px solid #666;float:right;width:50%;padding:1em;margin:0
0 1em 1em;"> Naming the font color of a printed
word is an easier and quicker task if word meaning and
font color are congruent.
I am wondering if I could use this to search my own MediaWiki site?
Hey
Thanks for your great tool!
Any plans to add to homebrew?
As per title.
The program should modify the json file according to the flag passed if there is no query.
I think it would be easier and intuitive to set up
An example:
wikit Linux
Error: no output
Opening in browser...
Hey, I think putting the whole code in one file makes it a bit messy. It would be more maintainable and easy to debug / extend if it was split across multiple sections.
I can submit a PR, if you want ?
If there is a banner with messages relating to page issues (tone, sources etc.) on the wikipedia page, these messages will end up in the wiki summary given by wikit.
Would that be possible to provide the output without line breaks, please?
$ wikit --lang it Giovanni Allevi
Something went wrong, opening in browser... (Error code: 0 | Query: "Giovanni Allevi")
Submit bugs at https://github.com/koryschneider/wikit/issues/new
Just installed on macOS on my first search for a linux
article wikit
crashes
$ sudo npm install wikit -g
npm WARN deprecated [email protected]: the module is now available as 'css-select'
npm WARN deprecated [email protected]: the module is now available as 'css-what'
/usr/local/bin/wikit -> /usr/local/lib/node_modules/wikit/index.js
+ [email protected]
updated 1 package in 3.504s
$ wikit linux
internal/modules/cjs/loader.js:657
throw err;
^
Error: Cannot find module 'inquirer'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:655:15)
at Function.Module._load (internal/modules/cjs/loader.js:580:25)
at Module.require (internal/modules/cjs/loader.js:711:19)
at require (internal/modules/cjs/helpers.js:14:16)
at require.page.data (/usr/local/lib/node_modules/wikit/index.js:170:9)
at /usr/local/lib/node_modules/wikit/node_modules/node-wikipedia/lib/page.js:32:3
at Request._callback (/usr/local/lib/node_modules/wikit/node_modules/node-wikipedia/lib/dial.js:32:5)
at Request.self.callback (/usr/local/lib/node_modules/wikit/node_modules/request/request.js:185:22)
at Request.emit (events.js:193:13)
at Request.<anonymous> (/usr/local/lib/node_modules/wikit/node_modules/request/request.js:1161:10)
$ npm --version
6.7.0
$ node --version
v11.13.0
$ sw_vers
ProductName: Mac OS X
ProductVersion: 10.13.6
BuildVersion: 17G3025
Could you write a program to get $words definitions from the Wikidictionary - in many languages - as well? I liked your application so much!
Thx for that.
:)
Very nice work! I have some suggestions and feature requests:
-d
option for the disambiguation page. Maybe a numbered list to be selected? https://en.wikipedia.org/wiki/Root_(disambiguation)-s
option for listing the sections so they can be selected. This would be really cool.wikit polynomial
has an equation in the first paragraph. This would also help printing sections, e.g., to get a quick reference to an equation.Cheers
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.