Day 12 Twitter App (see project overview)
You probably shouldn’t say you don’t need a fancy javascript library in public!
I’m probably being a bit dense, but I don’t really understand why we need anything other than JQuery for your average web app. I like AngularJs fine. Also, I think those javascript libraries add a whole bunch of weight. If you need them, fine, but I’m not sure we always need them.
I know you do need javascript even if you’re trying to use straight Django. I know I don’t use forms enough in the work I do. I like forms, but I learned to use Javascript before I understood that forms are the proper way. Just and aside on how learning the wrong way sticks with you.
Could I have used something that was already written? Probably. You always can.
The Twitter site suggests this code library for searching tweets.
I’m not going to use it because I think what I have to do is simpler. Also, I just want the experience of doing it myself. Thirdly, I’m not sure this library supports the free api and I want free (of course).
Use the latest and greatest of whatever you’re using.
I have used Bootstrap 3 quite a bit. I love Bootstrap. I tried Bootstrap 4 today and had some troubles. The troubles had totally to do with the stuff I included—more precisely, didn’t include, but before discovering that, I considered just keeping with the Bootstrap 3 stuff I already had that worked. Even though I know we should always pick the latest and greatest of whatever library we choose, I often fall into the trap of not wanting to take the time to update something because that’s not what I want to work on right now. It’s ok to put upgrades off a bit, but not for long. Still, it’s an easy trap to fall into.
Commit history is informative
Wish I had been incrementally updating this code in git. I’m going to start, now. The main reason I didn’t add it right away is because I have a secret in my settings file and I want to get that out of there before committing anything. But, figuring out how best to do this requires a bit of research. Based on the 12 factor rules, the secrets should be stored in environment variables. That’s good enough for me, I will do it that way. But, then, it seems that there needs to be a best practice mention of how to keep these variables.
This code, is another option for environment variables, which I like. But, I think the best thing to do for now is just create my own .env file and source it in bash. No doubt, I’ll come back to this and do it differently later.
Who hoo. Kinda in Github.
Project committed to GitHub. It’s starting out as a private repository, but my plan is to make it public once I’ve tested out.
Now, I can continue with the Twitter class, which is the part I’m translating from the first PHP version. I stopped because I got to the point where I used the Consumer Key, Consumer Secret, Access Token and Access Token Secret. In the PHP version, they are in the code. I deployed this version to Heroku so that my daughter-in-law, Melody, could use it. Obviously, I wasn’t trying to use best practices every step of the way that time. I had just started a new job and was working a second part-time gig, so I had pretty much zero time and I never planned to use this for anything more than a favor for Melody’s research. There are always excuses for skipping important steps!
The python version of the tweet search works. I still don’t know what to do with the data once I get it. I think it’s time to add registration/log-in/tests/logging (I kind of have that already). I’m feeling pretty good about it. I think I can get by for free for the rest of this month. So far, I’ve only used 10 of 250 requests and 10 of 25000 Tweets in the 30-day endpoint and none in the full-archive endpoint.
What? Feeling like I accomplished something? Enjoy it for the five seconds it lasts.
Feeling like I have made good progress today. Tomorrow, I’ll see if I can get this baby public ready (no one will know about it, so my public is my family) so I can go onto using the stuff I learned when I started (AWS, Terraform, Docker).