API, JSON

This week’s lesson into API and JSON took some digging to understand, but it was helpful to have analogies. Picturing an Application Programming Interface as a waiter in a restaurant that takes requests and tells a chef (or system) what the customer wants is interesting. I haven’t considered really how we use applications and devices to access databases and make requests, at least on the level of depth that I know now.

I am still working to understand both, but it’s definitely a lot less murky than before this week.

As for my final project, I’m still hashing out which three customizations I want to use, and I’m thinking ill just end up using all seven that I noted as possibilities in my updated post. I actually am also taking some of the photos for the galleries this week, and am excited to have the skeletons of everything placed on my website.

I still have to go back to I believe it was lesson / week seven (?) to relearn the shopping cart customization. My site is hopefully going to utilize both the PHP search option, short comment box and shopping cart as the primary user-interactive functionality.

I’ll also say that this class (and particularly this project) has gotten me more into the habit of checking the code behind websites I think are aesthetically pleasing, clean, user friendly and not too “busy.” I can bring a short list of possible customizations I’ve seen on other sites to class that I would want to explore whether they’d be doable for this project.

APIs, The Unsung Hero

Through this week’s reading, I have realized that APIs is an important part of my life because it allows interactions between applications, data and devices, giving us the connectivity that we love and deserve! To be honest, I was originally skimming through this week’s reading and I had a lot of trouble understanding APIs at first, causing me to be extremely frustrated.  As soon as I slowed down and gave the API readings a chance, I realized that “what is an API” is a question that people should be asking more often, especially with how imperative technology is in our world.

So what is an API?! This is a question I surely have been asking all night. I enjoyed watching the analogy in a video I watched this week that described an API as you requesting an order and the waiter acts as the communicator telling the kitchen your order and delivering the food back to you. I have noticed that many programmers have different definitions for what they believe an API is. Simply put, APIs make a lot of sense using the waiter analogy, but gets extremely complicated to me when I hear about there being unique APIs for Google and WordPress. In one of the articles, it says that the difference in a Google API is the format of the request and the response. Are most APIs typically very similar in format? I also noticed that the WordPress API also uses  JSON, but I am not sure if they are the same kind of API. I thought of the JSON version of an API as the waiter receiving an order from a foreigner, trying to make sense of it in the kitchen and then returning words in a new language. Not sure if this analogy makes sense, but hopefully there is one that would explain the format better to me.

I am still trying to make sense of APIs because it seems like it is a title some programmer just threw out there. Is an API something a programmer creates with the server? Although there are many questions out there, at least I know that APIs are our unsung hero!

Debating a change

During class this week, we discussed our midterm profiles We talked about Django, which is a high-level Python web framework, and how it operates. We learned how some people started learning how to code at age 57, so it is never too late to start.

We also discussed APIs, which stand for Application Programming Interface. It is the link that communicates the user’s request to the server and delivers back a response. APIs make connectivity between sites possible, especially in a complex set-up where many servers are connected to one user page. There are different kinds of APIs. I watched the video about the REST API, where it explained how we can type functions in the browser and an order will go out to the server and then a result will show up accordingly.

Figuring out FileZilla was interesting. I was not able to connect to it during class even after connecting to Saxanet. I contacted customer service and they said that my account is working and they are not sure what the problem is. After much frustration, I went home and tried it again on a different internet and it worked right away. I went through the instructions that Greg sent, but was not able to figure out what exactly to drag into the directory. I will work with Greg on Tuesday to make sure I have the right folders in the right places.

My final pitch is coming together. I want to create a consistent brand with the same colors, fonts, and design throughout all my platforms. This way there is an association between my name and that brand. I want my website to be easily navigable and all tabs are clear and straightforward.

I started my new job this week. We work with many departments to help them live stream events. We send them a toolkit to walk through the steps of setting up the live streaming, how they can manage it and what information they need to submit to our team. The tool kit is a Word document that we share and the manager was complaining about how inconvenient that has been. I was thinking we should create a website that we can add plugins to and we can have the steps for live streaming laid out, as well as various sections to upload the information our team needs. We can also add an FAQ section and a demo/examples section. I was debating changing my final project to this instead of a personal website. I will discuss this possibility with Greg tomorrow. 

API

The waiter analogy in the first tutorial set the meaning and function of APIs as clear as could be. I have always maintained that the use of everyday activities as references remain the most effective form teaching. Henceforth, that analogy will remain in my mind when I see the services of a waiter. I was so amazed about the power of the REST API and its possibilities. I will have to revisit most of the explanations at a later time to cement my understanding and its usage. But in all, the concept seem fairly simple and straight forward. I have been watching a few tutorials about the powerful symbiotic relationship between APIs and JSON. I was particularly impressed with this resource on REST API concepts and examples and how to make a API request (graph.facebook.com/youtube). I tried a couple of websites but got this error message.

{
   "error": {
      "message": "An access token is required to request this resource.",
      "type": "OAuthException",
      "code": 104,
      "fbtrace_id": "HuZcagOScRx"
   }
}

Updated final pitch post

What: For my final project I will do a personal site; specifically, a blog-type of site that will have content focused on wine. It will be an informative, yet general and approachable blog that will serve as a place to learn nuances to specific varietals and their profiles.

Who: The main audience for this site will be geared towards younger adults, but not exclusively. This will be made for people who are interested in wine, but don’t know too much and want to learn more.

Why: I want to do this kind of site because I think the voice and style is something that best fits my interests and will be something I could see myself using. This audience is near my wheelhouse and I chose wine because I’ve studied wine before and plan on taking it up once again to hopefully get my Sommelier 1 this summer.

Proposed customizations:

1. Customization 1 (to-do): create child theme and update design with CSS
a. What: create child theme and update design with CSS
b. Why: to design site to align with content
c. How: download/use existing theme, make child, add CSS customizations
2. Customization 2 (to-do): create wine list instead of reading list
a. What: create wine list instead of reading list
b. Why: customize site to align with purpose-wine, not books
c. How: write code to create custom
3. Customization 3 (to-do) plugin for categories/varietals of wine
a. What: plugin for categories/varietals of wine
b. Why: to align with site content-wine
c. How: write code to create custom

  • create child theme and update design with CSS
  • create “wine list” in place of “reading list”
  • gallery plugin
  • plugin for custom header
  • use CSS to change design
  • create plugin to adjust theme functionality

Final-Pitch Road To Fit Update

WHAT: My final project will be focused on one of my niche interests of fitness and nutrition.

WHO: My goal is to connect with others that want to get into fitness, but don’t know how or where to start.

WHY: I chose this because I have always been into blogs and Instagram posts that inspire me to go on my own personal fitness journey. I want my final project to be personal, but also allow others to connect through input of their journeys as well.

Customization:

TIMELINE FOR EACH:

timeline: research by apr 9, psuedo code by apr 10, writing code Apr 12-14,  testing locally & debugging apr 15, testing live & deploying apr 17-21

  • gallery slideshow of different fitness classes and nutrition programs with captions.
  • social media accounts of major fitness and nutrition bloggers for inspiration. This will be customized because this will be an API of a live feed according to the map.
  • Taking a shot on child page customization
  • contact form
  • menu with sections like about me, fitness recommendations, nutrition recommendations, locations, fitness blog
  • API of an interactive map with different locations of different fitness and nutritious places
  • customization of fonts and colors

Final Project Pitch: Update

It’s Susan’s Thing

What: My final project is a simple, yet insightful website, that aims to share with its readers the latest trends in the fashion industry.

Who: My target audience would include individuals interested in the novelties in that sphere of life, in their twenties to mid-thirties and probably from English-speaking countries around the world.

As it comes to the theme of the website, I am aiming for a minimalist-look with a format of an online newsroom/blog. The posts would have a maximum of 200 words, with videos and links to external sources for more variation in terms of content. Some of the code customizations would include:

  • Gallery slideshows.
  • Contact forms.
  • Embedded videos in the posts.
  • CSS font variations (with colors/sizes consistent throughout the website).
  • CSS horizontal navigation bar.
  • PHP search bar.

Pitch for a new profile site

What: The site will be an updated version of my current profile site (which is live at corydawson.net). I plan to make it more streamlined, add more content and particularly try to show off my news photography.
Who: The audience will likely be potential employers and anybody who’s interested in my work. It will include my work experience and ways to get in contact with me.
Why: Having a site like this is very important for anybody working in journalism, media, art, etc. — basically for anybody who creates things for a living. It’s also now a chance to show people what you can do to promote yourself. Being able to say that the website was built by you is also a huge plus.
Update 3/31/2019
Planned modifications:
1. A photo slideshow of some of my favorite news photography I’ve done. Would like to hyperlink each photo to the relevant underlying article.
2. A similar video slideshow of some of my favorite news videography.
3. A contact form on a dedicated page (I’ve already built the skeleton of one on my “hello world” page).
4. A PHP search bar (EDIT 4/2/2019 — Removed the add Twitter feed customization per Greg’s instructions )
5. A child theme so I can style the site with custom colors and typefaces (I don’t like the standard typefaces, I prefer Google’s OpenSans as a body typeface).
6. A dedicated page describing how to securely contacting me with several options, similar to what several news organizations already do. I would like to set up SecureDrop so that sources can send me documents safely. I would also like to set up a PGP fingerprint and public key so that I can securely converse with sources. 
URL: corydawsonmedia.com
Update 4/7/2019

Plan for code customization and timeline for code customization

  • Contact Form Plugin:
      • What: A contact form that enables people to send me an email with their name, a subject line, body, and a checkbox that enables rapid-reply. I found a way to get a text message through PHP so I want to be able to give people the option of basically texting me through this form, as I could see some of these requests possibly being urgent.
      • Why: Need to have a way for people to get in touch with me, from possible sources to employers to collaborators.
      • How: Research past successful contact forms. Build it out in PHP and HTML, style in CSS. Keep to the timeline!
      • Timeline:
        • Research: 4/9
        • Pseudo-code: 4/11
        • Writing code: 4/13
        • Testing locally: 4/15
        • Debugging: 4/17
        • Deploying: 4/18
        • Testing live:4/18
  • Published article plugin:
      • What: A plugin that will be able to create a post within a specific page (pages with the name of an outlet I’ve worked at). The posts are of articles I’ve published. The post provides metaboxes for a headline, first few paragraphs, date, a clickthrough to the full article on the publication website, the page and a photo.
      • Why: I want an easy way to add a new article to the profile site in the correct page with a quick way to get a sense of the article and to click through to the full article on the publication website.
      • How: Research how to create a plugin like this, possibly using the ‘reading list’ plugin we used as an example. The plugin will be created in HTML, CSS and PHP. Keep to the timeline!
      • Timeline:
        • Research: 4/9
        • Pseudo-code: 4/11
        • Writing code: 4/13
        • Testing locally: 4/15
        • Debugging: 4/17
        • Deploying: 4/18
        • Testing live:4/18
  • Child Theme:
    • What: Customizing the site to look sleek but easily accessible for my targeted users. Will have a homepage with an introduction, a contact page, and separate pages for each outlet I’ve produced content at.
    • Why: Formatting the site for my targeted users which who are primarily potential employers, sources and readers is important because I want those users to be able to easily use the website as a showcase.
    • How: Research some similar profile sites to get an idea of the design language I’m looking for. Sketch some layout ideas by hand. Take down names of typefaces I like to use in the site. Perhaps use Bootstrap to simplify the CSS. Edit the stylesheet.
    • Timeline:
      • Research: 4/9
      • Pseudo-code: 4/11
      • Writing code: 4/13
      • Testing locally: 4/15
      • Debugging: 4/17
      • Deploying: 4/18
      • Testing live:4/18

Learning PHP and more

Getting an introduction to PHP was different, as we were both not using Codecademy, and also have the benefit of already having a JavaScript background. Being familiar with the terminology was supremely helpful, and in many ways, I preferred the simplicity of PHP. It seems that everything I need to do uses fewer characters than in JavaScript. 

However, learning on the learn-php.org forced me to go a little bit slower. There were terms and references I didn’t understand from the get-go, which turned out to be a blessing because it led me to further research. The site initially referred to PHP, Python, Ruby etc. as “MVC based web frameworks,” which I had to look up. I still don’t quite understand how the framework operates — MVC stands for Model-View-Controller — but I was able to understand in concept that the “model” is essentially the underlying information of a webpage, and the “view” is the UI (User Interface). The controller is the logic and another actionable language that interacts between the model and the view.

Another concept that I ran into and didn’t understand was the idea of “zero-based indices.” Research revealed that this concept simply means that any initial element of a sequence starts at zero instead of one. The concept is common among programming languages. The lesson also referenced Perl, which I had not heard of but quickly found out was just another programming language.

For my profile, I talked with Ryan Schneiderman who is an up-and-coming web developer who recently hand-coded a website for his father, a prominent photographer. He used several technologies that I had little prior exposure to but found very interesting. He used a Python-based web framework called Django (which is an MVC-model!) to build the site, and hosted the data-rich images on Amazon Web Services.

Because the site was very image-heavy and used a lot of sliders, he used a method to allow the page to load all the images in a slider first so that the site didn’t need to load a large image whenever a user moved to the next slide.

Schneiderman, who is a high school basketball coach, is also developing a web and mobile application for coaches to plan and design plays.

WordPress and making stuff (sort-of) work in PHP

The work we did in WordPress during class last week was very informative and I’m glad we’ve learned about child themes and plugins. I’m excited to try and create my own plugin now. Sometimes this stuff seems like magic. I was blown away at how, by simply adding a couple folders and files, a new plugin just appeared.

When getting to the PHP assignment, I felt ill-equipped, frankly. Coming off of spring break, after having just a couple weeks of lessons I had to revisit a lot of material. I used plenty of YouTube videos, forums and such to help out, but I felt like I was making small mistakes along the way.

I realized I still have fundamental questions that need answering. How does the computer understand my functions? Should my PHP files be on a server for them to work correctly? Why is it that in Sublime Text, what I know to be accurate PHP functions don’t show up in a colored text? That last one caused me a lot of anxiety!

I also didn’t know what else to add to my homepage in PHP to add useful functionality, so I resorted to just adding basic things that would (I hope) satisfy the requirements of the assignment. The only thing I added that I could see myself keeping in a final version is a contact submit form.