Gamma7113131 / TitanicChat

TitanicChat - The best AI chatbot
https://titanicsearch.neocities.org/
MIT License
1 stars 1 forks source link

Im here again #2

Open blazgocompany opened 2 weeks ago

blazgocompany commented 1 week ago

it's not a new project, its a new... umm... task, maybe?

Gamma7113131 commented 1 week ago

it's not a new project, its a new... umm... task, maybe?

Ok what is it

blazgocompany commented 1 week ago

Wait... ill live share somthing

blazgocompany commented 1 week ago

https://prod.liveshare.vsengsaas.visualstudio.com/join?FAD2EE93B4CDF916A58DCECFC9D2FD4F395A

Gamma7113131 commented 1 week ago

https://prod.liveshare.vsengsaas.visualstudio.com/join?FAD2EE93B4CDF916A58DCECFC9D2FD4F395A

k and pls talk to me here instead https://adapt.chat/invite/NgSI9xGG it is easier

blazgocompany commented 1 week ago

I don't need that. We have a live chat in liveshare itself

blazgocompany commented 1 week ago

Its at the bottom bar

Gamma7113131 commented 1 week ago

Its at the bottom bar

ik but inseatd of github talk to me here https://adapt.chat/invite/NgSI9xGG it is way easier

blazgocompany commented 1 week ago

btw I got my AI running:

https://rainai.leroy-i-fernandes.workers.dev/?data=WwogIHsgInJvbGUiOiAic3lzdGVtIiwgImNvbnRlbnQiOiAiWW91IGFyZSBhIGhlbHBmdWwgYXNzaXN0YW50LiIgfSwKICB7ICJyb2xlIjogInVzZXIiLCAiY29udGVudCI6ICJXaG8gd29uIHRoZSB3b3JsZCBzZXJpZXMgaW4gMjAyMD8iIH0KXQ==

The string after data= is base64 encoded of:

[
  { "role": "system", "content": "You are a helpful assistant." },
  { "role": "user", "content": "Who won the world series in 2020?" }
]
Gamma7113131 commented 1 week ago

btw I got my AI running:

https://rainai.leroy-i-fernandes.workers.dev/?data=WwogIHsgInJvbGUiOiAic3lzdGVtIiwgImNvbnRlbnQiOiAiWW91IGFyZSBhIGhlbHBmdWwgYXNzaXN0YW50LiIgfSwKICB7ICJyb2xlIjogInVzZXIiLCAiY29udGVudCI6ICJXaG8gd29uIHRoZSB3b3JsZCBzZXJpZXMgaW4gMjAyMD8iIH0KXQ==

The string after data= is base64 encoded of:

[
  { "role": "system", "content": "You are a helpful assistant." },
  { "role": "user", "content": "Who won the world series in 2020?" }
]

k how to use it look image

blazgocompany commented 1 week ago

Hmm...

blazgocompany commented 1 week ago

Oh sorry, I changed the domain after I sent you... just change the "rainai.leroy" at the beginning to "rainapi.leroy"

Gamma7113131 commented 1 week ago

Oh sorry, I changed the domain after I sent you... just change the "rainai.leroy" at the beginning to "rainapi.leroy"

Ok cool I saw it

blazgocompany commented 6 days ago

Did you want to talk to me?

Gamma7113131 commented 6 days ago

Did you want to talk to me?

Yes could you help with a scratch online detectore in python

blazgocompany commented 6 days ago

How would I do that?.....

Gamma7113131 commented 6 days ago

How would I do that?.....

nvm I did it look `import scratchattach as scratch3 import requests from datetime import datetime, timedelta from bs4 import BeautifulSoup import re

Set up connection using TwCloudConnection

conn = scratch3.TwCloudConnection( project_id="1068841039", # Replace with your project id purpose="Check user activity", # Optional: You can specify the use case contact="cat-girl-12345" # Replace with your Scratch account username )

client = scratch3.TwCloudRequests(conn)

Scratch_URL = "https://scratch.mit.edu"

def get_activity_type(raw_activity_type): activities = { "added": "studio-add", "became a curator of": "studio-curator", "loved": "project-love", "favorited": "project-favorite", "is now following": "user-follow", "is now following the studio": "studio-follow", "shared the project": "project-share", "was promoted to manager of": "studio-manager", "remixed": "project-remix", "joined Scratch": "scratch-join", } return activities.get(raw_activity_type, "unknown")

def get_activity(username): response = requests.get( f"https://scratch.mit.edu/messages/ajax/user-activity/?user={username}&max=1000000", headers={"User-Agent": "Python Requests"}, ).content

soup = BeautifulSoup(response, "html.parser")
activities = soup.find_all("li")
result = []
for activity in activities:
    div_contents = activity.find("div").contents
    activity_type = get_activity_type(div_contents[2].strip())
    activity_time = str(activity.find("span", "time").contents[0]).replace("\xa0", " ")
    a = {"Type": activity_type, "Time": activity_time, "Action": {}}
    a_act = a["Action"]
    if activity_type == "studio-add":
        a_act["ProjectURL"] = f"{Scratch_URL}{div_contents[3]['href']}"
        a_act["ProjectName"] = f"{str(div_contents[3].contents[0])}"
        a_act["StudioURL"] = f"{Scratch_URL}{div_contents[5]['href']}"
        a_act["StudioName"] = f"{str(div_contents[5].contents[0])}"
    elif activity_type == "studio-curator":
        a_act["StudioURL"] = f"{Scratch_URL}{div_contents[3]['href']}"
        a_act["StudioName"] = f"{str(div_contents[3].contents[0])}"
    elif activity_type == "project-love":
        a_act["ProjectURL"] = f"{Scratch_URL}{div_contents[3]['href']}"
        a_act["ProjectName"] = f"{str(div_contents[3].contents[0])}"
    elif activity_type == "project-favorite":
        a_act["ProjectURL"] = f"{Scratch_URL}{div_contents[3]['href']}"
        a_act["ProjectName"] = f"{str(div_contents[3].contents[0])}"
    elif activity_type == "user-follow":
        a_act["UsernameURL"] = f"{Scratch_URL}{div_contents[3]['href']}"
        a_act["Username"] = f"{str(div_contents[3].contents[0])}"
    elif activity_type == "studio-follow":
        a_act["StudioURL"] = f"{Scratch_URL}{div_contents[3]['href']}"
        a_act["StudioName"] = f"{str(div_contents[3].contents[0])}"
    elif activity_type == "project-share":
        a_act["ProjectURL"] = f"{Scratch_URL}{div_contents[3]['href']}"
        a_act["ProjectName"] = f"{str(div_contents[3].contents[0])}"
    elif activity_type == "studio-manager":
        a_act["StudioURL"] = f"{Scratch_URL}{div_contents[3]['href']}"
        a_act["StudioName"] = f"{str(div_contents[3].contents[0])}"
    elif activity_type == "project-remix":
        a_act["ParentProjectURL"] = f"{Scratch_URL}{div_contents[3]['href']}"
        a_act["ParentProjectName"] = f"{str(div_contents[3].contents[0])}"
        a_act["NewProjectURL"] = f"{Scratch_URL}{div_contents[5]['href']}"
        a_act["NewProjectName"] = f"{str(div_contents[5].contents[0])}"
    result.append(a)
return result

def parse_relative_time(relative_time_str): """ Parse relative time strings (e.g., '7 minutes ago') into a datetime object. """ now = datetime.now() patterns = [ (r"(\d+)\s+minute(?:s)?\s+ago", lambda x: timedelta(minutes=int(x))), (r"(\d+)\s+hour(?:s)?\s+ago", lambda x: timedelta(hours=int(x))), (r"(\d+)\s+day(?:s)?\s+ago", lambda x: timedelta(days=int(x))), (r"(\d+)\s+week(?:s)?\s+ago", lambda x: timedelta(weeks=int(x))), (r"(\d+)\s+minutes?\s+ago", lambda x: timedelta(minutes=int(x))), (r"(\d+)\s+hours?\s+ago", lambda x: timedelta(hours=int(x))), (r"(\d+)\s+days?\s+ago", lambda x: timedelta(days=int(x))), (r"(\d+)\s+weeks?\s+ago", lambda x: timedelta(weeks=int(x))) ] for pattern, delta_func in patterns: match = re.match(pattern, relative_time_str) if match: value = match.group(1) delta = delta_func(value) return now - delta

Handle unknown formats by defaulting to now

return now

def is_recent_activity(activity_time_str, minutes=2): """ Check if the activity time is within the last 'minutes' minutes. """ try:

Try parsing as an absolute datetime first

    activity_time = datetime.strptime(activity_time_str, '%Y-%m-%dT%H:%M:%S.%fZ')
except ValueError:
    try:
        activity_time = datetime.strptime(activity_time_str, '%Y-%m-%dT%H:%M:%S%z')
    except ValueError:
        # Handle relative time strings
        activity_time = parse_relative_time(activity_time_str)

recent_threshold = datetime.now() - timedelta(minutes=minutes)
print(f"Activity Time: {activity_time}, Recent Threshold: {recent_threshold}")  # Debugging line
return activity_time > recent_threshold

def fetch_user_activity(user_username): """ Fetch the user's recent activities, including projects and comments. """ activities = get_activity(user_username) recent_threshold = datetime.now() - timedelta(minutes=2) # Updated to 2 minutes

for activity in activities:
    activity_time_str = activity.get('Time', '')
    print(f"Checking activity time: {activity_time_str}")  # Debugging line
    if is_recent_activity(activity_time_str, minutes=2):  # Updated to 2 minutes
        return True

print(f"No recent activity found for {user_username}.")
return False

@client.request def check_user_activity(user_username): # Called when client receives request with 'user_username' print(f"Request received to check if {user_username} is active.")

is_active = fetch_user_activity(user_username)
status = 'Active' if is_active else 'Inactive'
print(f"Activity status for {user_username}: {status}")

return f"{user_username} is {status}"

@client.event def on_ready(): print("Request handler is running")

Run the client

client.run() # Make sure this is ALWAYS at the bottom of your Python file `

blazgocompany commented 6 days ago

oh... That works... i guess.

And also please wrap code like this in triple back-tick: ```

And what does GammaTube acutally do?

blazgocompany commented 6 days ago

Also, are you better at CSS and HTML or better at Flask

Gamma7113131 commented 6 days ago

oh... That works... i guess.

And also please wrap code like this in triple back-tick: ```

And what does GammaTube acutally do?

k also GammaTube is YT in Scratch using scratchattach

Gamma7113131 commented 6 days ago

Also, are you better at CSS and HTML or better at Flask

Flask and HTML

blazgocompany commented 6 days ago

hmm.... thats an odd combination.... are you willing to learn CSS?

Gamma7113131 commented 6 days ago

hmm.... thats an odd combination.... are you willing to learn CSS?

Yes but I already know some css

blazgocompany commented 6 days ago

ok.... well... I can help you.

Gamma7113131 commented 6 days ago

ok.... well... I can help you.

Thx :D

blazgocompany commented 6 days ago

Wait.... What do you want me to help you with???? I was thinking that you help me with the html and flask part of my site and ill help you with the css...

Gamma7113131 commented 6 days ago

Wait.... What do you want me to help you with???? I was thinking that you help me with the html and flask part of my site and ill help you with the css...

Yes ok

blazgocompany commented 6 days ago

Wait im trying to get the server to work...

Gamma7113131 commented 6 days ago

Wait im trying to get the server to work...

For what????

blazgocompany commented 6 days ago

rAIn

Gamma7113131 commented 6 days ago

Oh

rAIn

Oh Ok

blazgocompany commented 6 days ago

Hmm... the database isn't working.... once we get that were all set. do you know how to connect to a database in python

Gamma7113131 commented 6 days ago

Hmm... the database isn't working.... once we get that were all set. do you know how to connect to a database in python

I think so..... it should be easy

blazgocompany commented 6 days ago

I think so..... it should be easy

It should be... lol... sadly it isn't:

Error: 2003: Can't connect to MySQL server on '%-.100s:%u' (%s) (Warning: %u format: a real number is required, not str)

I have no idea what this even means...

Gamma7113131 commented 6 days ago

I think so..... it should be easy

It should be... lol... sadly it isn't:

Error: 2003: Can't connect to MySQL server on '%-.100s:%u' (%s) (Warning: %u format: a real number is required, not str)

I have no idea what this even means...

XD wdym??? also why cant I delete my yahoo mail from my yahoo inbox I delete it but it just comes back do you know why

blazgocompany commented 6 days ago

no...

Gamma7113131 commented 6 days ago

no...

ok nvm I did it

Gamma7113131 commented 6 days ago

no...

could you create a scratch project similar to your pfp one but instead a sound one with a python backend pls I will give credits @blazgocompany

blazgocompany commented 6 days ago

Maybe... but not anytime soon...

blazgocompany commented 6 days ago

Finally its working.... But i won't be there until Monday...

Gamma7113131 commented 6 days ago

Maybe... but not anytime soon...

Ok np

Gamma7113131 commented 6 days ago

Finally its working.... But i won't be there until Monday...

Huh???? what is working?? the API????

blazgocompany commented 18 hours ago

It's Monday and I'm back (from the beach)!

blazgocompany commented 18 hours ago

Huh???? what is working?? the API????

No... i told you not anytime soon.

Gamma7113131 commented 18 hours ago

Huh???? what is working?? the API????

No... i told you not anytime soon.

Huh? your confusing me btw do you have discord???

Gamma7113131 commented 18 hours ago

It's Monday and I'm back (from the beach)!

Yay Hi :)

blazgocompany commented 18 hours ago

Huh? your confusing me btw do you have discord???

no. I meant rAIn was done. not your api

Gamma7113131 commented 18 hours ago

Huh? your confusing me btw do you have discord???

no. I meant rAIn was done. not your api

I did not ask for an API

blazgocompany commented 18 hours ago

by the way, the sound thing isn't possible:

Replicating audio from just frequency and loudness data is challenging because this information alone doesn't capture all the nuances of the original sound. Specifically, while frequency analysis reveals which tones are present, it lacks essential phase information and harmonic details that influence timbre and texture. Additionally, loudness gives a sense of volume but misses the dynamic variations and subtle characteristics of the original audio. As a result, any reconstruction would likely sound like a rough approximation rather than an exact replica.

It won't work for talking either:

Voices, like those in speech, contain complex harmonics and subtle variations in pitch, tone, and timing that contribute to their clarity and distinctiveness. If you only capture frequency and loudness, you miss critical aspects like formants (resonant frequencies that shape vowel sounds) and the specific timing of consonants and syllables. This can lead to a distorted or unnatural reproduction of the voice, making it difficult to understand and less recognizable. Additionally, the emotional nuances conveyed through inflection and intonation can be lost, further distorting the original intent of the speech.

And it won't work for music:

When multiple instruments play together, their unique timbres create a rich, complex sound. If you only capture frequency and loudness, the result can sound muddled, as each instrument has its own harmonic structure and overtones that interact in specific ways. Without this detailed timbral information, the nuances that allow instruments to complement or contrast with each other are lost, leading to a lack of clarity and harmony in the overall sound.

But it will work for pure melodies:

If you capture multiple sine waves one after another—meaning you analyze each one separately—you can accurately replicate each wave using just its frequency and amplitude. Since each sine wave is distinct and lacks the complexities of harmonics or timbre, you can recreate them perfectly by using the frequency and loudness data for each individual wave. This approach would work well for reconstructing the sound as long as the analysis is done accurately for each wave.

Gamma7113131 commented 18 hours ago

by the way, the sound thing isn't possible:

Replicating audio from just frequency and loudness data is challenging because this information alone doesn't capture all the nuances of the original sound. Specifically, while frequency analysis reveals which tones are present, it lacks essential phase information and harmonic details that influence timbre and texture. Additionally, loudness gives a sense of volume but misses the dynamic variations and subtle characteristics of the original audio. As a result, any reconstruction would likely sound like a rough approximation rather than an exact replica.

It won't work for talking either:

Voices, like those in speech, contain complex harmonics and subtle variations in pitch, tone, and timing that contribute to their clarity and distinctiveness. If you only capture frequency and loudness, you miss critical aspects like formants (resonant frequencies that shape vowel sounds) and the specific timing of consonants and syllables. This can lead to a distorted or unnatural reproduction of the voice, making it difficult to understand and less recognizable. Additionally, the emotional nuances conveyed through inflection and intonation can be lost, further distorting the original intent of the speech.

And it won't work for music:

When multiple instruments play together, their unique timbres create a rich, complex sound. If you only capture frequency and loudness, the result can sound muddled, as each instrument has its own harmonic structure and overtones that interact in specific ways. Without this detailed timbral information, the nuances that allow instruments to complement or contrast with each other are lost, leading to a lack of clarity and harmony in the overall sound.

But it will work for pure melodies:

If you capture multiple sine waves one after another—meaning you analyze each one separately—you can accurately replicate each wave using just its frequency and amplitude. Since each sine wave is distinct and lacks the complexities of harmonics or timbre, you can recreate them perfectly by using the frequency and loudness data for each individual wave. This approach would work well for reconstructing the sound as long as the analysis is done accurately for each wave.

Ok btw do you have Discord