File tree Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Expand file tree Collapse file tree 1 file changed +26
-1
lines changed Original file line number Diff line number Diff line change 1
- # SPDX-FileCopyrightText: 2017 Scott Shawcroft, written for Adafruit Industries
2
1
# SPDX-FileCopyrightText: Copyright (c) 2022 Alec Delaney for Adafruit Industries
3
2
#
4
3
# SPDX-License-Identifier: Unlicense
4
+
5
+ import ssl
6
+ import socket
7
+ import adafruit_requests as requests
8
+ from adafruit_pastebin .pastebin import PasteBin , ExpirationSetting , PrivacySetting
9
+
10
+ try :
11
+ from secrets import secrets
12
+ except ImportError :
13
+ print ("Please place your auth/dev key in a secrets.py file!" )
14
+ raise
15
+
16
+ wifi .radio .connect (secrets ["ssid" ], secrets ["password" ])
17
+ pool = socketpool .SocketPool (wifi .radio )
18
+ session = adafruit_requests .Session (pool , ssl .create_default_context ())
19
+
20
+ auth_key = secrets ["auth_key" ]
21
+
22
+ pastebin = PasteBin (session , auth_key )
23
+ paste_url = pastebin .paste (
24
+ "This is a test paste!" ,
25
+ name = "My Test Paste" ,
26
+ expiration = ExpirationSetting .ONE_DAY ,
27
+ privacy = PrivacySetting .UNLISTED ,
28
+ )
29
+ print (paste_url )
You can’t perform that action at this time.
0 commit comments