how to add custom callback URL to Coinbase - bitcoin

I'm using Coinbase service to dealing with Bitcoin gateway.
I know i can put callback url in the merchant settings page of my account.
But i need to update it in each order. It can be done using API. but it's so boring.
I need something like this :
Adding data-callback="custom_callback_url" in the Anchor tag.
<a class="coinbase-button"
data-code="code_here"
data-callback="custom_callback_url"
href="https://coinbase.com/checkouts/code_here">Pay With Bitcoin</a>
<script src="https://coinbase.com/assets/button.js" type="text/javascript"></script>

With coinbase's API, you will have to set the callback URL while generating the code!
There is more info on how to generate the code here: https://coinbase.com/api/doc/1.0/buttons/create.html

Related

Shopify request middleware

I want to know, is it possible to add a middleware or request interceptor to Shopify?
Something similar to express, to add some custom behavior or set any values between the request and the response.
I want to read some values from the request object and take some decisions and send that to the response.
Any guide or documentation for this.
Thanks!!
No, not really.
You can customize a Shopify theme using Liquid, their templating language. Liquid has a {{ request }} object which contains the path and domain of the request. You could adjust the body of the response based on that but it isn't like Express middleware.
Some people host their own website and use Shopify's buy buttons or JS buy SDK. If you do that then you can use Express if you want.

Kucoin Exchange Kline Get API Response is wrong

hey guys does somebody know why i dont get the correct response from thhis api call:
https://api.kucoin.com/v1/open/kline?symbol=LTC-BTC&type=1hour&from=1517446866&to=1518311025&limit=1000
it should give me normaly a couple of candelstick data back
i have code already for other exchanges with her api and did not have problems
but this one i dont know if i make somethink wrong or maybe the api from this exchange have a error
the documentation site is this: https://kucoinapidocs.docs.apiary.io/#reference/0/market/get-kline-data(open)
You are using an outdated API.
KuCoin switched to TradingView as its chart software. This is why you have https://www.kucoin.com/#/trade.pro/LTC-BTC as the default view for trading. You can still access the old view via https://www.kucoin.com/#/trade/LTC-BTC.
Looks like the API call you are using was made for the old version.
Use this URL instead:
https://api.kucoin.com/v1/open/chart/history
Working URL:
https://api.kucoin.com/v1/open/chart/history?symbol=LTC-BTC&type=1hour&from=1517446866&to=1518311025&limit=1000
For more information about the new API call: (notice how it says tradingview-version!)
https://kucoinapidocs.docs.apiary.io/#reference/0/market/get-kline-data(open,-tradingview-version)

How to make a custom LinkedIn share button

I need to be able to add sharing functionality to my custom button. I'm not interested with their generator, as I can't change LinkedIn image there. I want to use my own image for the LinkedIn share button.
Official LinkedIn API for sharing:
https://developer.linkedin.com/docs/share-on-linkedin
Read Terms of Use!
Example link using "Customized URL" method: http://www.linkedin.com/shareArticle?mini=true&url=https://stackoverflow.com/questions/10713542/how-to-make-custom-linkedin-share-button/10737122&title=How%20to%20make%20custom%20linkedin%20share%20button&summary=some%20summary%20if%20you%20want&source=stackoverflow.com
You just need to open it in popup using JavaScript or load it to iframe. Simple and works - that's what I was looking for!
EDIT: Video attached to a post:
I checked that you can't really embed any video to LinkedIn post, the only option is to add the link to the page with video itself.
You can achieve it by putting YT link into url param:
https://www.linkedin.com/shareArticle?mini=true&url=https://www.youtube.com/watch?v=SBi92AOSW2E
If you specify summary and title then LinkedIn will stop pulling it from the video, e.g.:
https://www.linkedin.com/shareArticle?mini=true&summary=youtube&title=f1&url=https://www.youtube.com/watch?v=SBi92AOSW2E
It does work exactly the same with Vimeo, and probably will work for any website. Hope it will help.
EDIT 2: Pulling images to the post:
When you open above links you will see that LinkedIn loads some images along with the passed URL (and optionally title and summary).
LinkedIn does it automatically, and you can read about it here: https://developer.linkedin.com/docs/share-on-linkedin#opengraph
It's interesting though as it says:
If Open Graph tags are present, LinkedIn's crawler will not have to
rely on it's own analysis to determine what content will be shared,
which improves the likelihood that the information that is shared is
exactly what you intended.
It tells me that even if Open Graph information is not attached, LinkedIn can pull this data based on its own analysis. And in case of YouTube it seems to be the case, as I couldn't find any Open Graph tags added to YouTube pages.
You can make your own sharing button using the LinkedIn ShareArticle URL, which can have the following parameters:
https://www.linkedin.com/shareArticle?mini=true&url={articleUrl}&title={articleTitle}&summary={articleSummary}&source={articleSource}
You can find the documentation here, just choose "Customized URL" to see the details.
Step 1 - Getting the URL Right
Many of the answers here were valid until recently. For now, the ONLY supported param is url, and the new share link is as follows...
https://www.linkedin.com/sharing/share-offsite/?url={url}
Make sure url is encoded, using something like fixedEncodeURIComponent().
Source: Official Microsoft.com Linkedin Share Plugin Documentation. All LinkedIn.com links for developer documentation appear to be blank pages now -- perhaps related to the acquisition of LinkedIn by Microsoft.
Step 2 - Setting Custom Parameters (Title, Image, Summary, etc.)
Once upon a time, you could use these params: title, summary, source. But if you look closely at all of the documentation, there is actually still a way to still set summary, title, etc.! Put these in the <head> block of the page you want to share...
<meta property='og:title' content='Title of the article"/>
<meta property='og:image' content='//media.example.com/ 1234567.jpg"/>
<meta property='og:description' content='Description that will show in the preview"/>
<meta property='og:url' content='//www.example.com/URL of the article" />
Then LinkedIn will use these! Source: LinkedIn Developer Docs: Making Your Website Shareable on LinkedIn.
Step 3 - Verifying LinkedIn Share Results
Not sure you did everything right? Take the URL of the page you are sharing (i.e., example.com, not linkedin.com/share?url=example.com), and input that URL into the following: LinkedIn Post Inspector. This will tell you everything about how your URL is being shared!
This also pulls/invalidates the current cache of your page, and then refreshes it (in case you have a stuck, cached version of your page in LinkedIn's database). Because it pulls the cache, then refreshes it, sometimes it's best to use the LinkedIn Post Inspector twice, and use the second result as the expected output.
Still not sure? Here's an online demo I built with 20+ social share services. Inspect the source code and find out for yourself how exactly the LinkedIn sharing is working.
Step 4 - Finding More Social Sharing Services and Their Share URLs
I have been maintaining a Github Repo that's been tracking social-share URL formats since 2012, check it out: Github: Social Share URLs.
Why not join in on all the social share url's?
Its best to use customize url approach. And its the easiest. Found this one. It will open a popup window and you dont need any bs authentication issues because of w_share and all.
<a href="https://www.linkedin.com/shareArticle?mini=true&url=http://chillyfacts.com/create-linkedin-share-button-on-website-webpages&title=Create LinkedIn Share button on Website Webpages&summary=chillyfacts.com&source=Chillyfacts" onclick="window.open(this.href, 'mywin', 'left=20,top=20,width=500,height=500,toolbar=1,resizable=0'); return false;">
<img src="http://chillyfacts.com/wp-content/uploads/2017/06/LinkedIN.gif" alt="" width="54" height="20" />
</a>
Just change the url with your own url. Here is the link http://chillyfacts.com/create-linkedin-share-button-on-website-webpages/
The API is updated now and the previous API will be deprecated on 1st March, 2019.
To create a custom Share button for LinkedIn, you need to make POST calls now. You can read the updated documentation here for doing so.
LinkedIn revised their site recently, so there are a ton of old links just redirecting to the developer support homepage. Here is an updated link to the relevant page on LinkedIn's support site (as of Feb 16, 2015): https://developer.linkedin.com/docs/share-on-linkedin
LinkedIn has updated their api and the sharing url's no longer works. Now you can only use the url query parameter. Any other parameter is going to be removed from the url by LinkedIn.
Now you're forced to use oAuth and interact with the linkedin API to share content on behalf of a user.
This works for me:
https://www.linkedin.com/shareArticle?mini=true&url=articleUrl&title=YourarticleTitle&summary=YourarticleSummary&source=YourarticleSource
You can use this link by replacing it with your content. It works 100%.
You can customize the standard Linkedin button like this, after the page load:
$(".IN-widget span:first-of-type").css({
'border': '2px solid #DCDCDC',
'-webkit-border-radius': '3px',
'-moz-border-radius': '3px',
'border-radius': '3px'
});

Parlaying an Event URL into an Event ID for use with the API

I'm building an app which will aggregate events its users add to it. I'd love to be able to let people paste in an Eventbrite URL and then figure out what the event's ID is so I can pull data about it from the API.
I'm having problems figuring out a sensible and reliable way to do that.
Sometimes the event has the EID in the URL, as in www.eventbrite.com/event/3213651117
Sometimes they don't, as in yurisnightla-ehometext.eventbrite.com/
There's a <link rel="canonical"> tag which, in the case of the Yuri’s night example above points back to the custom domain rather than a plain eventbrite page, so www.eventbrite.com/event/3219837621 points to yurisnightla-ehometext.eventbrite.com/.
There's a <link rel="alternate" type="text/calendar"> tag which has the Event ID embedded in its URL, but it 404s, so I'm a little unsure about trusting it (it'd be good to verify it first by GETting it).
At the moment searching the <link type="text/calendar"> seems like the best bet, but I'm worried about its longer-term viability, given the 404s. Is there something else I'm missing? Is there an official way to do this?
Eventbrite doesn't really have tools available for resolving an event_id from the custom subdomain event page URLs (which are optionally available).
You might be able to find these events using the event_search API method.
All published Eventbrite event pages will always be accessible via the following URL scheme (regardless of whether they have a custom subdomain url configured):
http://www.eventbrite.com/event/YOUR_EVENT_ID
If you can find the event_id, then any links that are crafted using the above URL structure should always be valid.

SEO of Pagination using rel="next" rel="prev" HTTP Headers

I am trying to perform some SEO on a pagination control I have on a website.
Following the Google guidelines, I would like to add link rel=next/prev i.e. <link href="/search/results?page=2" rel="next" /> to the <head> of my search results page.
Unfortunatley, due to a design decision / limitation of MVC3 with rendering sections and defining their content within Partials, I'm unable to do this.
So my question is - can I replicate the aforementioned functionality by adding a "Link" HTTP header, i.e. Link: <http://www.example.com/search/results?page=2>; rel="next" to the response and therefore not have to add the <link> tags in the <head>?
This was answered by Maile Ohye.
#estrik: We support rel=”next” and rel=”prev” in the HTTP header. For example, for page=2 of an article, you could respond with the HTTP header:
Link: http://www.example.com/article?story=abc&page=1; rel="prev"
Link: http://www.example.com/article?story=abc&page=3; rel="next"
Referring to this post from a Google employee rel=prev/next in the HTTP header is supported by Google
At the moment, I'm pretty sure they aren't supporting that, as they aren't support having the rel attribute on the anchor either.