Beliavsky / FortranTip

Short instructional Fortran codes associated with Twitter @FortranTip
https://zmoon.github.io/FortranTipBrowser/
The Unlicense
64 stars 14 forks source link

Tweet automation? #26

Open zmoon opened 2 years ago

zmoon commented 2 years ago

Thinking about https://github.com/zmoon/FortranTipBrowser/issues/2, with that kind of workflow it would be possible[^1] to automate the Tweet creation.

The text file format could be like:

The tweet text for the tip could be here at the top.

Maybe with multiple paras.

Long version
============
This would be the long version of the tip text.
This section (including heading) would be optional.

It can have multiple paras too.

Another option would be to place the tip text for the tweet and optional long version as comments in the Fortran source code file, would just have to decide on a format to use.

[^1]: I just got a Twitter API key, and there are some options for automating Carbon. I could write a GitHub Actions Workflow to check for new .f90/.txt files upon push to the main branch and create a draft tweet if one is found.

Beliavsky commented 2 years ago

Good idea, thanks. Let's try it out. You now have contributor privileges through TweetDeck for @fortrantip. I just uploaded function.f90 and function.txt to this repo. You can create a tweet and post it from @FortranTip if it looks good.

zmoon commented 2 years ago

I've gotten Carbon automation working, but I'm not sure I have the style settings exactly the same as what you have been using.

So far I have (https://github.com/zmoon/FortranTip/blob/8883acf3c9c2a566f68db40f7dd83cd3f360486a/tweet/tweet.py#L19-L25)

code

Beliavsky commented 2 years ago

Looks good.

zmoon commented 2 years ago

I figured out the auto tweet posting. But in order to post as @FortranTip we need to generate an access token for my "app", which I am not really sure how to do.

Beliavsky commented 2 years ago

I guess you figured it out, since I see the tweet. Thanks.

zmoon commented 2 years ago

Haha I just did it manually because I was tired of fiddling with it. I think I could generate the token if you (privately) shared the FortranTip credentials?

Beliavsky commented 2 years ago

I just did through TweetDeck.