@@ -21,20 +21,24 @@ public function search($query)
2121 $ this ->id ,
2222 $ query ,
2323 "{$ this ->search_url }{$ query }" ,
24- '/<tr class="(.*?)"> ([\s\S]*?)<\/tr >/i ' ,
25- 2
24+ '/<a class="package-snippet" ([\s\S]*?)<\/a >/i ' ,
25+ 1
2626 );
2727
2828 foreach ($ this ->pkgs as $ pkg ) {
2929 // make params
3030 // name
31- preg_match ('/<a href="(.*?)">(.*?)<\/a>/i ' , $ pkg , $ matches );
32- $ title = str_replace (" " , " " , strip_tags ($ matches [0 ]));
33- $ url = strip_tags ($ matches [1 ]);
31+ preg_match ('/<span class="package-snippet__name">(.*?)<\/span>/i ' , $ pkg , $ matches );
32+ $ title = str_replace (" " , " " , $ matches [1 ]);
3433
35- preg_match_all ('/<td>([\s\S]*?)<\/td>/i ' , $ pkg , $ matches );
36- $ downloads = strip_tags ($ matches [1 ][1 ]);
37- $ details = strip_tags ($ matches [1 ][2 ]);
34+ preg_match ('/href="(.*?)">/i ' , $ pkg , $ matches );
35+ $ url = $ matches [1 ];
36+
37+ preg_match ('/<span class="package-snippet__version">(.*?)<\/span>/i ' , $ pkg , $ matches );
38+ $ downloads = $ matches [1 ];
39+
40+ preg_match ('/<p class="package-snippet__description">(.*?)<\/p>/i ' , $ pkg , $ matches );
41+ $ details = $ matches [1 ];
3842
3943 $ this ->cache ->w ->result (
4044 $ title ,
0 commit comments