File size: 1,678 Bytes
00e640a
 
 
 
 
 
 
 
 
 
b01c3d3
 
 
 
 
 
00e640a
b01c3d3
 
 
00e640a
b01c3d3
00e640a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
b01c3d3
 
 
00e640a
 
 
 
 
 
 
 
 
 
 
 
 
b01c3d3
 
 
00e640a
 
 
 
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
import pandas as pd
import streamlit as st
import requests

from io import BytesIO
from PIL import Image

data_titles = pd.read_pickle("data/2k_titles.pkl")
data_ids = pd.read_pickle("data/2k_ids.pkl")

def ids_to_titles(ids_list):
    return [data_ids[title] for title in ids_list]

def titles_to_ids(titles_list):
    return [data_titles[id] for id in titles_list]

def generate_app_gamebox(titles):
    """

        Placeholder

    """

    titles_id = titles_to_ids(titles)

    for id in titles_id:
        url = f"https://cdn.cloudflare.steamstatic.com/steam/apps/{id}/header.jpg"
        resp = requests.get(url)

        if resp.status_code == 200:
            container = st.container()
            img_col, pref_col = container.columns([3, 2])

            img_col.image(BytesIO(resp.content))
            pref_col.selectbox(
                "Your rating:",
                options=["Positive", "Negative"],
                key=id,
            )
    
    return titles_id

def generate_res_gamebox(ids):
    """

        Placeholder

    """

    for id in ids:
        url_page = f"https://store.steampowered.com/app/{id}/"
        url_img = f"https://cdn.cloudflare.steamstatic.com/steam/apps/{id}/header.jpg"
        resp = requests.get(url_img)

        if resp.status_code == 200:
            with st.container():
                st.image(BytesIO(resp.content))
                st.caption(data_ids[id])
            
            st.divider()

def combine_hybrid_result():
    pass

    # for title in titles_list:
    #     # url = f"https://store.steampowered.com/app/"
    #     with st.container():