File tree Expand file tree Collapse file tree 5 files changed +8
-5
lines changed Expand file tree Collapse file tree 5 files changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ from framelib import render_frame
23
23
24
24
app = Flask(__name__ )
25
25
26
- @app.route (' /' , methods = [ ' GET ' , ' POST ' ] )
26
+ @app.route (' /' )
27
27
def home ():
28
28
return render_frame(
29
29
image = ' https://opengraph.githubassets.com/0x/devinaconley/python-frames' ,
Original file line number Diff line number Diff line change 2
2
main entry point for example framelib flask app
3
3
"""
4
4
import os
5
+ import time
5
6
from flask import Flask , url_for , jsonify
6
7
from framelib import render_frame , message , validate_message_or_mock_vercel
7
8
@@ -19,7 +20,7 @@ def handle_invalid_usage(e):
19
20
def home ():
20
21
# initial frame
21
22
return render_frame (
22
- image = 'https://opengraph.githubassets.com/0x /devinaconley/python-frames' ,
23
+ image = f 'https://opengraph.githubassets.com/{ int ( time . time ()) } /devinaconley/python-frames' ,
23
24
button1 = 'hello \U0001F44B ' ,
24
25
post_url = url_for ('second_page' , _external = True ),
25
26
button2 = 'github' ,
@@ -40,7 +41,7 @@ def second_page():
40
41
print (f'validated frame message, fid: { msg_val .interactor .fid } , button: { msg_val .tapped_button } ' )
41
42
42
43
return render_frame (
43
- image = 'https://opengraph.githubassets.com/0x /devinaconley/python-frames' ,
44
+ image = f 'https://opengraph.githubassets.com/{ int ( time . time ()) } /devinaconley/python-frames' ,
44
45
button1 = 'back \U0001F519 ' ,
45
46
post_url = url_for ('home' , _external = True ),
46
47
input_text = f'hello { msg_val .interactor .username } !' ,
Original file line number Diff line number Diff line change 1
1
# requirements.txt
2
- framelib ~= 0.0.0b5
2
+ framelib ~= 0.0.1
3
3
Flask ~= 3.0.1
4
4
pydantic
Original file line number Diff line number Diff line change 9
9
10
10
11
11
def get_frame_action (msg : str , api_key : str ) -> ValidatedMessage :
12
+ if not api_key :
13
+ raise ValueError ('neynar api key not set' )
12
14
url = 'https://api.neynar.com/v2/farcaster/frame/validate'
13
15
body = {
14
16
'cast_reaction_context' : False , # TODO
Original file line number Diff line number Diff line change 5
5
6
6
setuptools .setup (
7
7
name = 'framelib' ,
8
- version = '0.0.0.b5 ' ,
8
+ version = '0.0.1 ' ,
9
9
author = 'Devin A. Conley' ,
10
10
author_email = 'devinaconley@gmail.com' ,
11
11
description = 'lightweight library for building farcaster frames using python and flask' ,
You can’t perform that action at this time.
0 commit comments