This repository has been archived by the owner on Oct 15, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 365
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #125 from stands4/master
Abbreviations.com IA Fathead Plugin
- Loading branch information
Showing
6 changed files
with
84 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package DDG::Fathead::Abbreviations; | ||
|
||
use DDG::Fathead; | ||
|
||
primary_example_queries "what does ASAP mean"; | ||
|
||
secondary_example_queries | ||
"What does ASAP stand for", | ||
"What is ASAP short for"; | ||
|
||
description "database of acronyms, abbreviations and meanings"; | ||
|
||
name "Abbreviations.com"; | ||
|
||
icon_url "/i/abbreviations.com.ico"; | ||
|
||
source "Abbreviations.com"; | ||
|
||
code_url "https://github.com/duckduckgo/zeroclickinfo-fathead/tree/master/share/fathead/abbreviation_com"; | ||
|
||
topics "everyday", "special_interest"; | ||
|
||
category "reference"; | ||
|
||
attribution | ||
github => ['https://github.com/stands4', 'STANDS4'], | ||
twitter => ['https://twitter.com/justadded', 'STANDS4']; | ||
|
||
1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Dependencies: | ||
|
||
Python 2.6+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
#!/bin/bash | ||
|
||
[ ! -e download ] && mkdir download | ||
|
||
wget -P download -O download/abbr.txt -N 'http://www.abbreviations.com/root/admin/dumpduckexport.php' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# This is the name of the source as people would refer to it, e.g. Wikipedia or PerlDoc | ||
Name: Abbreviations.com | ||
|
||
# This is the base domain where the source pages are located. | ||
Domain: www.abbreviations.com | ||
|
||
# This is what gets put in quotes next to the source | ||
# It can be blank if it is a source with completely general info spanning many types of topics like Facebook. | ||
Type: Abbreviations.com | ||
|
||
# Whether the source is from MediaWiki (1) or not (0). | ||
MediaWiki: 0 | ||
|
||
# Keywords uses to trigger (or prefer) the source over others. | ||
Keywords: acronym, abbreviation, shorthand, stands for, stand for, short for, means |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env python | ||
|
||
def print_line(key, text, url): | ||
print("\t".join([ | ||
key, #1 | ||
"A", #2 | ||
"", #3 | ||
"", #4 | ||
"", #5 | ||
"", #6 | ||
"", #7 | ||
"", #8 | ||
"", #9 | ||
"", #10 | ||
"", #11 | ||
text, #12 | ||
url])) #13 | ||
|
||
with open("download/abbr.txt") as f: | ||
lines = f.readlines() | ||
|
||
for line in lines: | ||
fields = line.split("\t") | ||
|
||
key = fields[0] | ||
text = fields[1] | ||
url = "http://www.abbreviations.com/%s" % (key) | ||
|
||
print_line(key, text, url) #print entry |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/sh | ||
|
||
./parse.py > output.txt |