Skip to content

Commit c1332ec

Browse files
Fixed readme formatting
1 parent b1ce168 commit c1332ec

File tree

1 file changed

+28
-28
lines changed

1 file changed

+28
-28
lines changed

README.rst

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -45,44 +45,44 @@ Take note that the creation of the YoutubeAPI() instance is done using the **wit
4545
.. code-block:: python
4646
4747
from micropython_youtube_api import YoutubeAPI
48-
import network, json, time
48+
import network, json, time
4949
50-
# Read config
51-
with open('config.json') as f:
52-
config = json.load(f)
50+
# Read config
51+
with open('config.json') as f:
52+
config = json.load(f)
5353
54-
# Check config.json has updated credentials
55-
if config['ssid'] == 'Enter_Wifi_SSID':
56-
assert False, ("config.json has not been updated with your unique keys and data")
54+
# Check config.json has updated credentials
55+
if config['ssid'] == 'Enter_Wifi_SSID':
56+
assert False, ("config.json has not been updated with your unique keys and data")
5757
58-
# Create WiFi connection and turn it on
59-
wlan = network.WLAN(network.STA_IF)
60-
wlan.active(True)
58+
# Create WiFi connection and turn it on
59+
wlan = network.WLAN(network.STA_IF)
60+
wlan.active(True)
6161
62-
# Connect to WiFi router
63-
print ("Connecting to WiFi: {}".format( config['ssid'] ) )
64-
wlan.connect( config['ssid'], config['ssid_password'])
62+
# Connect to WiFi router
63+
print ("Connecting to WiFi: {}".format( config['ssid'] ) )
64+
wlan.connect( config['ssid'], config['ssid_password'])
6565
66-
# Wait until wifi is connected
67-
while not wlan.isconnected:
68-
pass
66+
# Wait until wifi is connected
67+
while not wlan.isconnected:
68+
pass
6969
70-
# Create an instance of the YoutubeApi
71-
with YoutubeAPI( config["channelid"], config["appkeyid"], config["query_interval_sec"] ) as data:
70+
# Create an instance of the YoutubeApi
71+
with YoutubeAPI( config["channelid"], config["appkeyid"], config["query_interval_sec"] ) as data:
7272
73-
# Read the data every X seconds
74-
update_interval = 5
75-
update_stats_time = time.time() - 10
73+
# Read the data every X seconds
74+
update_interval = 5
75+
update_stats_time = time.time() - 10
7676
77-
while True:
77+
while True:
7878
79-
if update_stats_time < time.time():
80-
update_stats_time = time.time() + update_interval
79+
if update_stats_time < time.time():
80+
update_stats_time = time.time() + update_interval
8181
82-
print ("Subs {}".format( data.subs ) )
83-
print ("Views {}".format( data.views ) )
84-
print ("Videos {}".format( data.videos ) )
85-
print ("Comments {}".format( data.comments ) )
82+
print ("Subs {}".format( data.subs ) )
83+
print ("Views {}".format( data.views ) )
84+
print ("Videos {}".format( data.videos ) )
85+
print ("Comments {}".format( data.comments ) )
8686
..
8787
8888
Getting a Google Apps API key (Required!)

0 commit comments

Comments
 (0)