
    i	                         d Z ddlmZ ddlmZ dddddd	d
ZddgZdZdZdZ	dZ
i dddddddddddddddddddd d!dd"d#d$d#d%d#d&d'd(d#d)d*d*d+d,Zd-efd.Zd/ Zy)0zhex.pm    )	urlencode)parserzhttps://hex.pm/Nz\https://github.com/hexpm/hexpm/blob/main/lib/hexpm_web/controllers/api/package_controller.exTFJSON)websitewikidata_idofficial_api_documentationuse_official_apirequire_api_keyresultsitpackageszhttps://hex.pm/api/packages/recent_downloads
   authorAuthor	bitbucket	Bitbucketzbug trackerzIssue tracker	changelog	ChangelogdocDocumentationdocsdocumentationzgithub repositoryGitHubgithubgitlabGitLabissueszproject source codezSource code
repositoryscm	sourcehut	SourceHutsourcessponsorSponsorsHomepage)sponsorsr   queryc                 X    t        |d   t        t        | d      }t         d| |d<   |S )Npageno)pageper_pagesortsearch?url)r   	page_sizesort_criteria
search_url)r(   paramsargss      "/root/searxng/searx/engines/hex.pyrequestr7   4   s4    fX.I}hmnoD!l!D6*F5MM    c                 N   g }| j                         D ]  }|d   }|j                  d      }t        j                  |      }|j                  d      j	                         D ci c]*  \  }}t
        j                  |j                         |      |, }}}|j                  d|d   |d   |d   |j                  dd      |j                  d	      d
j                  |j                  dg             |d
j                  |j                  dg             |d   |d        |S c c}}w )Nmeta
updated_atlinkszpackages.htmlhtml_urlnamedescription latest_versionz, maintainerslicensesdocs_html_url)templater0   titlepackage_namecontentversion
maintainerpublishedDatelicense_namehomepager<   )	jsongetr   parseitemslinked_termslowerappendjoin)respr   packager:   published_datekvr<   s           r6   responser[   :   s   G99; 
v \2n5?Cxx?P?V?V?XYtq!!!!'')Q/2YY+z*  '88M2688$45"ii(CD!/ $		$((:r*B C#O4	

* N# Zs   $/D!)__doc__urllib.parser   dateutilr   about
categoriespagingr3   r2   r1   rR   strr7   r[    r8   r6   <module>rd      s=    " 
 ! #A	 J
 
+
"	h  ?	
  
? O _  h h o = - 
=  !" }#$ z%& )03 r8   