• 1 Post
  • 11 Comments
Joined 1 year ago
cake
Cake day: October 1st, 2023

help-circle

  • I got it working in shell as well:

    #!/bin/bash
    
    read -p "Username: " user
    read -p "Password: " -s pass
    read -p "TOTP: " totp
    
    res=$(curl \
        --request POST \
        --url "https://feddit.ch/api/v3/user/login" \
        --header 'accept: application/json' \
        --header 'content-type: application/json' \
        --data '{"username_or_email":"'$user'","password":"'$pass'","totp_2fa_token":"'$totp'"}')
    
    jwt=$(echo $res | sed -re 's/^.*"jwt":"([^"]*)".*$/\1/')
    
    curl \
        --request GET \
        --url "https://feddit.ch/api/v3/user/export_settings" \
        --header 'accept: application/json' \
        --cookie "jwt=$jwt" \
        -o "export.json"
    

    I’d recommend echoing $res and $jwt before processing them further

    Edit: if you don’t have TOTP enabled, don’t forget to remove it from the request

    Docs: https://lemmy.readme.io/reference/post_user-login

    Edit 2: added spacing





  • PARIS, Feb 26 (Reuters) - France’s President Emmanuel Macron said on Monday there was no consensus on sending troops to Ukraine, but the subject could not be ruled out.

    “There is no consensus at this stage… to send troops on the ground,” Macron said after hosting some 20 countries allied to Ukraine.

    “Nothing should be excluded. We will do everything that we must so that Russia does not win.”


    Saved you a click. Yes, that’s it. That’s the entire “article”. A total of 4 sentences. What exactly was the point of writing such a short article?

    Edit: pulled my head out of my ass.







  • malijaffri@feddit.chto> Greentext@lemmy.mlAnon meets a guy online
    link
    fedilink
    arrow-up
    10
    arrow-down
    1
    ·
    1 year ago

    Honestly, it’s a love-hate relationship. There’s nobody they hate more than the other, at the same time there’s nobody who understands them better than the other.

    Even then, the hate is mostly political. It’s politically beneficial to both countries to keep the hate flowing.

    Source: am Pakistani.