-
Notifications
You must be signed in to change notification settings - Fork 191
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
feat(tipping): github profile support #767
Conversation
@bumi Support for GitHub profiles is here! 💯 Do you think we should support donation on user repositories for the price of an extra request? Since currently we try to avoid that I initially skipped that, but I am happy to add it. Regarding docs update: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
as the URL matches for both repos and profiles. Maybe we can directly also read the data from the readme?
so this one would work for both, user profiles and repos.
I would also delete the existing one: https://github.com/getAlby/lightning-browser-extension/blob/master/src/extension/content-script/batteries/GitHubRepo.ts - it used the lndonate idea of a file. but requires an additional HTTP request and imo it is good to put the info in the readme. for a second I also thought we could additionally load the info from the |
I didn't know about that. That is awesome! 💯 For supporting the FUNDING.yml I'd probably create another issue as I think we need to put some more thought into that. (how to identify lightning addresses, lnurlp, etc)
That should be possible, too. So we would have the following options for now:
|
890a107
to
47599f0
Compare
+1 - and it already works when the user clicks on the sponsor link. Alby will open with such lightning query params. |
import getOriginData from "../originData"; | ||
import setLightningData from "../setLightningData"; | ||
|
||
const urlMatcher = /^https:\/\/github.com\/([^/]+)(\/([^/]+))?$/; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
(I only found that that this regex does not match on github.com/username/ (with a trailing slash) - but this happens only when manually entered. )
|
||
const address = parseElement("[data-bio-text]") || parseElement("article"); | ||
|
||
if (address) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kinda prefer the guards like in line 31 - if there is no else branch
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@reneaaron I was too fast with merging... :/
do you have time to update the CSS selectors and make those more specific?
@bumi Sure, i'll have a look at it! |
Link this PR to an issue
Fixes #766
Type of change (Remove other not matching type)
Describe the changes you have made in this PR -
Currently we only support Github profiles. We could widen support to repositories (so you have the option to donate on i.e. reneaaron/webln-demo at the cost of an extra request, too.
How Has This Been Tested?
Checklist: