LinkedIn sharing SHARE_URL#HASH URL Param - linkedin

I am faced with a LinkedIn sharing issue.
This issue probably reproducible from March 1st 2019.
I share some url e.g. https://www.linkedin.com/sharing/share-offsite/?url=SHARE_URL#HASH
Worked before: link in post(href) - SHARE_URL#HASH
Works now: link in post(href) - value of og:url meta tag from SHARE_URL#HASH page
So we lose request parameters in SHARE_URL and #HASH
How we can pass link for LinkedIn post into request?

You need to do URL-encoding with parameters you are feeding to another URL. So, this is what you should want...
https://www.linkedin.com/sharing/share-offsite/?url=SHARE_URL%23HASH
Remember, URL's use things like ? and # to indicate a special argument occurring after this character. So, for instance, example.com/share.php?title=thisistitleright?&..., how would the browser know that the first ? indicates the GET param and the second ? is a part of the title argument? Easy: URL encoding.
In case you want to know more: Official LinkedIn Share Documentation

Related

Linkedin eventSubscription API is giving a 403 error

I am using
PUT https://api.linkedin.com/v2/eventSubscriptions/(developerApplication:urn:li:developerApplication:{developer application ID},user:urn:li:user:{member ID},entity:urn:li:organization:{organization ID},eventType:ORGANIZATION_SOCIAL_ACTION_NOTIFICATIONS)
Linkedin API with all the parameters intact. Each URN is encoded as urn:li:organization:12345 is encoded to urn%3Ali%3Aorganization%3A12345 but still getting a 403 Response.
I think you forget to add this in headers :
X-Restli-Protocol-Version:2.0.0
The application id is actually a numeric field in the url when you visit your application settings, put that value instead of the client id.
So it turns out that there's a lot of missing/incorrect information in the documentation. Since I'm working in go, here's how I finally got the url formatted correctly:
fmt.Sprintf(
"https://api.linkedin.com/v2/eventSubscriptions/(developerApplication:%s,user:%s,entity:%s,eventType:ORGANIZATION_SOCIAL_ACTION_NOTIFICATIONS)",
url.QueryEscape(fmt.Sprintf("urn:li:developerApplication:%s", appId)),
url.QueryEscape(fmt.Sprintf("urn:li:person:%s", userId)),
url.QueryEscape(fmt.Sprintf("urn:li:organization:%s", organizationID)),
)
The breakdown:
The URNs, and only the URNs, need to be urlencoded.
Not the surrounding parentheses
Not the commas
Not the colons preceding the URNs (developerApplication:, user:, and entity:)
Your PUT request needs to include the X-Restli-Protocol-Version header and Authorization header
If, for some reason, you use the /rest/eventSubscriptions/ url instead of /v2/eventSubscriptions/, you also need to include the LinkedIn-Version header
The appId is not your app's client id, but instead the numeric id you see in the app settings url in the linkedin developer portal (i.e. https://www.linkedin.com/developers/apps/<appId>/auth)
The URN structure in the docs is wrong: you need to use urn:li:person:<userId>, not urn:li:user:<userId>

Getting RefererNotAllowedMapError from GAPI whereas the restriction pattern defined seems to match the referring URL

A.S/ probably for another SE.com site: why "referer" is spelt with only r at Google's?
Anyway, here we go again with another occurrence of RefererNotAllowedMapError.
I couldn't find my answer in the existing Q&As.
Hypothesis:
I have a local website that includes a GMap.
It displays and works
fine provided I remove all restrictions on that key, from the Google
API console.
But the browser will receive a Google Maps JavaScript
API error: RefererNotAllowedMapError whenever I add a referrer
restriction, which seems to match the refering URL.
The referrer, where the map is being called form, is:
https://app.developr.online.local/projects?p=name-asc-0-20-1&a=createProject
Below is my GAPI KEY security configuration:
Below is the corresponding console output:
To be noted:
If I add a trailing asterisk when declaring the referer, validating that entry will clear it anyway. To me it means: "that's ok, we're covering trailing /* already.".
My question: what pattern should I enter as a referrer (2 r's) to have it recognised by GAPI security layer?
I've tried a few things, I didn't get a cigar.
Thank you.

Create custom URL for WordPress RSS2 Feed

I wrote an RSS2 feed on WordPress a while back, but for some reason, some of the URLs aren't working anymore. The current version of WP is 4.7.2.
For example, https://justhoodsbyawdis.com/product/jh001/feed/ works, but https://justhoodsbyawdis.com/brands/feed/ does not.
Note that https://justhoodsbyawdis.com/product/jh001/ is a valid page on the site, but that https://justhoodsbyawdis.com/brands/ is not, because it is only valid for feeds. The latter results in an "ERROR: This is not a valid feed." message.
Is there a way to make an URL for a RSS2 feed, even without an associated WP page (i.e. without the "/feed/" at the end).
Thanks!
Rob
EDIT 1:
I added a post called "brands", which fixed the problem. The only thing is that the dummy post is viewable by anyone. Any ideas how to block it, but not the feed?
Another problem is that query strings break the feed, for instance:
https://justhoodsbyawdis.com/products/feed/?name=hoodies
doesn't work, although it does without the "?name=hoodies".
How would I make that work?
EDIT 2:
It would appear that the name query string parameter is now causing problems - see:
https://codex.wordpress.org/Function_Reference/register_taxonomy#Reserved_Terms
Is there a way to make it backwards compatible? Otherwise, the existing app that calls the feed will also have to be changed...
I wound up creating dummy pages to fix the invalid feed error.
I had to change the "name" query string parameter to "prod_name" so as to not conflict with reserved terms.
Rob

How to find out date in which URL was shortened

may I know how do you find out when a particular URL was shortened using Bitly?
Just add "+" to the end of the URL in your browser
The info endpoint for the API includes that information as ...data.info[0].created_at.

Is it possible to use a search string url with Google Calendar

Would any body know if it is possible to search calendar events with a url string?
For example with gMail you could use:
https://mail.google.com/mail/?shva=1#search/Search+Term
to search for the words 'search' and 'term'
Any help or advice greatly appreciated.
Cheers
Noel
This is how you can search Google Calendar using a query parameter in the url:
https://www.google.com/calendar/render?q=TERM
where TERM is the string you're searching for.
So, you can search using a GET request.
Using Chrome's dev tools, it appears as though Google Calendar searches are performed using a POST request, so you won't be able to pass search terms into urls to fetch a response (which would be a GET request).
Update: Looks like a GET request will still return results, but the response is some form of JSON.
Here is the url (I x'd out my specific info), looks like its not meant for what you want to use it for:
https://www.google.com/calendar/search?ctz=America/New_York&hl=en&as_tp=basic&as_myuids=xxx&as_otheruids=xxx&as_q=kai%20mallea&as_cal=xxx;xxx&secid=xxx
A generalization of the current answer is:
https://calendar.google.com/calendar/b/0/render?q=TERM
where 0 is the index of the desired Google account (if you have multiple accounts).

Resources