-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path8339.rss
83 lines (76 loc) · 2.75 KB
/
8339.rss
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>קוד: שבוע 12, שידור חי מספר 3</title>
<link>https://forums.pythonic.guru/t/12-3/8339</link>
<description>```
from flask import Flask, render_template
import requests
app = Flask(__name__)
@app.route('/<pokemon_name>')
def hello_world(pokemon_name):
pokemon_name = pokemon_name.lower()
resp = requests.get(f'https://pokeapi.co/api/v2/pokemon/{pokemon_name}')
resp_json = resp.json()
image = resp_json['sprites']['front_default']
return render_template(
'index.html',
name=pokemon_name,
image_url=image,
)
```
```
<!DOCTYPE HTML>
<html>
<head>
<title></title>
</head>
<body>
<h1>{{name | title}}</h1>
<img src="{{image_url}}" alt="{{name | title}} image">
</body>
</html>
```</description>
<language>he</language>
<lastBuildDate>Sun, 18 Oct 2020 05:35:43 +0000</lastBuildDate>
<category>שבוע 12</category>
<atom:link href="https://forums.pythonic.guru/t/12-3/8339.rss" rel="self" type="application/rss+xml" />
<item>
<title>קוד: שבוע 12, שידור חי מספר 3</title>
<dc:creator><![CDATA[Yam]]></dc:creator>
<description><![CDATA[
<pre><code class="lang-auto">from flask import Flask, render_template
import requests
app = Flask(__name__)
@app.route('/<pokemon_name>')
def hello_world(pokemon_name):
pokemon_name = pokemon_name.lower()
resp = requests.get(f'https://pokeapi.co/api/v2/pokemon/{pokemon_name}')
resp_json = resp.json()
image = resp_json['sprites']['front_default']
return render_template(
'index.html',
name=pokemon_name,
image_url=image,
)
</code></pre>
<pre><code class="lang-auto"><!DOCTYPE HTML>
<html>
<head>
<title></title>
</head>
<body>
<h1>{{name | title}}</h1>
<img src="{{image_url}}" alt="{{name | title}} image">
</body>
</html>
</code></pre>
<p><a href="https://forums.pythonic.guru/t/12-3/8339/1">קריאת הנושא במלואו</a></p>
]]></description>
<link>https://forums.pythonic.guru/t/12-3/8339/1</link>
<pubDate>Thu, 15 Oct 2020 18:24:18 +0000</pubDate>
<guid isPermaLink="false">forums.pythonic.guru-post-8339-1</guid>
<source url="https://forums.pythonic.guru/t/12-3/8339.rss">קוד: שבוע 12, שידור חי מספר 3</source>
</item>
</channel>
</rss>