Comments (6)
also I used facebook open graph debugger and except for small image warning it parsed ok
https://developers.facebook.com/tools/debug/sharing/?q=theyeshiva.net
from urlembeddedview.
this link.... I cant to read meta-data https://m.youtube.com/watch?v=kSUJ28rgNyo
from urlembeddedview.
@felixdkatt Sites you provided doesn't support OpenGraph protocol as it is.
Facebook debug tool is not about OpenGraph protocol only.
Facebook and iMessages do additional work on some common scenarios for sites that doesn't support OpenGraph.
To check site against OpenGrpah protocol check this one:
https://opengraphcheck.com/result.php?url=https%3A%2F%2Fwashingtonpost.com#.XIdnVRMzZTY
https://opengraphcheck.com/result.php?url=https%3A%2F%2Ftheyeshiva.net#.XIdnZRMzZTY
from urlembeddedview.
OK, i think i have fix for that.
There are websites that are using "name" instead of "property" key in <meta ... block>
Also, sometimes websites are using capital P i < meta Property > and here regular expression is caseSensitive.
So here are my adjustments @marty-suzuki @felixdkatt
In OpenGraph.HTML.swift
change implementation of property regex like so:
static let regex: NSRegularExpression? = { let patterns = [ // "" & "" "(?:content\\s*=\\s*\"([^>]*)\"\\s*property\\s*=\\s*\"([^>]*)\")", "(?:property\\s*=\\s*\"([^>]*)\"\\s*content\\s*=\\s*\"([^>]*)\")", // name instead of property "(?:content\\s*=\\s*\"([^>]*)\"\\s*name\\s*=\\s*\"([^>]*)\")", "(?:name\\s*=\\s*\"([^>]*)\"\\s*content\\s*=\\s*\"([^>]*)\")", // '' & '' "(?:content\\s*=\\s*'([^>]*)'\\s*property\\s*=\\s*'([^>]*)')", "(?:property\\s*=\\s*'([^>]*)'\\s*content\\s*=\\s*'([^>]*)')", // "" & '' "(?:content\\s*=\\s*\"([^>]*)\"\\s*property\\s*=\\s*'([^>]*)')", "(?:property\\s*=\\s*\"([^>]*)\"\\s*content\\s*=\\s*'([^>]*)')", // '' & "" "(?:content\\s*=\\s*'([^>]*)'\\s*property\\s*=\\s*\"([^>]*)\")", "(?:property\\s*=\\s*'([^>]*)'\\s*content\\s*=\\s*\"([^>]*)\")" ] let pattern = "meta\\s*\(patterns.joined(separator: "|"))\\s*>?" return try? NSRegularExpression(pattern: pattern, options: [.caseInsensitive]) }()
from urlembeddedview.
here is pull request to fix that #84 @marty-suzuki
from urlembeddedview.
thank you @H3ndrx I will check it out
from urlembeddedview.
Related Issues (20)
- Value of type 'Any' has no member '1' HOT 1
- OpenGraphData fields are not visible in ObjC HOT 12
- OG data is not fully parsed HOT 6
- Page description is not available HOT 3
- Unreadable characters in link title.
- Error with addPersistentStoreWithType
- Support Swift 4.2 HOT 1
- Not able to show thumbnails of youtube links. HOT 1
- Google maps thumbnail missing
- redirect
- Crash on fetch HOT 7
- Swift 5 support HOT 4
- README.md typo in Swift
- Crashes on load frequently
- Does not load imageURL or title for basic websites HOT 2
- Pod install fails on macOS 10.15 HOT 1
- pod fixes HOT 1
- Can you provide steps to install pod for objective c project?
- Add - SPM Support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from urlembeddedview.