9
submitted 1 year ago* (last edited 1 year ago) by GodOfThunder@lemm.ee to c/lemmy_support@lemmy.ml

I'm getting rate_limit_error on the API when posting posts with just title+url. What is the default rate limit for posts? Do all requests have a rate limit or only posts?

Can I get the rate limit from an instance with a request to the API?

Edit:

{
  "local_site_rate_limit": {
    "id": 1,
    "local_site_id": 1,
    "message": 180,
    "message_per_second": 60,
    "post": 6,
    "post_per_second": 600,
    "register": 3,
    "register_per_second": 3600,
    "image": 6,
    "image_per_second": 3600,
    "comment": 6,
    "comment_per_second": 600,
    "search": 60,
    "search_per_second": 600,
    "published": "2023-02-05T03:52:36.832982"
  }
}

I'm getting limit rate with a 10 second delay so 1/post_per_second = 0,0016 seconds / post delay is not right. So what do those even mean and what is the delay I should have between posts?

[-] GodOfThunder@lemm.ee 23 points 1 year ago* (last edited 1 year ago)

I can confirm that the Opera method works. I couldn't create an account before but I've managed to create the account using the built-in VPN of the Opera browser. Here's an example of a Python script written with Claude 2 that GPT-4 wouldn't have enough context for, https://lemm.ee/post/2595655 Really impressive.

21
submitted 1 year ago* (last edited 1 year ago) by GodOfThunder@lemm.ee to c/auai@programming.dev

I asked the AI and it says:

To access Claude 2 from Europe, you have several options[^1^][^2^][^3^]:

  1. Access Claude 2 directly: According to Mashable[^1^], all you need to do is click "Talk to Claude" on the Claude 2 website and provide an email address. After confirming the email address, you should be able to use Claude 2.

  2. Use a VPN: Cybernews[^3^] recommends using a VPN to access Claude 2 if you're outside the US or the UK. This is because Claude 2 is only officially available in those two countries. The VPN will allow you to connect to a server in the US or UK and access Claude 2 as if you were located in one of those countries. There are several VPNs that Cybernews recommends for use with Claude 2.

  3. Use the Opera browser with integrated VPN: According to a YouTube video[^2^], you can use the Opera browser with its integrated VPN to access Claude 2 from Europe. The video provides a step-by-step guide on how to set this up.

It's worth noting that the EU has proposed stricter rules for high-risk AI[^5^]. While Claude 2 is not specifically mentioned in these rules, it's possible that they could impact the use of AI chatbots like Claude 2 in the future.

[^1^]: Mashable Article [^2^]: YouTube Video Guide [^3^]: Cybernews VPN Recommendations [^4^]: TechCrunch Article [^5^]: Tom's Guide Article [^6^]: Decrypt Article

Is this true? I can't understand the video.

https://youtube.com/watch?v=QocRRAefE4U

27
66
submitted 1 year ago by GodOfThunder@lemm.ee to c/lemmy@lemmy.ml

I've read some people saying that it's better. How has it changed?

[-] GodOfThunder@lemm.ee 53 points 1 year ago* (last edited 1 year ago)

I really like to see communities like lemmy.film, mtgzone.com, and programming.dev and wish there was an instance about literature.

64
submitted 1 year ago by GodOfThunder@lemm.ee to c/asklemmy@lemmy.ml
26
submitted 1 year ago by GodOfThunder@lemm.ee to c/linux@lemmy.ml

I want to configure a tool so that I can just call with a movie as an argument and automatically download the appropriate english subtitle by file hash or name. I recall I had something configured like that but now I don't remember what was the tool I used.

2

I'm getting errors with this function:

def compare_dates(date1: str, date2: str) -> str:
    date1_obj = datetime.strptime(date1, "%Y-%m-%dT%H:%M:%S")
    date2_obj = datetime.strptime(date2, "%Y-%m-%dT%H:%M:%S")
    return date1 if date1_obj > date2_obj else date2

Because the input sometimes includes microseconds. Is there a clearer way of dealing with this than what I've done?

def compare_dates(date1: str, date2: str) -> str:
    date_format = "%Y-%m-%dT%H:%M:%S"
    date1_obj = datetime.strptime(date1.split(".")[0], date_format)
    date2_obj = datetime.strptime(date2.split(".")[0], date_format)
    date1_obj = date1_obj.replace(microsecond=0)
    date2_obj = date2_obj.replace(microsecond=0)
    return date1 if date1_obj > date2_obj else date2
[-] GodOfThunder@lemm.ee 19 points 1 year ago* (last edited 1 year ago)

I know about https://programming.dev and https://mtgzone.com I wish there were one about gaming and another about fanfiction

18
submitted 1 year ago* (last edited 1 year ago) by GodOfThunder@lemm.ee to c/nostupidquestions@lemmy.world

Instances where most communities are related to a main subject, like https://programming.dev

19
submitted 1 year ago* (last edited 1 year ago) by GodOfThunder@lemm.ee to c/python@programming.dev

I've tried using pythorhead

search_results = lemmy.search(post_url)

but I get

AttributeError: 'Lemmy' object has no attribute 'search'

I've also tried requesting it myself but I don't get any results from the API even when I get it when searching for the same URL from the web interface.

@backoff.on_exception(
    backoff.expo,
    requests.exceptions.RequestException,
    max_time=MAX_BACKOFF_TIME,
)
def search(instance: str, url: str) -> Dict[str, Any]:
    api = f"https://{instance}/api/v3/search"
    query = f"?q={url}"
    response = requests.get(api + query)

    if response.status_code == 200:
        res: Dict[str, Any] = response.json()
        return res
    else:
        return {}

This makes it look more difficult than what I expected. https://programming.dev/comment/50809

[-] GodOfThunder@lemm.ee 21 points 1 year ago

Edward Snowden, a former National Security Agency contractor and government whistleblower, has been credited with the quote "Arguing that you don't care about the right to privacy because you have nothing to hide is no different than saying you don't care about free speech because you have nothing to say". Snowden has argued that privacy is a fundamental right and that without it, individuals cannot have anything for themselves. The "nothing to hide" argument has been used to defend the collection and use of government data beyond surveillance and disclosure, but critics argue that it is inherently paradoxical and that what is hidden is not necessarily relevant. Snowden has also stated that the burden of justification falls on those seeking to infringe upon human rights, and that nobody needs to justify why they "need" a right.

21
submitted 1 year ago* (last edited 1 year ago) by GodOfThunder@lemm.ee to c/lemmy_support@lemmy.ml

I would like to contact them in case there's a contributor who wants to take over the !issue_tracker@lemm.ee community and the bot account since it's giving me more trouble than I expected, and I'm no longer going to be using it.

[-] GodOfThunder@lemm.ee 19 points 1 year ago* (last edited 1 year ago)

Depending on which instances are blocked you will see different content in ones or others. Which is why I choose instance based on the minimum number of blocked users based on the results of this script.

17

I just read this post about someone who would like to have a choice to select an algorithm for their feed. However, developers cannot create something so vague without some ideas or inspiration. There is an issue with many great ideas for a customizable algorithm, but the I've never come across a website that has an algorithm like that. All websites seem to have their algorithm, and that's what users are stuck with. Although some websites have machine learning algorithms that adapt to user preferences.

I'm interested in hearing about what algorithms you like. And if you have any ideas on how to make Lemmy's algorithm better or more customizable.

21
submitted 1 year ago by GodOfThunder@lemm.ee to c/usa@lemmy.ml

The speaker discusses Ray Epps, who allegedly incited the January 6 Capitol assault. Tucker Carlson from Fox News is accused of promoting a conspiracy theory about Epps. Lawyers representing Epps plan to sue Fox News for defamation. The speaker questions why Epps, who encouraged people to enter the Capitol, hasn't been arrested, suggesting he may have been an FBI informant. The FBI denies orchestrating the riot but doesn't provide a clear answer. The speaker believes Epps was a fed acting to discredit the MAGA movement. The media's sympathy for Epps is questioned, implying a cover-up. The transcript ends with tour promotions.

[-] GodOfThunder@lemm.ee 20 points 1 year ago* (last edited 1 year ago)

Humans are more influenced by emotions than logic, which means that critical thinking alone may not convince them. Only those who are receptive to logical reasoning can be persuaded that way.

A video about it

[-] GodOfThunder@lemm.ee 23 points 1 year ago

A function decorator: You can create a decorator that handles the connection and cursor creation and passes the cursor to the decorated function.

import sqlite3
from functools import wraps

DB_FILE = "your_database_file.db"

def with_cursor(func):
    @wraps(func)
    def wrapper(*args, **kwargs):
        conn = sqlite3.connect(DB_FILE)
        cursor = conn.cursor()

        result = func(cursor, *args, **kwargs)

        conn.commit()
        cursor.close()
        conn.close()

        return result

    return wrapper

@with_cursor
def insert_post_to_db(cursor: sqlite3.Cursor, issue: Issue, lemmy_post_id: int) -> None:
    cursor.execute(
        "INSERT INTO posts (issue_url, lemmy_post_id, issue_title, issue_body) VALUES (?, ?, ?, ?)",
        (issue.url, lemmy_post_id, issue.title, issue.formatted_body),
    )
[-] GodOfThunder@lemm.ee 19 points 1 year ago

This is so cool. It's exactly what I had in mind when thinking of a modern bash alternative.

[-] GodOfThunder@lemm.ee 20 points 1 year ago* (last edited 1 year ago)
> *[@username](profile_link)* said:
>
> > Original quote from the person
>
> Source: [Link to the source](source_link)

For example:

> [@GodOfThunder@lemm.ee](https://lemm.ee/u/GodOfThunder) said:
>
> > How would you quote someone using CommonMark markdown syntax?
>
> [Source](https://lemm.ee/post/1063209)

Result:

@GodOfThunder@lemm.ee said:

How would you quote someone using CommonMark markdown syntax?

Source

[-] GodOfThunder@lemm.ee 24 points 1 year ago

I think Israel has too much of an upper hand there to ever leave. It's only a matter of time before they make smaller and cheaper drones that they can release as a swarm.

[-] GodOfThunder@lemm.ee 20 points 1 year ago* (last edited 1 year ago)

I like this idea, but I would suggest generalizing it to apply to any similar posts. That way, we can find the best answers to a question without having to open multiple posts asking the same thing.

Issue #1908: Merge comments from similar posts into a single view

view more: next ›

GodOfThunder

joined 1 year ago