@@ -81,16 +81,6 @@ def process_search_results(results: list[dict]) -> None:
8181 logger .info ("search results done" )
8282
8383
84- def get_playstore_results (search_term : str ) -> AppGroup :
85- """Parse search term and return resulting APpGroup."""
86- decoded_input = urllib .parse .unquote (search_term )
87- df = search_apps (search_input = decoded_input , limit = 20 )
88- logger .info (f"{ decoded_input = } returned rows: { df .shape [0 ]} " )
89- apps_dict = df .to_dict (orient = "records" )
90- app_group = AppGroup (title = search_term , apps = apps_dict )
91- return app_group
92-
93-
9484def app_history (store_app : int , app_name : str ) -> AppHistory :
9585 """Get the history of app scraping."""
9686 app_hist = get_app_history (store_app )
@@ -618,63 +608,6 @@ async def search(self: Self, search_term: str) -> AppGroup:
618608 background = BackgroundTask (search_both_stores , search_term ),
619609 )
620610
621- @get (path = "/search/{search_term:str}/playstore" , cache = 3600 )
622- async def search_playstore (self : Self , search_term : str ) -> AppGroup :
623- """Search apps and developers.
624-
625- Args:
626- ----
627- search_term: str the search term to search for.
628- Can search packages, developers and app names.
629-
630- """
631- start = time .perf_counter () * 1000
632- results = google .search_play_store (search_term )
633- app_group = AppGroup (title = "Google Playstore Results" , apps = results )
634- duration = round ((time .perf_counter () * 1000 - start ), 2 )
635- logger .info (f"{ self .path } /{ search_term } /playstore took { duration } ms" )
636- if len (results ) > 0 :
637- return Response (
638- app_group ,
639- background = BackgroundTask (process_search_results , results ),
640- )
641- return app_group
642-
643- @get (path = "/search/{search_term:str}/applestore" , cache = 3600 )
644- async def search_applestore (self : Self , search_term : str ) -> AppGroup :
645- """Search apps and developers.
646-
647- Args:
648- ----
649- search_term: str the search term to search for.
650- Can search packages, developers and app names.
651-
652- """
653- logger .info (f"{ self .path } term={ search_term } for apple store" )
654-
655- start = time .perf_counter () * 1000
656-
657- ids = apple .search_app_store_for_ids (search_term )
658- full_results = [{"store_id" : store_id , "store" : 2 } for store_id in ids ]
659- results = apple .app_details_for_ids (ids [:10 ])
660-
661- df = pd .DataFrame (results )
662- df = apple .clean_ios_app_df (df )
663-
664- df ["store_link" ] = "https://apps.apple.com/us/app/-/id" + df ["store_id" ]
665-
666- results_dict = df .to_dict (orient = "records" )
667-
668- app_group = AppGroup (title = "Apple App Store Results" , apps = results_dict )
669- duration = round ((time .perf_counter () * 1000 - start ), 2 )
670- logger .info (f"{ self .path } took { duration } ms" )
671- if len (results ) > 0 :
672- return Response (
673- app_group ,
674- background = BackgroundTask (process_search_results , full_results ),
675- )
676- return app_group
677-
678611 @post (path = "/{store_id:str}/requestSDKScan" )
679612 async def request_sdk_scan (self : Self , store_id : str ) -> Response :
680613 """Request a new SDK scan for an app."""
0 commit comments