Jump to content

Recommended Posts

I'm trying to make a script that opens the amazon url I'm currently on (in safari or chrome) and open it in Fakespot. 

 

I got as far as 

 

on alfred_script(q)
tell application "Safari" to return URL of front document
end alfred_script

 

And then added a {query} but here's where I get stuck because Fakespot turns the URL into a different one and I don't know how. 

 

When I go to Fakespot and paste in 

 

https://www.amazon.co.uk/Braun-Replacement-Foil-Cutter-Cassette/dp/B001EVNMTK/ref=sr_1_2_a_it?ie=UTF8&qid=1552643933&sr=8-2&keywords=braun++7-760cc+razor+foils

 

The address it sends me to is 

 

https://www.fakespot.com/product/braun-replacement-foil-cutter-cassette-32s-series-3-silver

 

And that detail isn't in the amazon URL so I don't know how to find it. 

 

Any ideas on how I might achieve this short of doing a copy and paste into the fakespot field? 

Thanks. 

 

 

Share this post


Link to post
Posted (edited)

What you’re looking for is https://www.fakespot.com/analyze?url=, and then your URL. So in your example, it would be https://www.fakespot.com/analyze?url=https://www.amazon.co.uk/Braun-Replacement-Foil-Cutter-Cassette/dp/B001EVNMTK/ref=sr_1_2_a_it?ie=UTF8&qid=1552643933&sr=8-2&keywords=braun++7-760cc+razor+foils.

 

Here is a Workflow for it. It works with Google Chrome, Google Chrome Canary, Chromium, Opera, Vivaldi, Brave, Safari, Safari Technology Preview, and Webkit.

Edited by vitor

Share this post


Link to post
21 minutes ago, bongobong said:

Wow. Did you just make that workflow?

 

Yes, took me only a few minutes. The only complex part is the browser support, for which I leaned on work I did previously, which cumulatively has taken me many hours. But since it was already done, and was built to be easy to reuse, making it work for your needs took no effort at all.

 

26 minutes ago, bongobong said:

I wish I knew AppleScript and python.

 

No Python here, just AppleScript (JavaScript for Automation, to be precise). I mostly use Ruby and Bash, not Python (that’s more @deanishe’s domain). If you’re interested in scripting, I’d suggest you start with Bash, because you can start doing useful (and dangerous) things fast and learn progressively. This is one of the few things Dean and I disagree on (and why I pinged him), in that he’d suggest learning Python or Ruby to start with. We had a short friendly public discussion on it which you can read and make up your mind.

 

But he’ll back me up when I say “forget about AppleScript”. It’s an awful language with bad documentation, and we only use it when it’s absolutely necessary.

Share this post


Link to post

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...