Test from ftlk in rust.
Oh damn! That took a while, was a pain in the ass to get the json stuff working, but now it did! So now I get the token as json, fetch it and then use it when I created the post above! Woho!
The issue I had was the way the json library got the value, it included qoutes, which I do not want when I create the header info, and that is what took the most time to figure out how to solve, but not that works, which is nice! Next up is fetching statues and show them, and also a dynamic gui for posts.
@stigatle@twtxt.net Nice progress 👌
@prologic@twtxt.net Thank you. I’ll work on fetching and parsing all the posts after work today. Looking forward to getting this into a working state.
@stigatle@twtxt.net The API should already be doing a lot of the parsing work for you👌
Leg me know if something is missing 🤗
@prologic@twtxt.net Yeah, I’m sure all I need is there, the challenge is to set up the gui for it all - it’s not always clear how to do it all for me (in rust), but I’m sure I’ll get that stuff solved :) If I start something I work on it until it does what I need.
I might also switch to another gui library, I have to check out a bit more which one I feel is easiest to use for what I need.
@stigatle@twtxt.net Cool 👌
Got the timeline, that was very easy to do, but now the harder part starts - wrap the timeline into a nice gui.
This is where I need to put in some work now. Started on this today.
Also, I’m struggling a bit with some basic stuff, for example variables, does not work the same way as I’m used to with c++ it seems, so it’s a bit confusing, re-using variables as input to several functions does not seem to be as straight forward as I’m used too - so I need to find some more info about stuff like that.
Also the callback stuff for buttons and such is really weird to me. But I’ll stick with it.
So - this is probably what I was looking for:
https://stackoverflow.com/questions/59814530/issue-with-string-using-in-multiple-functions
@stigatle@twtxt.net Hmmm kind of weird really 🤔 I guess most things in Rust are immutable?
okay, so all chores for today is done, so I have some time to code some more. I will resume my variable and functions adventure in Rust.
Found what I needed finally.. I now created a struct with this crate:
https://crates.io/crates/arraystring
That works for what I need, damn this has been annoying to find a solution too.
I can now store the strings I need in the struct, and use that in all the functions.
Also works with the GUI callback stuff, so it solves the Issue I’ve been having.
I have now added gui elements for server url, username, password.
And functions for fetching the timeline with the supplied info.
So now I can finally start working on the timeline GUI.
It’s been in a way easier then expected, but also somethings are a bit tricky.
I could easily have done the same in c++ much faster, but the whole point here was to learn more rust.
And for that it’s been going well.
@stigatle@twtxt.net Got an early screenshot? 🤔
@prologic@twtxt.net I will most likely post something tonight. Right now its juts a window with 3 input textboxes and some button, nothing fancy at all. :)
Im very close to making the decision to just rewrite what I have in c++ instead. I feel I would have done this much faster with that. I’ll think about it until tomorrow. I’ll probably do that anyways just to see. just start with cmake and get started with it.
Okay, so I spent about one hour setting up cmake, fltk and libcurl for c++, got all that running now.
I still need to fix the cmake script a bit, but I have a working verison now with this.
I will now add the same curl stuff I had in rust in c++, then work on the gui and all that.
So I will drop rust, and go for c++ instead, much easier for me. Was worth a try in rust, but for now that’s not for me to be honest, I much faster and better in c++.
So, progress is going smooth!
No I have compiled libcurl with openssl, and I fetch token already.
so next is creating three functions - one for posting, one for the login and fetching token (now I have just testing login when application starts), and the fetch the timeline. Then I need the gui.
Progressed faster in 2 hours in c++ then days with rust…
Ah, I forgot - first i need to add a json library, so I’ll do that now.
Json parsing is done :)
Now I can write the rest!
@stigatle@yarn.stigatle.no Very nice 👌 You’ve made me realise we should have a Desktop app too. No reason we can’t do that and turn out Mobile App into a Desktop App as well 🤣 Can’t wait to see yours!