OSKY Web Developer Test - PHP Junior


The Task

  1. Create a PHP script to fulfil the requirement below.
  2. Upload your script to a public github repository.

The Requirement

  1. Download the JSON file from URL below and find a way to parse the content using only PHP built in function (no external libraries or tool).
    1. test.osky.dev/101/data.json
  2. The JSON file contains 6 news item with several attributes including
    1. Title
    2. Link
    3. Description/Content
    4. Published date
  3. Create a listing of the news wrapped inside a div and sort it according to the news title alphabetically.
  4. Use H2 tag for the news title.
  5. Use P tag for the date and make it an italic.
  6. Reformat the date as
    • Day, Date, English ordinal suffix, "of", Long Month Name, Year, Hour with no leading zero, Minute, and Ante/Post Meridiem
    • Example : Tuesday, 22nd of June 2021 10:07 pm
  7. Use P tag for the content.
  8. The link property can either be a string or an arrays. If it's in an array, filter the array values and if URL link is present in the news, a "Read More" text should appear and will open the full news story in a new window. IMPORTANT: Do not show the Read More link if only a URN or URC is present.
  9. OPTIONAL: Add a fade in effect on every news item so that each item will fade in one item at a time. You can use vanilla Javascript or jQuery for this.

Submission

  1. Upload your files to a PRIVATE Github repository and invite erfan.sakib@osky.com.au to view the repository.
  2. If you're having trouble with Git, just zip the files and send it through email at erfan.sakib@osky.com.au.

Good luck with the test!