Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

perma.cc support #36

Open
Denubis opened this issue Jan 31, 2019 · 2 comments
Open

perma.cc support #36

Denubis opened this issue Jan 31, 2019 · 2 comments

Comments

@Denubis
Copy link

Denubis commented Jan 31, 2019

Hi Folks...

I'm wondering if you could add perma.cc to embiggen. While perma.cc isn't strictly a link shortener, for purposes of altmetrics, it's usually desirable to look at the parent page.

def parsePermaCC(incomingurl)
	if incomingurl.include? "perma.cc"
		archive = incomingurl.split("perma.cc/")[1]

		# https://perma.cc/docs/developer#get-one-archive
		url = "https://api.perma.cc/v1/public/archives/#{archive}"
		uri = URI(url)
		response = JSON.parse(Net::HTTP.get(uri))
		return URI(response['url'])
	else
		return incomingurl
	end
end

this is some ruby I hacked up (I usually code in python, so... this is probably all sorts of badwrong) which takes a uri and finds the perma.cc parent url or just passes the url through if not perma.cc'd. I'm thinking an invocation for this can go into follow()

Let me know if this is something you folks would like to include here, or if I should go raise a ticket in altmetric for this.

Cheers,
-Brian

@jbilbo
Copy link
Member

jbilbo commented Jan 31, 2019

Hey Brian, I'd like to add support for it into Altmetric indeed, I have my reckons about putting it here on Embiggen though. Will discuss further with the team and let you know. Thanks for sending!

@Denubis
Copy link
Author

Denubis commented Jan 31, 2019

No worries. It isn't an amazing fit for enbiggen since it isn't... quite a link shortener. Let me know how I can help though. Hopefully my proof of concept above is useful. Oh, and I opened a ticket with support on your end: 90862

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants