Giter VIP home page Giter VIP logo

opengraph's People

Contributors

akadateppei avatar cozzin avatar fumiki avatar hstdt avatar jsryudev avatar khanlou avatar moophis avatar mt-hodaka avatar p-x9 avatar puyanlin avatar rismay avatar robbiet480 avatar rudrankriyam avatar satoshi-takano avatar wendellli99 avatar zunda-pixel avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

opengraph's Issues

The operation couldn’t be completed. No space left on device

When opening the app, OpenGraph successfully fetches mutliple urls through the fetch function in app.

After a pull to refresh this information is being updated through the same fetch function.

Since two weeks there is the problem that, if you pull to refresh, gives the OpenGraph error „The operation couldn‘t be completed. No space left on device.“
(The error seems to come up 90% of the times you try to pull to refresh the current view)

After gaining some feedback of beta users it seems that the problem mostly occurs on iPhone 11 devices.

iPhone 12 and other devices seem to not show the error.

In every case there was more than enough free space on the device itself (in my case, iPhone 11 Pro Max, there were 50Gb of 256Gb still free). Also the memory monitor in Xcode showed that more than enough Ram for the app was available and not used.

After relaunching the app, fetching is again possible without a problem - until pull to refresh is engaged.

Is this problem already monitored?

Swift 4 Updates

It appears that there are a few very minor updates required for Swift 4 support. There is one method in the OpenGraphParser.swift file that was renamed from rangeAt() to range(at:). That's the only change necessary. I don't know if you want a PR for this or when you would want to implement it.

URL from web browser site not parsing sometimes

Hi Satoshi! Thanks for this amazing library!

I'm having error while fetching metadata from specific website.
I'm trying to debug why following websites' metadata are not being fetched, but couldn't reason why.

Also, I'm using "1.3.0" version.. Somehow I counldn't "pod install" version "1.3.1".

Headers I'm passing
["User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.83 Safari/537.36 facebookexternalhit/1.1"]

Error Website:
https://news.naver.com/main/ranking/read.naver?mode=LSD&mid=shm&sid1=001&oid=011&aid=0003987466&rankingType=RANKING

Metatag content prematurely cut off

Was having trouble running tests locally (haven't worked with Carthage before and OHHTTPStubs wasn't compiling with Swift 4 despite trying to use carthage build --no-use-binaries) so I figured I'd just open this issue here.

I noticed recently that meta tags with apostrophes in the content get cut off prematurely. Specifically, the og:title in this link gets cut off at Lowe: I which is demonstrably shorter than what og:title actually is.

I looked at the regex for it, and realize it's not accounting for apostrophes (or escaped double quotes, presumably) inside of a title, leading to a premature exit.

Old pattern: pattern: "\\scontent=(?:\"|\')(.*?)(?:\"|\')"

Proposed new pattern: pattern: "\\scontent=(?:\"|\')(.*?)\"|\'\(?:\"|\')"

Thoughts?

Wrong api result

First of all, I'm not a Navtive English speaker. So please excuse me.

When I try to use OpenGraph.fetch method with "https://www.github.com", I got result as below

OpenGraph.OpenGraphMetadata.image: "image/png", 
OpenGraph.OpenGraphMetadata.url: "IE=edge", 
OpenGraph.OpenGraphMetadata.site_name: "GitHub", 
OpenGraph.OpenGraphMetadata.title: "Build software better, together"])

I expect the result to be like this

.image = "https://assets-cdn.github.com/images/modules/open_graph/github-logo.png"
.url = "https://github.com"

I doubt the regular expression "<meta\\s.*?property=\"og:(\\w+?)\".*?/?>"
However, I'm not good at regular expression,, So I couldn't fix it by myself.

If the title has an apostrophe it instead shows "&#x27"

When I am using your pod to fetch the OG tags from a news article that has an apostrophe it shows an error with your method.

Version: 1.4.1
Used cocapods to install
Xcode version: 13.2.1
Device: iPhone 12 iOS 15.1

----- Example 1 -----
Should receive:
Jim Simons' RenTech fund nearly doubled its AMC stake

What I receive when using your pod:
Jim Simons' RenTech fund nearly doubled its AMC stake

https://markets.businessinsider.com/news/stocks/jim-simons-renaissance-technologies-rentech-amc-entertainment-gamestop-tesla-stock-2022-2?amp

----- Example 2 -----
Should receive:
Today's Stock Market News & Events: 12/8/2021

What I receive when using your pod:
Today's Stock Market News & Events: 12/8/2021

https://www.schaeffersresearch.com/content/news/2021/12/08/todays-stock-market-news-events-12-8-2021

----- Example 3 -----
Should receive:
Interest rate hike needed 'shortly' after March

What I receive when using your pod:
Interest rate hike needed 'shortly' after March

https://www.marketwatch.com/story/interest-rate-hike-needed-shortly-after-march-end-to-asset-purchases-feds-waller-says-11639764021

OpenGraph data for Twitter no longer being fetched

Spent some time looking into this and it SEEMS to be the case that meta tags with data-rh=true on them are no longer being fetched.

Expected: OpenGraph data for Twitter is fetched and appropriately turned into an OpenGraph object
What Actually Happens: Only the og:site_name tag is fetched, as that is the only one without data-rh=true

Linux Support

We added Linux support in #60, however, some of the changes in the PR right before mine (namely in commit cea13a7) broke Linux support. We can fix it, but it seems like we should also maybe add a github action that compiles the library in a linux environment to ensure that future changes don't break linux support?

Great repo

Hi Satoshi,

Really great repository. Please let me know if you need help with anything in this repo, I'd love to contribute.

Cheers

Open to PR for Linux support?

I want to use this library on Linux, but it needs a few changes. First, it needs to conditionally import FoundationNetworking, and second, the stringEncoding seems to not work on Linux.

If you're open to it, I can open a PR to address these issues and make the library work on Linux?

Library fails to parse google.com

Hi @satoshi-takano, thank you so much for this library — I've been experimenting with it tonight and have found it very useful already! I'm testing out quite a few sites and noticed that OpenGraph fails to parse some bare domains like google.com and youtube.com.


I ran both of those through opengraph.xyz and they seem to work fine there.
https://www.opengraph.xyz/url/https%3A%2F%2Fgoogle.com
https://www.opengraph.xyz/url/https%3A%2F%2Fyoutube.com

The library though returns no metadata.

let metadata = try await OpenGraph.fetch(url: url)
print(metadata)

// Prints OpenGraph(source: [:])

I was wondering if there was something I need to configure to get these domains to parse, or possibly even special-case considerations that would help them work right.

Thank you again, I'm very excited to continue integrating your library. 😄

Medium links do not follow redirect

When trying to parse OG meta data from Medium articles shared from within their iOS app, OpenGraph returns an empty result.

URLs shared form their app look like this: https://link.medium.com/oT1YJfn1G9

Retrieving this URL with curl resolves to the final URL (https://onezero.medium.com/i-bought-a-new-router-it-told-me-i-was-hacked-fb141930dd22?source=userActivityShare-ea0b1eb1f5d2-1599825776&_branch_match_id=link-832936551787943816)

curl -v https://link.medium.com/oT1YJfn1G9
*   Trying 52.8.138.103...
* TCP_NODELAY set
* Connected to link.medium.com (52.8.138.103) port 443 (#0)
* ALPN, offering h2
* ALPN, offering http/1.1
* successfully set certificate verify locations:
*   CAfile: /etc/ssl/cert.pem
  CApath: none
* TLSv1.2 (OUT), TLS handshake, Client hello (1):
* TLSv1.2 (IN), TLS handshake, Server hello (2):
* TLSv1.2 (IN), TLS handshake, Certificate (11):
* TLSv1.2 (IN), TLS handshake, Server key exchange (12):
* TLSv1.2 (IN), TLS handshake, Server finished (14):
* TLSv1.2 (OUT), TLS handshake, Client key exchange (16):
* TLSv1.2 (OUT), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (OUT), TLS handshake, Finished (20):
* TLSv1.2 (IN), TLS change cipher, Change cipher spec (1):
* TLSv1.2 (IN), TLS handshake, Finished (20):
* SSL connection using TLSv1.2 / ECDHE-RSA-AES128-GCM-SHA256
* ALPN, server accepted to use http/1.1
* Server certificate:
*  subject: CN=link.medium.com
*  start date: Aug 22 09:07:22 2020 GMT
*  expire date: Nov 20 09:07:22 2020 GMT
*  subjectAltName: host "link.medium.com" matched cert's "link.medium.com"
*  issuer: C=US; O=Let's Encrypt; CN=Let's Encrypt Authority X3
*  SSL certificate verify ok.
> GET /oT1YJfn1G9 HTTP/1.1
> Host: link.medium.com
> User-Agent: curl/7.64.1
> Accept: */*
>
< HTTP/1.1 307 Temporary Redirect
< Server: openresty/1.13.6.2
< Date: Fri, 11 Sep 2020 12:03:58 GMT
< Content-Length: 0
< Connection: keep-alive
< X-Powered-By: Express
< Set-Cookie: _s=vulHH3zzhLh5cNMbTeZBmlRnPTWSi6J1oZt4uT835w2OYeFv9ocdeRfs7kngIVl7; Max-Age=31536000; Path=/; Expires=Sat, 11 Sep 2021 12:03:58 GMT
< Last-Modified: Fri, 11 Sep 2020 12:03:58 GMT
< Location: https://onezero.medium.com/i-bought-a-new-router-it-told-me-i-was-hacked-fb141930dd22?source=userActivityShare-ea0b1eb1f5d2-1599825776&_branch_match_id=link-832936551787943816
<
* Connection #0 to host link.medium.com left intact
* Closing connection 0

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.