Showing posts with label Accounts. Show all posts
Showing posts with label Accounts. Show all posts

Wednesday, 2 March 2016

Node JS - Project 2 - Bank Account

Hello! I'm back again!

In this project we want to be able to do the following things:

  1. Create new bank accounts
  2. Search for bank accounts
  3. Deposit and withdraw amounts
  4. Check account balances

In lesson 18 of The Complete Node JS Developer Course (check here for an update on my progress so far), the task was set out, and we had to go away and work through it independently. Lesson 19 is a step-by-step guide to a complete solution.

Getting Started


In lesson 18 we did the ground work for the project. This is the code we created to set the foundations:



We have created an empty array that will store all of the accounts, and there are some methods (or functions) that we can call on to make deposits, withdrawals, and check balances.

The Task


In the instructions we are told to create a new function called 'createAccount'. It's going to take an account object and store it in an array of accounts.

Each account object needs a 'balance', which should be a number, and a 'username', which should be a string.

The second function we're going to create is called 'getAccount' and takes one argument, which is 'username'.

The Solution


createAccount

We start with the 'createAccount' function. It accepts one argument, which is the object 'account'.


Basically, what we've done there is create a function, 'createAccount', that takes an account object and pushes it into the accounts array.

Now we can work on our 'getAccount' function.

getAccount


Within the function, we use forEach to iterate over the accounts and find any matching account.

We create a new variable called 'matchedAccount' within the function, which will store the account if a match is found.

Within the forEach, we want to check if the username of the account matches any of our accounts, so we create an if statement to do that. We then save the account to the matchedAccount variable that we created earlier.

We then return the matched account.

Re-cap


So, here's what we have so far:


Underneath that, we are going to create a new account.

New Account


We create a new account and save it to a variable. We then set that variable equal to createAccount, which is a function that expects an account object. The new object is created right within the function! Awesome! We give it a username and a balance. Yay!


Let's start as we mean to go on, and make a deposit into our account.

Deposit


We'll be using that function we created earlier on lines 19 to 21. Here's a quick reminder:


Here's how we make a deposit into our new account:


Lovely!

We use console.log to keep track of things, and we do this with the getBalance function (also created earlier on lines 27 to 29):


Withdrawal


Another old'un, but a good'un (on lines 23 to 25):


And here's how we use it:


getBalance makes another appearance :)

getAccount

The star of the show!

Create a new variable called existingAccount, and set it equal to getAccount, with the username passed in. It accepts one argument, a string.


It will return the balance of the my account!

We can test it out by creating another account for Pinky.


To make sure that everything is working as it should do, we can log out both of the accounts that we have created so far, by simply doing the following:


That will log them both out to the terminal, with their usernames and balances. Beautiful!

Finally, let's create a new variable for the Pinky's account (like we did with my account earlier):


Here's a re-cap of that code from line 31 onwards:


And it's all done! Until the next time :)

Wednesday, 4 November 2015

Sprout Social - Free Trial - IT Nut Blog Review

I've heard a lot about Sprout Social, and I wanted to know what it can do, so I signed up for the free trial. If you are thinking of using Sprout, I hope you will find this review slightly helpful. If you do use it already, maybe you have some insights that I have missed, so please share your comments.

At the moment, I keep on top of the social media for my business using tweetdeck, twitter analytics, unfollowers, and the integrated analytics tools for Facebook and LinkedIn. That means I usually have at least half a dozen pages open on my laptop at any given time just to keep on top of the usual social media platforms. Plus the other platforms that I am exploring, such as medium, reddit and livejournal. That's not to mention keeping tabs on my website and blogs - Sumo.me and Google Analytics are my nbf's!


The Sprout Social Dashboard gives a quick snapshot of how your different social media profiles are performing. The main sections of the dashboard are:

  • Group Trends - Which displays the stats used by the various platforms (E.g. tweet impressions, engagement, etc.)
  • Audience Demographics
  • Connected Profiles

The buttons across the top of the app interface take you to the 6 main sections:
  1. Messages
  2. Tasks
  3. Feeds
  4. Publishing
  5. Discovery
  6. Reports


1. MESSAGES


The term 'messages' seems to be used as a loose term. It includes twitter Mentions, Direct Messages, Retweets, Retweets with Comments, New Followers and Sent Messages. For Facebook it includes Wall Posts, Comments and Private Messages.

The results are filtered by selecting / deselecting the checkboxes next to each of the above categories. You can also save messages here.

There is also an option to add 'Brand Keywords' to further filter / expand the results. You are able to add 5 'Brand Keywords' to filter the results. I sent Sprout a tweet asking if they just limit it to 5 keywords for the free trial, or if that's standard with the paid version too. They responded with the following tweet:




2. TASKS


Tasks are created by going back to the messages section, selecting the desired interaction and clicking on the drawing pin icon. You can then leave an 'internal' comment and select a 'Task Type' from the following options:

  • General Task
  • Sales Lead
  • Support Issue

The task will then show up in the Tasks section. This creates a 'to do' list that is very useful and easy to action / follow for future reference.


3. FEEDS


I connected my twitter, Facebook and LinkedIn profiles to sprout social. This section allows me to access those separate profiles in a central place within the Sprout Social app, rather than checking the profiles within the other apps individually. Having this central location definitely saves time.


4. PUBLISHING


This is a way to publish content across multiple platforms from one central location, and posts can be scheduled in the calendar for future dates. Again, this will doubtless save time for busy social media marketers.


5. DISCOVERY


The main subsections and sub-subsections are:

  • Suggestions - 'Your Followers', 'Conversed with', 'Have mentioned you'
  • Cleanup - 'Silent Accounts', 'Irregular Usage', 'Do not follow back' - I currently use unfollowers to check the accounts that are not following back. Sprout incorporates this into the app, so that is a plus.
  • Smart Search - This does what I use tweetdeck to do. It's great that this function is housed within the Sprout Social app, but the advantage that tweetdeck has over Sprout is that tweetdeck displays the keyword searches in columns, so you can glance across multiple topics, side-by-side, without having to change the display.


6. REPORTS


Last, but definitely not the least!

Note: This is where you can include Google Analytics for your website or blog. Very useful.

The subheadings are:

  • Group Report - This is similar to the Dashboard.
  • Engagement Report - Goes into more detail about the overall engagement across the group profiles.
  • Facebook Pages - Gives detail on engagement with Facebook pages.
  • Twitter Profiles - Gives detail on engagement with twitter profiles.
  • Trends Report - Reports for each individual twitter profile.
  • Twitter Comparison - This is a really useful tool! It allows you to generate comparison reports between your accounts and other twitter accounts. A great way to gauge your effectiveness compared to main competitors!
  • Sent Messages - Tracks the performance of tweets in which you have mentioned other users.


IN CONCLUSION...


Sprout Social is a great app with lots of very useful features. I'm sure it is an invaluable tool for very large or busy businesses, that are running lots of social media profiles and campaigns simultaneously. Running a small start-up company, however, I'm not sure if I can justify the cost just yet, when there are so many great tools out there already that I can use for free... It's definitely an aspirational app for me, and now that I know exactly what it does, I can make more informed choices in future. Thank you to Sprout Social for extending my free trial for an extra week.