After adding the Twitter share button from here:
http://twitter.com/about/resources/tweetbutton
My https site displays a small rectangular box appears on my pages with this error:
This frame was blocked because it
contains some insecure content.
When I change the two http calls to https:
<a href="https://twitter.com/share"...
...src="https://platform.twitter.com/widgets.js">
I get a text "Tweet" link, which does work, but it doesn't have the images/layout from the Twitter site. The javascript call outputs this error in the code:
Failed to load source for: https://platform.twitter.com/widgets.js
Is there anything I can do to get this Twitter button working?
Twitter currently doesn't offer the Tweet button via HTTPS so your only option at this stage is to roll your own.
At this time tweetmeme does not seem to be secure either.
The only way to do this is securely to use a query string, e.g.
<A HREF=https://twitter.com/share?url=MYURL&via=VIA&text=TWEET>Tweet</A>
But there is no way to get the tweet count yet, and you have to dispose of the tweet window yourself.
Related
I'm trying to fetch og (OpenGraph) tags from a URL and display in the app. I get the tags properly for most of the websites, but for some, I don't.
ex. This URL
When I render it on the browser and inspect, it shows me the meta tags, but when I try to fetch the html via cURL, it returns a html content without any meta. But, when I share the URL in Slack or FB, it renders the preview with the OG tags.
How do I do it on iOS?
Any help is appreciated.
The problem with the URL you shared is that the site requires Javascript to be enabled.
If you don't have Javascript enabled, you just get back a basic page saying that you need to have Javascript enabled to browse the site (hence, no Open Graph tags).
Your browser, Slack and Facebook execute Javascript but cURL does not. Neither will a URLSession in iOS.
In iOS, the only way you're going to be able to get access to the HTML for such a website is to use a WKWebView to render the page.
Then, when it's loaded, execute some Javascript using evaluateJavascript(_:completionHandler:) to get the OG tags.
That's the only workable solution for these cases using iOS libraries.
The iOS client for Facebook, LinkedIn etc do not do this on their iOS client. Their iOS client calls their backend, passing the URL for processing, and receives back the preview. Javascript is executed as part of this backend process.
There are public APIs around that will help you to do the same thing, such as:
https://opengraph.io
I have been created webpage using php.
In my social links, I have been added subscribe links,
So i need to create youtube account, I m new about this section.
<a href="http://youtube.com/">
<i class="fa fa-youtube"></i>
<span>Subscribe</span>
</a>
I need something like this, https://www.youtube.com/user/thegatesnotes .. This is mentioned as example.
May i know, is it possible to create by myself?
Can anyone guide me? Thanks in advance.
Youtube's new policy
Eligibility requirements
To get a custom URL for your channel, your account needs to be in good standing and meet a few other requirements:
500 100 or more subscribers
Channels is at least 30 days old
Channel has uploaded a photo for the channel icon
Channel has uploaded channel art
You can also qualify for a custom URL by linking and verifying your official webpage with your channel or +Page.
Get a Custom URL for your channel
Once you’ve qualified for a custom URL, you’ll receive an email notification and a notification on your Creator Studio dashboard. To get your custom URL:
Sign in to YouTube and navigate to the Creator Studio.
Look for your “Get a new custom URL” notification and click in the included link
You’ll be redirected to claim a custom URL.
You’ll see the custom URL(s) you’ve been approved for. These cannot be changed. You may also need to add a few letters or numbers to make the URL unique to you.
Click the box next to “I agree to the Terms of Service” then click Change URL in the bottom left corner.
This URL will be linked to both your YouTube channel and your Google+ identity. Once your URL has been approved, you cannot request to change it. When you're certain, click Confirm choice.
Change capitalization or accents of your custom URL
If you want to change the capitalization or accents/diacritics of your custom URL, follow these steps:
Sign in to Google+. Place your cursor in the top left corner for the Google + main menu and then select the page or profile associated with your channel
Click the About tab, and under Links > Google+ URL, click Edit.
A box will appear allowing you to make edits to the formatting.
Remember, you can only change the capitalization and diacritics of the URL, not the URL itself.
YouTube Help at https://support.google.com/youtube/answer/6180214 describes in detail the following three types of YouTube URL:
1.
ID-based URL
Example: youtube.com/channel/UCUZHFZ9jIKrLroW8LcyJEQQ
This is the standard URL that all YouTube channels use.
2.
Custom URL
Example: youtube.com/c/YouTubeCreators
A custom URL is a shorter, easy-to-remember URL...
3.
Legacy username URL
Example: youtube.com/user/partnersupport
Depending on when your channel was created, it may have a username. Usernames are no longer required for channels today...
So (as I can understand) it is not possible to create youtube.com/user/... now.
I am an ios app developer. We have implemented a custom URL scheme 'my_app://section_name' or so where if the link is opened in the user's mobile browser, it will redirect the user to a specific section in the app.
We would like to be able to tweet these URLs and have users on their mobile device click on them to open up the app, however it just can click once
(when you click close , maybe you click wrong then you want to click it second but it does not work )
I hope this isn't too silly of a question. Thanks
Make sure to check the tweet body after it have been posted.
This may be due of an URL shortener, especially if the tweet is posted from the iOS 5 Twitter framework.
I'm having a similar issue with url schemes. We can include them in emails and text messages, and they highlight and work properly.
Unfortunately, when we do the same with a tweet, the iOS Twitter client fails to recognise the special URL scheme and so the user cannot tap on it to open our app.
Pretty big oversight, methinks. Anyone else had any joy including special URL scheme links in tweets?
A solution that you should consider involves not sharing the URI scheme directly, but rather creating a page on your web server to handle this. In fact, if you want to be able to share full URI schemes with paths, you're better off building a web server to dynamically generate a page with a URI scheme redirect.
This is a over-simplified representation of what we built at Branch. This includes some code to get you started though the web server will require a bit of setup not described here.
instead of testapp://some.data.here, you'll link to http://yoursite.com/hosted-redirect/some.data.here.
your server should listen at the route /hosted-redirect, grab some.data.here and build the following page (body here):
(source: derrrick.com)
So your server will have to generate and respond with this page, filling in some.data.here, anytime http://yoursite.com/hosted-redirect/some.data.here is requested.
A lightweight node app could do this with a single file.
I added to my iOS application option to detect and response to custom URL schemes to launch application ( http://iosdevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.html ).
Link is working perfectly on different sites (using href), but I'm having problem with Facebook. If I'm trying to post link (using Graph API) which looks like:
myapp://blabla
Facebook return error:
The url you supplied is invalid
And for feed with link return
link URL is not properly formatted.
I can't just post url as a message because it's not being detected as a URL and appear like text only.
Is there any way to post to Facebook wall with custom links?
Edit:
I have an idea, but I don't know if it gonna work. Putting
myapp://blabla directly into address field in mobile browser is launching application so probably accessing an webpage (like http://www.mywebpage/myapp) with only redirection to
myapp://blabla gonna work too, but is Facebook gonna accept that link?
I think your suggestion in the edit is the correct method, and should work. However applications like spotify seem to use an intersticial page which fires the "app link" with javascript, the advantage to this approach is that you can use that page to "sell" the app to users who don't have it and also provide lovely open graph tags for people who want to share it.
I have been trying to put twitter's new tweet button on my wordpress blog. I have tried code provided on official twitter website, and couple of wordpress plugins to add tweet button on the blog. But on every try I am running into same issue. When I click on tweet button it goes to the twitter website but says
url' parameter does not contain a valid URL.
Could anyone please suggest me the way out for the same. thanks in advance!
Use this plugin: http://wordpress.org/extend/plugins/wp-tweet-button/
It works fine for me, and has couple of options to choose from.
hmmm.....I don't know why this is happening but I think you are using a local server and your url contains some ip address so that when you are clicking on the tweet button it will take your ip address also to connect with tweer site.
So it make url invalid, work on live site I think it will work.all the best.....