Being honest has become one of the most critical values for Amazon sellers. Why follow the rules? Because Amazon is increasingly cracking down on sellers who fib, manipulate or otherwise break the rules.
Here are some recent examples:
Amazon has begun wielding the big stick of “Code of
Conduct” violations to immediately block seller accounts. These account
closures are particularly challenging since they often to not fully
inform the seller what rules were allegedly broken.
Suspensions for suspected forged or manipulated
documents are increasingly difficult to overturn – even for honest
sellers who sent in real documents, but may have had some other
problematic account issues in the past.
Amazon has silently partnered with textbook
manufacturers and other brand owners to serve lawsuits against sellers
who – knowingly or unknowingly – sold counterfeit or sketchy products.
Internally, Amazon
has launched multiple investigations against staff members who were
selling data and other favors to sellers. The sellers involved were
summarily shut down.
Amazon is building on its history of going after
sellers and service providers who use shady tactics and violate Terms of
Service to “help” clients. A perfect example is the review-buying
services that helped sellers purchase positive reviews for their
products.
Amazon sellers are reasonably frustrated
with Seller Support and Seller Performance don’t live up to their
promises. But in Amazon’s eyes, that is all irrelevant. Seller still
must provide authentic products at fair prices, stick to terms of
service, and supply Amazon with whatever documents it requests.
Here
are some rules to live by. If you currently cannot follow any of these
rules, take the steps to put new processes in place – now.
Have real, true and unaltered invoices ready at a
moment’s notice. The failure to do this plagues a huge portion of our
clients. Amazon expects that you be able to show the chain of custody
for your products and prove their authenticity. If you can’t, you will
have problems. You need a true document management system to accomplish
this, and all employees involved in answering Performance Notifications
need access.
Don’t give in to temptation to create fake
invoices. Amazon has incredible technology at its fingertips. They will
figure it out eventually. We’ve seen clients suspended even six months
after submitting false documents.
Set up a real quality control system. Your staff
needs to know your products, inspect your products, and weed out the bad
suppliers. Fakes are everywhere. You cannot sell them – even
accidentally.
Don’t pay to play. We get the questions all the
time: Can you help me pay someone to get my account back? Can you pay
someone to get me ungated? Can you help me buy a clean account? Our
answer is always a resounding no. We cannot put our business at risk.
But more importantly, we will not put you at risk of personal or
business liability for corporate espionage activities.
Know the terms of service and stick to them.
Ignorance is not a defense. Amazon expects you to follow its rules about
reviews, refunds, shipping …. All of it.
Gatsby recently announced the launch of “functions”. In this article,
Paul Scanlon explains how to get the current location of the
International Space Station (ISS) as it orbits the Earth in realtime
using Gatsby Functions and then display it
Gatsby recently announced the
launch of Functions which opens up a new dimension of possibilities —
and I for one couldn’t be more excited! With Gatsby now providing
Serverless Functions on Gatsby Cloud (and Netlify also providing support via @netlify/plugin-gatsby),
the framework that was once misunderstood to be “just for blogs” is now
more than ever, (in my opinion) the most exciting technology provider
in the Jamstack space.
With Gatsby Functions, you can create more dynamic applications using
techniques typically associated with client-side applications by adding
an api directory to your project and exporting a function, e.g.
The above sets up a new <Canvas /> element and can be configured using props exposed by React Three Fibre.
Elements that are returned as children of the canvas component will
be displayed as part of the 3D scene. You’ll see above that I’ve
included <OrbitControls /> which adds touch/mouse interactivity allowing users to rotate the scene in 3D space
Ensure ThreeScene is imported and rendered on a page somewhere in your site. In my example repo I’ve added ThreeScene to index.js:
If the syntax above looks a little different to that of the Three.js docs it’s because React Three Fibre uses a declarative approach to using Three.js in React.
A good explanation of how constructor arguments work in React Three Fibre can be seen in the docs here: Constructor arguments
I’ll be using admin 0 countries.
I chose this option because it provides enough geometry detail to see
each country, but not so much that it will add unnecessary strain on
your computer’s GPU.
Now, create a file in src/components called three-geo.js:
There’s quite a lot going on in this file so I’ll walk you through it.
Create an isLoading state instance using React hooks and set it to true. This prevents React from attempting to return data I don’t yet have.
Using a useEffect I request the geojson from the CloudFront CDN.
Upon successful retrieval I set the response in React state using setGeoJson(...) and set isLoading to false
Using an Array.prototype.map I iterate over the “features” contained within the geojson response and return lineSegments with lineBasicMaterial for each geometry
I set the lineSegmentsgeometry to the return value provided by GeoJsonGeomtry which is passed the “features” geometry along with a radius of 100.
(You may have noticed I’ve used the same radius of 100 here as I’ve used in the sphereGeometryargs in three-sphere.js. You don’t have to set the radius to the same value but it makes sense to use the same radii for ThreeSphere and ThreeGeo.
If you’re interested to know more about how GeoJsonGeometry works, here’s the open-source repository for reference: https://github.com/vasturiano/three-geojson-geometry. The repository has an example
directory however, the syntax is slightly different from what you see
here because the examples are written in vanilla JavaScript not React.
This next step is where I use a Gatsby Function to request data from Where is ISS at, which returns the current location of the International Space Station.
// src/api/get-iss-location.jsconst axios =require('axios');exportdefaultasyncfunctionhandler(req, res){try{const{ data }=await axios.get('https://api.wheretheiss.at/v1/satellites/25544');
res.status(200).json({ iss_now: data });}catch(error){
res.status(500).json({ error });}}
This function is responsible for fetching data from api.whereistheiss.at and upon success will return the data and a 200 status code back to the browser.
The Gatsby engineers have done such an amazing job
at simplifying serverless functions that the above is all you really
need to get going, but here’s a little more detail about what’s going
on.
The function is a default export from a file named get-iss-location.js;
With Gatsby Functions the filename becomes the file path used in a client-side get request prefixed with api, e.g. /api/get-iss-location;
If the request to “Where is ISS at” is successful I return an iss_now object containing data from the Where is ISS at API and a status code of 200 back to the client;
If the request errors I send the error back to the client.
In this next step, I use Gatsby Functions to position a sphere that
represents the International Space Station as it orbits the globe. I do
this by repeatedly calling an axios.get request from a poll function and setting the response in React state.
Create a file in src/components called three-iss.js
There’s quite a lot going on in this file so I’ll walk you through it.
Create an issNow state instance using React hooks and set it to null. This prevents React from attempting to return data I don’t yet have;
Using a useEffect I create a JavaScript interval that calls the poll function every 5 seconds;
The poll function is where I request the ISS location from the Gatsby Function endpoint (/api/get-iss-location);
Upon successful retrieval, I set the response in React state using setIssNow(...);
I pass the latitude and longitude onto a custom function called getVertex, along with a radius.
You may have noticed that here I’m using a radius of 120. This does differ from the 100 radius value used in ThreeSphere and ThreeGeo.
The effect of the larger radius is to position the ISS higher up in the
3D scene, rather than at ground level — because that’s logically where
the ISS would be, right? 100 has the effect of the sphere and geometry overlapping to represent Earth, and 120 for the ISS has the effect of the space station “orbiting” the globe I’ve created.
One thing that took a bit of figuring out, at least for me, was how
to use spherical two dimensional coordinates (latitude and longitude) in
three dimensions, e.g. x,y,z. The concept has been explained rather
well in this post by Mike Bostock.
The key to plotting lat / lng in 3D space lies within this formula… which makes absolutely no sense to me!
The poll function will repeatedly call the Gatsby
Function, which in turn requests the current location of the ISS and
re-renders the React component each time a response is successful.
You’ll have to watch carefully but the ISS will change position ever so
slightly every 5 seconds.
The ISS is traveling at roughly 28,000 km/h and polling the Gatsby
Function less often would reveal larger jumps in position. I’ve used 5
seconds here because that’s the most frequent request time as allowed by
the Where is ISS at API
You might have also noticed that there’s no authentication required
to request data from the Where is ISS at API. Meaning that yes,
technically, I could have called the API straight from the browser,
however, I’ve decided to make this API call server side using Gatsby
Functions for two reasons:
It wouldn’t have made a very good blog post about Gatsby Functions if i didn’t use them.
Who knows what the future holds for Where is ISS at, it might at
some point require authentication and adding API keys to server side API
requests is pretty straightforward, moreover this change wouldn’t
require any updates to the client side code.
In this site I’ve visualized the time delay from the poll function by implementing an Svg <circle /> countdown animation and added an extra <circle /> with a stroke-dashoffset to create the dashed lines surrounding it.
Step 5: Apply Your New Geo Rendering Skills In Other Fun Ways! #
I recently used this approach for plotting geographical locations for the competition winners of 500 Bottles: https://500bottles.gatsbyjs.io. A limited edition FREE swag giveaway I worked on with Gatsby’s marketing team.
In the 500 Bottles site I plot the geographical locations of each of
the competition winners using the same method as described in ThreeIss, which allows anyone visiting the site to see where in the world the winners are.
Closing Thoughts
Gatsby Functions really open up a lot of possibilities for Jamstack
developers and never having to worry about spinning up or scaling a
server removes so many problems leaving us free to think about new ways
they can be used.
If you’re interested in learning more about Gatsby Functions, I highly recommend Summer Functions, a five week course run by my good chum Benedicte Raae.
In a recent FREE Friday night Summer Functions webinar we created an emoji slot machine which was super fun:
You might also be interested in the following episode from our pokey internet show Gatsby Deep Dives where Kyle Mathews (creator of Gatsby) talks us through how Gatsby Functions work: