Danie1 / threads-api

Unofficial Python API for Meta's Threads App
https://pypi.org/project/threads-api/
MIT License
121 stars 16 forks source link

post threads #1

Closed kirilkindan closed 1 year ago

kirilkindan commented 1 year ago

Hello! Can you please let me know if you will be able to post soon?

pj8912 commented 1 year ago

Uploading to threads video

Danie1 commented 1 year ago

Uploading to threads video

Our threads-api already supports the displayed functionality in the video, moreover it is open-source and available (opposed to the video's code). ;)

Danie1 commented 1 year ago

Hello! Can you please let me know if you will be able to post soon?

This is quite the challenge at this point, since the desktop version is not yet available (only mobile). I will look into this.

Danie1 commented 1 year ago

Hello! Can you please let me know if you will be able to post soon?

Posting functionality is now available in the latest version v1.0.7: https://pypi.org/project/threads-api/

pj8912 commented 1 year ago

Upload Working!! My upload script

from threads_api.src.threads_api import ThreadsAPI
import asyncio
import os
from dotenv import load_dotenv

load_dotenv()

async def post():
    threads_api = ThreadsAPI()
    await threads_api.login(os.environ.get('USERNAME'), os.environ.get('PASSWORD'))
    result = await threads_api.post("I am posting this from the threads api!")

    if result:
        print("Post has been successfully posted")
    else:
        print("Unable to post.")

async def main():
    await post()

# Create an event loop and run the main function
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
pj8912 commented 1 year ago

WhatsApp Image 2023-07-10 at 08 23 09