Spaces:
Configuration error

File size: 720 Bytes
681c53e
 
0c9beb9
681c53e
0c9beb9
681c53e
 
 
 
0c9beb9
681c53e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
from post import send_data_to_dynamodb
from get import get_data_from_dynamodb
import json
import uuid

def get_user_input():
    user_data = {
        'title': input("Başlığı giriniz: "),
        'keywords': input("Anahtar kelimeleri giriniz (virgül ile ayırarak): ")
    }
    return user_data

def main():
    user_data = get_user_input()

    
    item_id = str(uuid.uuid4())
    
    
    user_data['id'] = item_id  

    
    response = send_data_to_dynamodb(user_data)
    
    if response.status_code == 200:
        print("Data successfully sent to DynamoDB!")
    else:
        print(f"Error: {response.status_code}, {response.text}")

if __name__ == '__main__':
    main()