pub struct LastFmParser;Expand description
Parser struct containing parsing methods for Last.fm HTML pages.
This struct holds the parsing logic that was previously embedded in the client. It’s designed to be stateless and focused purely on HTML parsing.
Implementations§
Source§impl LastFmParser
impl LastFmParser
Sourcepub fn parse_recent_scrobbles(&self, document: &Html) -> Result<Vec<Track>>
pub fn parse_recent_scrobbles(&self, document: &Html) -> Result<Vec<Track>>
Parse recent scrobbles from the user’s library page This extracts real scrobble data with timestamps for editing
Sourcepub fn parse_tracks_page(
&self,
document: &Html,
page_number: u32,
artist: &str,
) -> Result<TrackPage>
pub fn parse_tracks_page( &self, document: &Html, page_number: u32, artist: &str, ) -> Result<TrackPage>
Parse a tracks page into a TrackPage structure
Sourcepub fn extract_tracks_from_document(
&self,
document: &Html,
artist: &str,
) -> Result<Vec<Track>>
pub fn extract_tracks_from_document( &self, document: &Html, artist: &str, ) -> Result<Vec<Track>>
Extract tracks from HTML document
Sourcepub fn parse_track_row(&self, row: &ElementRef<'_>) -> Result<Track>
pub fn parse_track_row(&self, row: &ElementRef<'_>) -> Result<Track>
Parse a single track row from chartlist table
Sourcepub fn parse_albums_page(
&self,
document: &Html,
page_number: u32,
artist: &str,
) -> Result<AlbumPage>
pub fn parse_albums_page( &self, document: &Html, page_number: u32, artist: &str, ) -> Result<AlbumPage>
Parse albums page into AlbumPage structure
Sourcepub fn parse_album_row(&self, row: &ElementRef<'_>) -> Result<Album>
pub fn parse_album_row(&self, row: &ElementRef<'_>) -> Result<Album>
Parse a single album row from chartlist table
Sourcepub fn parse_pagination(
&self,
document: &Html,
_current_page: u32,
) -> Result<(bool, Option<u32>)>
pub fn parse_pagination( &self, document: &Html, _current_page: u32, ) -> Result<(bool, Option<u32>)>
Parse pagination information from document
pub fn find_timestamp_for_track( &self, _document: &Html, _track_name: &str, ) -> Option<u64>
pub fn find_playcount_for_track( &self, document: &Html, track_name: &str, ) -> Result<u32>
pub fn find_timestamp_for_album( &self, _document: &Html, _album_name: &str, ) -> Option<u64>
pub fn find_playcount_for_album( &self, document: &Html, album_name: &str, ) -> Result<u32>
pub fn find_ancestor_row<'a>( &self, element: ElementRef<'a>, ) -> Option<ElementRef<'a>>
Trait Implementations§
Source§impl Debug for LastFmParser
impl Debug for LastFmParser
Auto Trait Implementations§
impl Freeze for LastFmParser
impl RefUnwindSafe for LastFmParser
impl Send for LastFmParser
impl Sync for LastFmParser
impl Unpin for LastFmParser
impl UnwindSafe for LastFmParser
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more