[GithubTrendingBridge] Fix bridge: not all languages worked (#1615)

* [GithubTrendingBridge] Fix bridge: not all languages worked

Languages with more than one word (like "Common Lisp") were not working. Looks like GitHub changed the parameter format: white space is encoded with dashes.

This prompted me to update all languages while I was at it. This also fixed the bug that the C# & F# languages were not working, because the # has to be URL encoded, which is now done in the parameter value. The language "Ren'Py" was commented out. Probably because the single quote was not escaped? I also fixed that.

* [GithubTrendingBridge] Fix PHP notice.

A repo owner can leave the repo description empty, which means the HTML element isn't there. In this case the code produced a PHP notice. This is fixed by checking for null.

* Changed getName() to retrieve the language name directly from the PARAMETERS.

Co-authored-by: dag <me@dvikan.no>
This commit is contained in:
Michael Bemmerl 2022-03-29 18:15:18 +00:00 committed by GitHub
parent 58f9e41e0b
commit 6d4155f995
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 126 additions and 130 deletions

View File

@ -8,41 +8,39 @@ class GithubTrendingBridge extends BridgeAbstract {
const CACHE_TIMEOUT = 43200; // 12hr const CACHE_TIMEOUT = 43200; // 12hr
const DESCRIPTION = 'See what the GitHub community is most excited repos.'; const DESCRIPTION = 'See what the GitHub community is most excited repos.';
const PARAMETERS = array( const PARAMETERS = array(
// If you are changing context and/or parameter names, change them also in getName().
'By language' => array( 'By language' => array(
'language' => array( 'language' => array(
'name' => 'Select language', 'name' => 'Select language',
'type' => 'list', 'type' => 'list',
'values' => array( 'values' => array(
'All languages' => '', 'All languages' => '',
'C++' => 'c++',
'HTML' => 'html', 'HTML' => 'html',
'Java' => 'java',
'JavaScript' => 'javascript',
'PHP' => 'php', 'PHP' => 'php',
'Python' => 'python', 'Python' => 'python',
'Ruby' => 'ruby', 'Shell' => 'shell',
'Unknown languages' => 'unknown languages', 'Unknown languages' => 'unknown',
'1C Enterprise' => '1c enterprise', '1C Enterprise' => '1c-enterprise',
'4D' => '4d', '4D' => '4d',
'ABAP' => 'abap', 'ABAP' => 'abap',
'ABNF' => 'abnf', 'ABNF' => 'abnf',
'ActionScript' => 'actionscript', 'ActionScript' => 'actionscript',
'Ada' => 'ada', 'Ada' => 'ada',
'Adobe Font Metrics' => 'adobe font metrics', 'Adobe Font Metrics' => 'adobe-font-metrics',
'Agda' => 'agda', 'Agda' => 'agda',
'AGS Script' => 'ags script', 'AGS Script' => 'ags-script',
'Alloy' => 'alloy', 'Alloy' => 'alloy',
'Alpine Abuild' => 'alpine abuild', 'Alpine Abuild' => 'alpine-abuild',
'Altium Designer' => 'altium designer', 'Altium Designer' => 'altium-designer',
'AMPL' => 'ampl', 'AMPL' => 'ampl',
'AngelScript' => 'angelscript', 'AngelScript' => 'angelscript',
'Ant Build System' => 'ant build system', 'Ant Build System' => 'ant-build-system',
'ANTLR' => 'antlr', 'ANTLR' => 'antlr',
'ApacheConf' => 'apacheconf', 'ApacheConf' => 'apacheconf',
'Apex' => 'apex', 'Apex' => 'apex',
'API Blueprint' => 'api blueprint', 'API Blueprint' => 'api-blueprint',
'APL' => 'apl', 'APL' => 'apl',
'Apollo Guidance Computer' => 'apollo guidance computer', 'Apollo Guidance Computer' => 'apollo-guidance-computer',
'AppleScript' => 'applescript', 'AppleScript' => 'applescript',
'Arc' => 'arc', 'Arc' => 'arc',
'AsciiDoc' => 'asciidoc', 'AsciiDoc' => 'asciidoc',
@ -71,11 +69,12 @@ class GithubTrendingBridge extends BridgeAbstract {
'Brightscript' => 'brightscript', 'Brightscript' => 'brightscript',
'Zeek' => 'zeek', 'Zeek' => 'zeek',
'C' => 'c', 'C' => 'c',
'C#' => 'c#', 'C#' => 'c%23', // already URL encoded
'C++' => 'c++', 'C++' => 'c++',
'C-ObjDump' => 'c-objdump', 'C-ObjDump' => 'c-objdump',
'C2hs Haskell' => 'c2hs haskell', 'C2hs Haskell' => 'c2hs-haskell',
'Cabal Config' => 'cabal config', 'Cabal Config' => 'cabal-config',
'Cap\'n Proto' => 'cap\'n-proto',
'CartoCSS' => 'cartocss', 'CartoCSS' => 'cartocss',
'Ceylon' => 'ceylon', 'Ceylon' => 'ceylon',
'Chapel' => 'chapel', 'Chapel' => 'chapel',
@ -87,18 +86,18 @@ class GithubTrendingBridge extends BridgeAbstract {
'Click' => 'click', 'Click' => 'click',
'CLIPS' => 'clips', 'CLIPS' => 'clips',
'Clojure' => 'clojure', 'Clojure' => 'clojure',
'Closure Templates' => 'closure templates', 'Closure Templates' => 'closure-templates',
'Cloud Firestore Security Rules' => 'cloud firestore security rules', 'Cloud Firestore Security Rules' => 'cloud-firestore-security-rules',
'CMake' => 'cmake', 'CMake' => 'cmake',
'COBOL' => 'cobol', 'COBOL' => 'cobol',
'CodeQL' => 'codeql', 'CodeQL' => 'codeql',
'CoffeeScript' => 'coffeescript', 'CoffeeScript' => 'coffeescript',
'ColdFusion' => 'coldfusion', 'ColdFusion' => 'coldfusion',
'ColdFusion CFC' => 'coldfusion cfc', 'ColdFusion CFC' => 'coldfusion-cfc',
'COLLADA' => 'collada', 'COLLADA' => 'collada',
'Common Lisp' => 'common lisp', 'Common Lisp' => 'common-lisp',
'Common Workflow Language' => 'common workflow language', 'Common Workflow Language' => 'common-workflow-language',
'Component Pascal' => 'component pascal', 'Component Pascal' => 'component-pascal',
'CoNLL-U' => 'conll-u', 'CoNLL-U' => 'conll-u',
'Cool' => 'cool', 'Cool' => 'cool',
'Coq' => 'coq', 'Coq' => 'coq',
@ -107,28 +106,28 @@ class GithubTrendingBridge extends BridgeAbstract {
'Crystal' => 'crystal', 'Crystal' => 'crystal',
'CSON' => 'cson', 'CSON' => 'cson',
'Csound' => 'csound', 'Csound' => 'csound',
'Csound Document' => 'csound document', 'Csound Document' => 'csound-document',
'Csound Score' => 'csound score', 'Csound Score' => 'csound-score',
'CSS' => 'css', 'CSS' => 'css',
'CSV' => 'csv', 'CSV' => 'csv',
'Cuda' => 'cuda', 'Cuda' => 'cuda',
'cURL Config' => 'curl config', 'cURL Config' => 'curl-config',
'CWeb' => 'cweb', 'CWeb' => 'cweb',
'Cycript' => 'cycript', 'Cycript' => 'cycript',
'Cython' => 'cython', 'Cython' => 'cython',
'D' => 'd', 'D' => 'd',
'D-ObjDump' => 'd-objdump', 'D-ObjDump' => 'd-objdump',
'Darcs Patch' => 'darcs patch', 'Darcs Patch' => 'darcs-patch',
'Dart' => 'dart', 'Dart' => 'dart',
'DataWeave' => 'dataweave', 'DataWeave' => 'dataweave',
'desktop' => 'desktop', 'desktop' => 'desktop',
'Dhall' => 'dhall', 'Dhall' => 'dhall',
'Diff' => 'diff', 'Diff' => 'diff',
'DIGITAL Command Language' => 'digital command language', 'DIGITAL Command Language' => 'digital-command-language',
'dircolors' => 'dircolors', 'dircolors' => 'dircolors',
'DirectX 3D File' => 'directx 3d file', 'DirectX 3D File' => 'directx-3d-file',
'DM' => 'dm', 'DM' => 'dm',
'DNS Zone' => 'dns zone', 'DNS Zone' => 'dns-zone',
'Dockerfile' => 'dockerfile', 'Dockerfile' => 'dockerfile',
'Dogescript' => 'dogescript', 'Dogescript' => 'dogescript',
'DTrace' => 'dtrace', 'DTrace' => 'dtrace',
@ -138,29 +137,29 @@ class GithubTrendingBridge extends BridgeAbstract {
'Easybuild' => 'easybuild', 'Easybuild' => 'easybuild',
'EBNF' => 'ebnf', 'EBNF' => 'ebnf',
'eC' => 'ec', 'eC' => 'ec',
'Ecere Projects' => 'ecere projects', 'Ecere Projects' => 'ecere-projects',
'ECL' => 'ecl', 'ECL' => 'ecl',
'ECLiPSe' => 'eclipse', 'ECLiPSe' => 'eclipse',
'EditorConfig' => 'editorconfig', 'EditorConfig' => 'editorconfig',
'Edje Data Collection' => 'edje data collection', 'Edje Data Collection' => 'edje-data-collection',
'edn' => 'edn', 'edn' => 'edn',
'Eiffel' => 'eiffel', 'Eiffel' => 'eiffel',
'EJS' => 'ejs', 'EJS' => 'ejs',
'Elixir' => 'elixir', 'Elixir' => 'elixir',
'Elm' => 'elm', 'Elm' => 'elm',
'Emacs Lisp' => 'emacs lisp', 'Emacs Lisp' => 'emacs-lisp',
'EmberScript' => 'emberscript', 'EmberScript' => 'emberscript',
'EML' => 'eml', 'EML' => 'eml',
'EQ' => 'eq', 'EQ' => 'eq',
'Erlang' => 'erlang', 'Erlang' => 'erlang',
'F#' => 'f#', 'F#' => 'f%23', // already URL encoded
'F*' => 'f*', 'F*' => 'f*',
'Factor' => 'factor', 'Factor' => 'factor',
'Fancy' => 'fancy', 'Fancy' => 'fancy',
'Fantom' => 'fantom', 'Fantom' => 'fantom',
'Faust' => 'faust', 'Faust' => 'faust',
'FIGlet Font' => 'figlet font', 'FIGlet Font' => 'figlet-font',
'Filebench WML' => 'filebench wml', 'Filebench WML' => 'filebench-wml',
'Filterscript' => 'filterscript', 'Filterscript' => 'filterscript',
'fish' => 'fish', 'fish' => 'fish',
'FLUX' => 'flux', 'FLUX' => 'flux',
@ -170,25 +169,25 @@ class GithubTrendingBridge extends BridgeAbstract {
'FreeMarker' => 'freemarker', 'FreeMarker' => 'freemarker',
'Frege' => 'frege', 'Frege' => 'frege',
'G-code' => 'g-code', 'G-code' => 'g-code',
'Game Maker Language' => 'game maker language', 'Game Maker Language' => 'game-maker-language',
'GAML' => 'gaml', 'GAML' => 'gaml',
'GAMS' => 'gams', 'GAMS' => 'gams',
'GAP' => 'gap', 'GAP' => 'gap',
'GCC Machine Description' => 'gcc machine description', 'GCC Machine Description' => 'gcc-machine-description',
'GDB' => 'gdb', 'GDB' => 'gdb',
'GDScript' => 'gdscript', 'GDScript' => 'gdscript',
'Genie' => 'genie', 'Genie' => 'genie',
'Genshi' => 'genshi', 'Genshi' => 'genshi',
'Gentoo Ebuild' => 'gentoo ebuild', 'Gentoo Ebuild' => 'gentoo-ebuild',
'Gentoo Eclass' => 'gentoo eclass', 'Gentoo Eclass' => 'gentoo-eclass',
'Gerber Image' => 'gerber image', 'Gerber Image' => 'gerber-image',
'Gettext Catalog' => 'gettext catalog', 'Gettext Catalog' => 'gettext-catalog',
'Gherkin' => 'gherkin', 'Gherkin' => 'gherkin',
'Git Attributes' => 'git attributes', 'Git Attributes' => 'git-attributes',
'Git Config' => 'git config', 'Git Config' => 'git-config',
'GLSL' => 'glsl', 'GLSL' => 'glsl',
'Glyph' => 'glyph', 'Glyph' => 'glyph',
'Glyph Bitmap Distribution Format' => 'glyph bitmap distribution format', 'Glyph Bitmap Distribution Format' => 'glyph-bitmap-distribution-format',
'GN' => 'gn', 'GN' => 'gn',
'Gnuplot' => 'gnuplot', 'Gnuplot' => 'gnuplot',
'Go' => 'go', 'Go' => 'go',
@ -196,12 +195,12 @@ class GithubTrendingBridge extends BridgeAbstract {
'Gosu' => 'gosu', 'Gosu' => 'gosu',
'Grace' => 'grace', 'Grace' => 'grace',
'Gradle' => 'gradle', 'Gradle' => 'gradle',
'Grammatical Framework' => 'grammatical framework', 'Grammatical Framework' => 'grammatical-framework',
'Graph Modeling Language' => 'graph modeling language', 'Graph Modeling Language' => 'graph-modeling-language',
'GraphQL' => 'graphql', 'GraphQL' => 'graphql',
'Graphviz (DOT)' => 'graphviz (dot)', 'Graphviz (DOT)' => 'graphviz-(dot)',
'Groovy' => 'groovy', 'Groovy' => 'groovy',
'Groovy Server Pages' => 'groovy server pages', 'Groovy Server Pages' => 'groovy-server-pages',
'Hack' => 'hack', 'Hack' => 'hack',
'Haml' => 'haml', 'Haml' => 'haml',
'Handlebars' => 'handlebars', 'Handlebars' => 'handlebars',
@ -213,7 +212,6 @@ class GithubTrendingBridge extends BridgeAbstract {
'HiveQL' => 'hiveql', 'HiveQL' => 'hiveql',
'HLSL' => 'hlsl', 'HLSL' => 'hlsl',
'HolyC' => 'holyc', 'HolyC' => 'holyc',
'HTML' => 'html',
'HTML+Django' => 'html+django', 'HTML+Django' => 'html+django',
'HTML+ECR' => 'html+ecr', 'HTML+ECR' => 'html+ecr',
'HTML+EEX' => 'html+eex', 'HTML+EEX' => 'html+eex',
@ -226,39 +224,39 @@ class GithubTrendingBridge extends BridgeAbstract {
'HyPhy' => 'hyphy', 'HyPhy' => 'hyphy',
'IDL' => 'idl', 'IDL' => 'idl',
'Idris' => 'idris', 'Idris' => 'idris',
'Ignore List' => 'ignore list', 'Ignore List' => 'ignore-list',
'IGOR Pro' => 'igor pro', 'IGOR Pro' => 'igor-pro',
'Inform 7' => 'inform 7', 'Inform 7' => 'inform-7',
'INI' => 'ini', 'INI' => 'ini',
'Inno Setup' => 'inno setup', 'Inno Setup' => 'inno-setup',
'Io' => 'io', 'Io' => 'io',
'Ioke' => 'ioke', 'Ioke' => 'ioke',
'IRC log' => 'irc log', 'IRC log' => 'irc-log',
'Isabelle' => 'isabelle', 'Isabelle' => 'isabelle',
'Isabelle ROOT' => 'isabelle root', 'Isabelle ROOT' => 'isabelle-root',
'J' => 'j', 'J' => 'j',
'Jasmin' => 'jasmin', 'Jasmin' => 'jasmin',
'Java' => 'java', 'Java' => 'java',
'Java Properties' => 'java properties', 'Java Properties' => 'java-properties',
'Java Server Pages' => 'java server pages', 'Java Server Pages' => 'java-server-pages',
'JavaScript' => 'javascript', 'JavaScript' => 'javascript',
'JavaScript+ERB' => 'javascript+erb', 'JavaScript+ERB' => 'javascript+erb',
'JFlex' => 'jflex', 'JFlex' => 'jflex',
'Jison' => 'jison', 'Jison' => 'jison',
'Jison Lex' => 'jison lex', 'Jison Lex' => 'jison-lex',
'Jolie' => 'jolie', 'Jolie' => 'jolie',
'JSON' => 'json', 'JSON' => 'json',
'JSON with Comments' => 'json with comments', 'JSON with Comments' => 'json-with-comments',
'JSON5' => 'json5', 'JSON5' => 'json5',
'JSONiq' => 'jsoniq', 'JSONiq' => 'jsoniq',
'JSONLD' => 'jsonld', 'JSONLD' => 'jsonld',
'Jsonnet' => 'jsonnet', 'Jsonnet' => 'jsonnet',
'JSX' => 'jsx', 'JSX' => 'jsx',
'Julia' => 'julia', 'Julia' => 'julia',
'Jupyter Notebook' => 'jupyter notebook', 'Jupyter Notebook' => 'jupyter-notebook',
'KiCad Layout' => 'kicad layout', 'KiCad Layout' => 'kicad-layout',
'KiCad Legacy Layout' => 'kicad legacy layout', 'KiCad Legacy Layout' => 'kicad-legacy-layout',
'KiCad Schematic' => 'kicad schematic', 'KiCad Schematic' => 'kicad-schematic',
'Kit' => 'kit', 'Kit' => 'kit',
'Kotlin' => 'kotlin', 'Kotlin' => 'kotlin',
'KRL' => 'krl', 'KRL' => 'krl',
@ -271,12 +269,12 @@ class GithubTrendingBridge extends BridgeAbstract {
'LFE' => 'lfe', 'LFE' => 'lfe',
'LilyPond' => 'lilypond', 'LilyPond' => 'lilypond',
'Limbo' => 'limbo', 'Limbo' => 'limbo',
'Linker Script' => 'linker script', 'Linker Script' => 'linker-script',
'Linux Kernel Module' => 'linux kernel module', 'Linux Kernel Module' => 'linux-kernel-module',
'Liquid' => 'liquid', 'Liquid' => 'liquid',
'Literate Agda' => 'literate agda', 'Literate Agda' => 'literate-agda',
'Literate CoffeeScript' => 'literate coffeescript', 'Literate CoffeeScript' => 'literate-coffeescript',
'Literate Haskell' => 'literate haskell', 'Literate Haskell' => 'literate-haskell',
'LiveScript' => 'livescript', 'LiveScript' => 'livescript',
'LLVM' => 'llvm', 'LLVM' => 'llvm',
'Logos' => 'logos', 'Logos' => 'logos',
@ -285,7 +283,7 @@ class GithubTrendingBridge extends BridgeAbstract {
'LookML' => 'lookml', 'LookML' => 'lookml',
'LoomScript' => 'loomscript', 'LoomScript' => 'loomscript',
'LSL' => 'lsl', 'LSL' => 'lsl',
'LTspice Symbol' => 'ltspice symbol', 'LTspice Symbol' => 'ltspice-symbol',
'Lua' => 'lua', 'Lua' => 'lua',
'M' => 'm', 'M' => 'm',
'M4' => 'm4', 'M4' => 'm4',
@ -297,7 +295,7 @@ class GithubTrendingBridge extends BridgeAbstract {
'Mask' => 'mask', 'Mask' => 'mask',
'Mathematica' => 'mathematica', 'Mathematica' => 'mathematica',
'MATLAB' => 'matlab', 'MATLAB' => 'matlab',
'Maven POM' => 'maven pom', 'Maven POM' => 'maven-pom',
'Max' => 'max', 'Max' => 'max',
'MAXScript' => 'maxscript', 'MAXScript' => 'maxscript',
'mcfunction' => 'mcfunction', 'mcfunction' => 'mcfunction',
@ -305,19 +303,19 @@ class GithubTrendingBridge extends BridgeAbstract {
'Mercury' => 'mercury', 'Mercury' => 'mercury',
'Meson' => 'meson', 'Meson' => 'meson',
'Metal' => 'metal', 'Metal' => 'metal',
'Microsoft Developer Studio Project' => 'microsoft developer studio project', 'Microsoft Developer Studio Project' => 'microsoft-developer-studio-project',
'MiniD' => 'minid', 'MiniD' => 'minid',
'Mirah' => 'mirah', 'Mirah' => 'mirah',
'mIRC Script' => 'mirc script', 'mIRC Script' => 'mirc-script',
'MLIR' => 'mlir', 'MLIR' => 'mlir',
'Modelica' => 'modelica', 'Modelica' => 'modelica',
'Modula-2' => 'modula-2', 'Modula-2' => 'modula-2',
'Modula-3' => 'modula-3', 'Modula-3' => 'modula-3',
'Module Management System' => 'module management system', 'Module Management System' => 'module-management-system',
'Monkey' => 'monkey', 'Monkey' => 'monkey',
'Moocode' => 'moocode', 'Moocode' => 'moocode',
'MoonScript' => 'moonscript', 'MoonScript' => 'moonscript',
'Motorola 68K Assembly' => 'motorola 68k assembly', 'Motorola 68K Assembly' => 'motorola-68k-assembly',
'MQL4' => 'mql4', 'MQL4' => 'mql4',
'MQL5' => 'mql5', 'MQL5' => 'mql5',
'MTML' => 'mtml', 'MTML' => 'mtml',
@ -342,12 +340,12 @@ class GithubTrendingBridge extends BridgeAbstract {
'Nit' => 'nit', 'Nit' => 'nit',
'Nix' => 'nix', 'Nix' => 'nix',
'NL' => 'nl', 'NL' => 'nl',
'NPM Config' => 'npm config', 'NPM Config' => 'npm-config',
'NSIS' => 'nsis', 'NSIS' => 'nsis',
'Nu' => 'nu', 'Nu' => 'nu',
'NumPy' => 'numpy', 'NumPy' => 'numpy',
'ObjDump' => 'objdump', 'ObjDump' => 'objdump',
'Object Data Instance Notation' => 'object data instance notation', 'Object Data Instance Notation' => 'object-data-instance-notation',
'Objective-C' => 'objective-c', 'Objective-C' => 'objective-c',
'Objective-C++' => 'objective-c++', 'Objective-C++' => 'objective-c++',
'Objective-J' => 'objective-j', 'Objective-J' => 'objective-j',
@ -358,14 +356,14 @@ class GithubTrendingBridge extends BridgeAbstract {
'ooc' => 'ooc', 'ooc' => 'ooc',
'Opa' => 'opa', 'Opa' => 'opa',
'Opal' => 'opal', 'Opal' => 'opal',
'Open Policy Agent' => 'open policy agent', 'Open Policy Agent' => 'open-policy-agent',
'OpenCL' => 'opencl', 'OpenCL' => 'opencl',
'OpenEdge ABL' => 'openedge abl', 'OpenEdge ABL' => 'openedge-abl',
'OpenQASM' => 'openqasm', 'OpenQASM' => 'openqasm',
'OpenRC runscript' => 'openrc runscript', 'OpenRC runscript' => 'openrc-runscript',
'OpenSCAD' => 'openscad', 'OpenSCAD' => 'openscad',
'OpenStep Property List' => 'openstep property list', 'OpenStep Property List' => 'openstep-property-list',
'OpenType Feature File' => 'opentype feature file', 'OpenType Feature File' => 'opentype-feature-file',
'Org' => 'org', 'Org' => 'org',
'Ox' => 'ox', 'Ox' => 'ox',
'Oxygene' => 'oxygene', 'Oxygene' => 'oxygene',
@ -374,13 +372,12 @@ class GithubTrendingBridge extends BridgeAbstract {
'Pan' => 'pan', 'Pan' => 'pan',
'Papyrus' => 'papyrus', 'Papyrus' => 'papyrus',
'Parrot' => 'parrot', 'Parrot' => 'parrot',
'Parrot Assembly' => 'parrot assembly', 'Parrot Assembly' => 'parrot-assembly',
'Parrot Internal Representation' => 'parrot internal representation', 'Parrot Internal Representation' => 'parrot-internal-representation',
'Pascal' => 'pascal', 'Pascal' => 'pascal',
'Pawn' => 'pawn', 'Pawn' => 'pawn',
'Pep8' => 'pep8', 'Pep8' => 'pep8',
'Perl' => 'perl', 'Perl' => 'perl',
'PHP' => 'php',
'Pic' => 'pic', 'Pic' => 'pic',
'Pickle' => 'pickle', 'Pickle' => 'pickle',
'PicoLisp' => 'picolisp', 'PicoLisp' => 'picolisp',
@ -389,29 +386,28 @@ class GithubTrendingBridge extends BridgeAbstract {
'PLpgSQL' => 'plpgsql', 'PLpgSQL' => 'plpgsql',
'PLSQL' => 'plsql', 'PLSQL' => 'plsql',
'Pod' => 'pod', 'Pod' => 'pod',
'Pod 6' => 'pod 6', 'Pod 6' => 'pod-6',
'PogoScript' => 'pogoscript', 'PogoScript' => 'pogoscript',
'Pony' => 'pony', 'Pony' => 'pony',
'PostCSS' => 'postcss', 'PostCSS' => 'postcss',
'PostScript' => 'postscript', 'PostScript' => 'postscript',
'POV-Ray SDL' => 'pov-ray sdl', 'POV-Ray SDL' => 'pov-ray-sdl',
'PowerBuilder' => 'powerbuilder', 'PowerBuilder' => 'powerbuilder',
'PowerShell' => 'powershell', 'PowerShell' => 'powershell',
'Prisma' => 'prisma', 'Prisma' => 'prisma',
'Processing' => 'processing', 'Processing' => 'processing',
'Proguard' => 'proguard', 'Proguard' => 'proguard',
'Prolog' => 'prolog', 'Prolog' => 'prolog',
'Propeller Spin' => 'propeller spin', 'Propeller Spin' => 'propeller-spin',
'Protocol Buffer' => 'protocol buffer', 'Protocol Buffer' => 'protocol-buffer',
'Public Key' => 'public key', 'Public Key' => 'public-key',
'Pug' => 'pug', 'Pug' => 'pug',
'Puppet' => 'puppet', 'Puppet' => 'puppet',
'Pure Data' => 'pure data', 'Pure Data' => 'pure-data',
'PureBasic' => 'purebasic', 'PureBasic' => 'purebasic',
'PureScript' => 'purescript', 'PureScript' => 'purescript',
'Python' => 'python', 'Python console' => 'python-console',
'Python console' => 'python console', 'Python traceback' => 'python-traceback',
'Python traceback' => 'python traceback',
'q' => 'q', 'q' => 'q',
'QMake' => 'qmake', 'QMake' => 'qmake',
'QML' => 'qml', 'QML' => 'qml',
@ -422,30 +418,30 @@ class GithubTrendingBridge extends BridgeAbstract {
'Raku' => 'raku', 'Raku' => 'raku',
'RAML' => 'raml', 'RAML' => 'raml',
'Rascal' => 'rascal', 'Rascal' => 'rascal',
'Raw token data' => 'raw token data', 'Raw token data' => 'raw-token-data',
'RDoc' => 'rdoc', 'RDoc' => 'rdoc',
'Readline Config' => 'readline config', 'Readline Config' => 'readline-config',
'REALbasic' => 'realbasic', 'REALbasic' => 'realbasic',
'Reason' => 'reason', 'Reason' => 'reason',
'Rebol' => 'rebol', 'Rebol' => 'rebol',
'Red' => 'red', 'Red' => 'red',
'Redcode' => 'redcode', 'Redcode' => 'redcode',
'Regular Expression' => 'regular expression', 'Regular Expression' => 'regular-expression',
// 'Ren'Py' => 'ren'py', 'Ren\'Py' => 'ren\'py',
'RenderScript' => 'renderscript', 'RenderScript' => 'renderscript',
'reStructuredText' => 'restructuredtext', 'reStructuredText' => 'restructuredtext',
'REXX' => 'rexx', 'REXX' => 'rexx',
'RHTML' => 'rhtml', 'RHTML' => 'rhtml',
'Rich Text Format' => 'rich text format', 'Rich Text Format' => 'rich-text-format',
'Ring' => 'ring', 'Ring' => 'ring',
'Riot' => 'riot', 'Riot' => 'riot',
'RMarkdown' => 'rmarkdown', 'RMarkdown' => 'rmarkdown',
'RobotFramework' => 'robotframework', 'RobotFramework' => 'robotframework',
'Roff' => 'roff', 'Roff' => 'roff',
'Roff Manpage' => 'roff manpage', 'Roff Manpage' => 'roff-manpage',
'Rouge' => 'rouge', 'Rouge' => 'rouge',
'RPC' => 'rpc', 'RPC' => 'rpc',
'RPM Spec' => 'rpm spec', 'RPM Spec' => 'rpm-spec',
'Ruby' => 'ruby', 'Ruby' => 'ruby',
'RUNOFF' => 'runoff', 'RUNOFF' => 'runoff',
'Rust' => 'rust', 'Rust' => 'rust',
@ -461,7 +457,6 @@ class GithubTrendingBridge extends BridgeAbstract {
'sed' => 'sed', 'sed' => 'sed',
'Self' => 'self', 'Self' => 'self',
'ShaderLab' => 'shaderlab', 'ShaderLab' => 'shaderlab',
'Shell' => 'shell',
'ShellSession' => 'shellsession', 'ShellSession' => 'shellsession',
'Shen' => 'shen', 'Shen' => 'shen',
'Slash' => 'slash', 'Slash' => 'slash',
@ -475,20 +470,20 @@ class GithubTrendingBridge extends BridgeAbstract {
'Solidity' => 'solidity', 'Solidity' => 'solidity',
'SourcePawn' => 'sourcepawn', 'SourcePawn' => 'sourcepawn',
'SPARQL' => 'sparql', 'SPARQL' => 'sparql',
'Spline Font Database' => 'spline font database', 'Spline Font Database' => 'spline-font-database',
'SQF' => 'sqf', 'SQF' => 'sqf',
'SQL' => 'sql', 'SQL' => 'sql',
'SQLPL' => 'sqlpl', 'SQLPL' => 'sqlpl',
'Squirrel' => 'squirrel', 'Squirrel' => 'squirrel',
'SRecode Template' => 'srecode template', 'SRecode Template' => 'srecode-template',
'SSH Config' => 'ssh config', 'SSH Config' => 'ssh-config',
'Stan' => 'stan', 'Stan' => 'stan',
'Standard ML' => 'standard ml', 'Standard ML' => 'standard-ml',
'Starlark' => 'starlark', 'Starlark' => 'starlark',
'Stata' => 'stata', 'Stata' => 'stata',
'STON' => 'ston', 'STON' => 'ston',
'Stylus' => 'stylus', 'Stylus' => 'stylus',
'SubRip Text' => 'subrip text', 'SubRip Text' => 'subrip-text',
'SugarSS' => 'sugarss', 'SugarSS' => 'sugarss',
'SuperCollider' => 'supercollider', 'SuperCollider' => 'supercollider',
'Svelte' => 'svelte', 'Svelte' => 'svelte',
@ -505,7 +500,7 @@ class GithubTrendingBridge extends BridgeAbstract {
'Text' => 'text', 'Text' => 'text',
'Textile' => 'textile', 'Textile' => 'textile',
'Thrift' => 'thrift', 'Thrift' => 'thrift',
'TI Program' => 'ti program', 'TI Program' => 'ti-program',
'TLA' => 'tla', 'TLA' => 'tla',
'TOML' => 'toml', 'TOML' => 'toml',
'TSQL' => 'tsql', 'TSQL' => 'tsql',
@ -514,11 +509,11 @@ class GithubTrendingBridge extends BridgeAbstract {
'Turtle' => 'turtle', 'Turtle' => 'turtle',
'Twig' => 'twig', 'Twig' => 'twig',
'TXL' => 'txl', 'TXL' => 'txl',
'Type Language' => 'type language', 'Type Language' => 'type-language',
'TypeScript' => 'typescript', 'TypeScript' => 'typescript',
'Unified Parallel C' => 'unified parallel c', 'Unified Parallel C' => 'unified-parallel-c',
'Unity3D Asset' => 'unity3d asset', 'Unity3D Asset' => 'unity3d-asset',
'Unix Assembly' => 'unix assembly', 'Unix Assembly' => 'unix-assembly',
'Uno' => 'uno', 'Uno' => 'uno',
'UnrealScript' => 'unrealscript', 'UnrealScript' => 'unrealscript',
'UrWeb' => 'urweb', 'UrWeb' => 'urweb',
@ -529,33 +524,33 @@ class GithubTrendingBridge extends BridgeAbstract {
'VCL' => 'vcl', 'VCL' => 'vcl',
'Verilog' => 'verilog', 'Verilog' => 'verilog',
'VHDL' => 'vhdl', 'VHDL' => 'vhdl',
'Vim script' => 'vim script', 'Vim script' => 'vim-script',
'Vim Snippet' => 'vim snippet', 'Vim Snippet' => 'vim-snippet',
'Visual Basic .NET' => 'visual basic .net', 'Visual Basic .NET' => 'visual-basic-.net',
'Visual Basic .NET' => 'visual basic .net', 'Visual Basic .NET' => 'visual-basic-.net',
'Volt' => 'volt', 'Volt' => 'volt',
'Vue' => 'vue', 'Vue' => 'vue',
'Wavefront Material' => 'wavefront material', 'Wavefront Material' => 'wavefront-material',
'Wavefront Object' => 'wavefront object', 'Wavefront Object' => 'wavefront-object',
'wdl' => 'wdl', 'wdl' => 'wdl',
'Web Ontology Language' => 'web ontology language', 'Web Ontology Language' => 'web-ontology-language',
'WebAssembly' => 'webassembly', 'WebAssembly' => 'webassembly',
'WebIDL' => 'webidl', 'WebIDL' => 'webidl',
'WebVTT' => 'webvtt', 'WebVTT' => 'webvtt',
'Wget Config' => 'wget config', 'Wget Config' => 'wget-config',
'Windows Registry Entries' => 'windows registry entries', 'Windows Registry Entries' => 'windows-registry-entries',
'wisp' => 'wisp', 'wisp' => 'wisp',
'Wollok' => 'wollok', 'Wollok' => 'wollok',
'World of Warcraft Addon Data' => 'world of warcraft addon data', 'World of Warcraft Addon Data' => 'world-of-warcraft-addon-data',
'X BitMap' => 'x bitmap', 'X BitMap' => 'x-bitmap',
'X Font Directory Index' => 'x font directory index', 'X Font Directory Index' => 'x-font-directory-index',
'X PixMap' => 'x pixmap', 'X PixMap' => 'x-pixmap',
'X10' => 'x10', 'X10' => 'x10',
'xBase' => 'xbase', 'xBase' => 'xbase',
'XC' => 'xc', 'XC' => 'xc',
'XCompose' => 'xcompose', 'XCompose' => 'xcompose',
'XML' => 'xml', 'XML' => 'xml',
'XML Property List' => 'xml property list', 'XML Property List' => 'xml-property-list',
'Xojo' => 'xojo', 'Xojo' => 'xojo',
'XPages' => 'xpages', 'XPages' => 'xpages',
'XProc' => 'xproc', 'XProc' => 'xproc',
@ -612,7 +607,9 @@ class GithubTrendingBridge extends BridgeAbstract {
$item['title'] = str_replace(' ', '', trim(strip_tags($element->find('h1 a', 0)->plaintext))); $item['title'] = str_replace(' ', '', trim(strip_tags($element->find('h1 a', 0)->plaintext)));
// Description // Description
$item['content'] = trim(strip_tags($element->find('p', 0)->innertext)); $description = $element->find('p', 0);
if ($description != null)
$item['content'] = trim(strip_tags($description->innertext));
// Time // Time
$item['timestamp'] = time(); $item['timestamp'] = time();
@ -623,10 +620,9 @@ class GithubTrendingBridge extends BridgeAbstract {
} }
public function getName(){ public function getName(){
if($this->getInput('language') == '') { if (!is_null($this->getInput('language'))) {
return self::NAME . ': all'; $language = array_search($this->getInput('language'), self::PARAMETERS['By language']['language']['values']);
} elseif (!is_null($this->getInput('language'))) { return self::NAME . ': ' . $language;
return self::NAME . ': ' . $this->getInput('language');
} }
return parent::getName(); return parent::getName();