Paperd.Ink Library 0.0.5
Library for interacting with Paperd.Ink devices.
Loading...
Searching...
No Matches
YoutubeJsonListener Class Reference

#include <youtube_parser.h>

Inheritance diagram for YoutubeJsonListener:

Public Member Functions

virtual void whitespace (char c)
 
virtual void startDocument ()
 
virtual void key (String key)
 
virtual void value (String value)
 
virtual void endArray ()
 
virtual void endObject ()
 
virtual void endDocument ()
 
virtual void startArray ()
 
virtual void startObject ()
 

Detailed Description

Definition at line 6 of file youtube_parser.h.

Member Function Documentation

◆ endArray()

void YoutubeJsonListener::endArray ( )
virtual

Definition at line 37 of file youtube_parser.cpp.

38{
39}

◆ endDocument()

void YoutubeJsonListener::endDocument ( )
virtual

Definition at line 45 of file youtube_parser.cpp.

46{
47}

◆ endObject()

void YoutubeJsonListener::endObject ( )
virtual

Definition at line 41 of file youtube_parser.cpp.

42{
43}

◆ key()

void YoutubeJsonListener::key ( String key)
virtual

Definition at line 16 of file youtube_parser.cpp.

17{
18 if (key.equals("viewCount"))
19 key_state = FOUND_VIEWS;
20 else if (key.equals("subscriberCount"))
21 key_state = FOUND_SUBSCRIBERS;
22}
virtual void key(String key)
@ FOUND_SUBSCRIBERS
@ FOUND_VIEWS

◆ startArray()

void YoutubeJsonListener::startArray ( )
virtual

Definition at line 49 of file youtube_parser.cpp.

50{
51}

◆ startDocument()

void YoutubeJsonListener::startDocument ( )
virtual

Definition at line 11 of file youtube_parser.cpp.

12{
13 key_state = NOT_FOUND;
14}
@ NOT_FOUND

◆ startObject()

void YoutubeJsonListener::startObject ( )
virtual

Definition at line 53 of file youtube_parser.cpp.

54{
55}

◆ value()

void YoutubeJsonListener::value ( String value)
virtual

Definition at line 24 of file youtube_parser.cpp.

25{
26 if (key_state == FOUND_VIEWS) {
27 sscanf(value.c_str(), "%lld", &Paperdink_Youtube.views);
28 Serial.printf("Views: %lld\r\n", Paperdink_Youtube.views);
29 key_state = NOT_FOUND;
30 } else if (key_state == FOUND_SUBSCRIBERS) {
31 sscanf(value.c_str(), "%lld", &Paperdink_Youtube.subscribers);
32 Serial.printf("Subscribers: %lld\r\n", Paperdink_Youtube.subscribers);
33 key_state = NOT_FOUND;
34 }
35}
virtual void value(String value)
PaperdinkUIYoutubeClass Paperdink_Youtube
Definition youtube.cpp:138

◆ whitespace()

void YoutubeJsonListener::whitespace ( char c)
virtual

Definition at line 7 of file youtube_parser.cpp.

8{
9}

The documentation for this class was generated from the following files: