belesspathetic / fb_poster

An unofficial Rust API client for Facebook post uploads.
3 stars 1 forks source link

Awesome library #1

Open milen-denev opened 8 months ago

milen-denev commented 8 months ago

I don't have any issue in particular. I will take a look try to help out to add some other options (most notably a photo with text). Nice job! Happy to use it!

belesspathetic commented 8 months ago

I don't have any issue in particular. I will take a look try to help out to add some other options (most notably a photo with text). Nice job! Happy to use it!

Thanks for your feedback! I really appreciate it. Adding text to the photo is a good point. I will publish a new version soon ^_^

milen-denev commented 8 months ago

Ok is it on your own roadmap (to avoid duplicate work) ?

belesspathetic commented 8 months ago

Ok is it on your own roadmap (to avoid duplicate work) ?

Updated the version. Added the ability to add text to photos and also added the ability to publish reels. And as you can see, I don't have a roadmap)

belesspathetic commented 8 months ago

Ok is it on your own roadmap (to avoid duplicate work) ?

There are several functions that I tried to implement, but I still don't understand how:

milen-denev commented 8 months ago

Ok is it on your own roadmap (to avoid duplicate work) ?

Updated the version. Added the ability to add text to photos and also added the ability to publish reels. And as you can see, I don't have a roadmap)

Ok great!

  • [ ] - Resumable upload for videos because non-resumable is a little sus and have a bad limits.

Oh my I don't have a clue either, so better skip for now.

  • [ ] - Post scheduling to be able to publish at the desired time.

I think here you must specify is_published as false and scheduled_publish_time timestamp.

Here is a code to help you out to aquire the timestamp:

use std::time::{SystemTime,UNIX_EPOCH};

pub fn get_time_in_seconds() -> u64 { 
    let start = SystemTime::now();
    let since_the_epoch = start
        .duration_since(UNIX_EPOCH)
        .unwrap()
        .as_secs();

    return since_the_epoch;
}

There is only 1 missing part, to add time span to the function. Next:

reqbody = reqbody.text("message", msg.to_owned());
reqbody = reqbody.text("is_published", "false".into());

let timestamp = pub fn get_time_in_seconds(TimeSpan);

reqbody = reqbody.text("scheduled_publish_time", timestamp.to_string());

Let me know if you need any help buddy!

belesspathetic commented 8 months ago

Ok is it on your own roadmap (to avoid duplicate work) ?

Updated the version. Added the ability to add text to photos and also added the ability to publish reels. And as you can see, I don't have a roadmap)

Ok great!

  • [ ] - Resumable upload for videos because non-resumable is a little sus and have a bad limits.

Oh my I don't have a clue either, so better skip for now.

  • [ ] - Post scheduling to be able to publish at the desired time.

I think here you must specify is_published as false and scheduled_publish_time timestamp.

Here is a code to help you out to aquire the timestamp:

use std::time::{SystemTime,UNIX_EPOCH};

pub fn get_time_in_seconds() -> u64 { 
    let start = SystemTime::now();
    let since_the_epoch = start
        .duration_since(UNIX_EPOCH)
        .unwrap()
        .as_secs();

    return since_the_epoch;
}

There is only 1 missing part, to add time span to the function. Next:

reqbody = reqbody.text("message", msg.to_owned());
reqbody = reqbody.text("is_published", "false".into());

let timestamp = pub fn get_time_in_seconds(TimeSpan);

reqbody = reqbody.text("scheduled_publish_time", timestamp.to_string());

Let me know if you need any help buddy!

thanks!