Getting twitter user's actual name, not screen_name - twitter

Using Twitter's API, I am able to get the list of tweets and so forth in the following format:
#Beyonce | I released a new music video today, check it out!
I am using "#{$status->user->screen_name} and that works fine, however I wanted to get the name of the account, ie in this case it would be Beyoncé Knowles.
I can't find anything that specifies in the documentation which parameter gets the name so I could use the following format:
Beyoncé Knowles #Beyonce | I released a new music video today, check it out!

Whoops, never mind! Just found it ;)
Use {$status->user->name}

Related

Error when downloading Apple Pass in Chrome for iOS

Issue with downloading Apple Pass on an iPhone device using Chrome and Firefox. It works fine on Safari. On Chrome for iOS it says:
Sorry, your Pass cannot be installed to Passbook at this time.
For Firefox it says:
Failed to Add Pass An error occurred while adding the pass to Wallet. Please try again later.
I tried just downloading the Apple Pass from a desktop browser and it downloads and I can install it fine on an iPhone/simulator which I'm assuming is not a problem with the pass itself but maybe rather something I'm missing in the response.
Here is the code I'm using to return the Apple Pass.
private void ReturnResponse(byte[] applePass)
{
Response.Clear();
Response.AddHeader("content-disposition", string.Formate("attachment; filename={0}", "sample.pkpass"));
Response.ContentType = "application/vnd.apple.pkpass"
Response.BinaryWrite(applePass);
Response.End();
}
Expected result:
Apple Pass opens and allows the user to add it to their Apple Wallet.
I realise this is question is over a year and a half old, but this is still an issue as of March 2021. After a lot of trial and error we managed to get it working on Chrome & Firefox. Our specific issue was that the request has to be a GET, and we had a form before the Pass was downloaded that submitted as a POST. Once we change the form to submit a GET the issue was resolved.
We tried to keep the POST and return a 201, which feels correct, but the issue persisted.
Changing our request method from a POST to a GET when serving the pkpass made it possible to download the pass using Google Chrome for Mobile on an iOS device.
This is untested, but I have found this link which I feel might be related:
https://github.com/eymengunay/php-passbook/issues/73
It says that the anchor you using to link to the pass should contain the this attribute:
target="_system"
I have not tested this resolution myself.
I just bought 20 access passes from a website. The site had the option to "add to apple wallet". It worked fine for 19 of them and then on the very last one I got this same error.
I did not do anything different when trying to add the 20th one.
Wondering if there is a limitation with the number of passes you can add?... but why would it be limited to a random number like 19?

Getting a rating for a song with Apple Music API

I am trying to get the rating for a song via the Apple Music API, as it describes here.
Hence, the URL I am using is:
https://api.music.apple.com/v1/me/ratings/songs/493341471
493341471 is the playbackStoreID (of the MPMediaItem) of the song 'Born to Die'. I have this song in my library, and I have added it to my "loved" list both on iTunes on my computer and on my iPhone. Yet, when I make this GET request, I get back a 404 Resource not Found error from Apple.
I also tried the same url but using the MPMediaItem property persistentId (its persistentID is 2932020188133715832), and that didn't work either.
The documentation says the url format is
https://api.music.apple.com/v1/me/ratings/songs/{id}
and their example gives a 9 digit id, exactly as the playbackStoreID I used above.
I tried searching the Apple Music catalogue for this song, and the id that was returned was indeed 493341471.
Yet, no matter what I do, I get a resource not found. Anyone have any idea what "id" the documentation here may be referring to?
Seems like you have to like/dislike a specific song with your apple music account then you can get an HTTP 200 response.

How to get video id from new share url pattern

I see YouTube app updated new function to share videos with the url like this:
https://www.youtube.com/shared?ci=8A940MXKFmQ
My app is using YouTube API/videos/list to get video informations and it required the Video ID field.
How can we get youtube video id from the url above.
Thanks
This is maybe not a good way to do it, but since there seems to be no API for that, check this:
https://github.com/rg3/youtube-dl/commit/4080530624eda994d535e1a01c38ddd6d9aa3805
What they do is fetching the content and search for the meta tag with the name videoId. Again: Not a good way, maybe this approach stops working in a month or a year or maybe never.

Youtube ?rel=0 tag no longer working

I was trying to share a Youtube link and wanted the person to just see that clip without any of the irrelevant suggestions that pop up next to it. I knew that adding ?rel=0 (or &rel=0) at the end of the URL used to achieve this, but this doesn't seem to be working anymore. After googling a bit, I found suggestions to use the youtu.be domain instead of youtube.com, but suggestions were shown nonetheless, or the URL gave an error. How else can I share this link and have no 'related' clips shown on the side? Thanks!
rel=0 is used to disable related videos shown at the end of a video, not to remove the suggested videos in the sidebars.
You can use the embed URL to access the video on it's own - http://youtube.com/embed/dQw4w9WgXcQ. Add ?rel=0 to disable the related videos at the end too.
Note, that rel=0 no longer works if you are signed into your Google account (YouTube, Gmail, etc).
&rel=0 only works when not signed in. However, you can get around this by using the enhanced privacy mode:
https://www.youtube-nocookie.com/embed/[id]?rel=0
As of August 23, 2018,
The behavior for the rel parameter is changing on or after September
25, 2018. The effect of the change is that you will not be able to
disable related videos. However, you will have the option of
specifying that the related videos shown in the player should be from
the same channel as the video that was just played.
To be more specific:
Prior to the change, if the parameter's value is set to 0, then the player does not show related videos.
After the change, if the rel parameter is set to 0, the player will show related videos that are from the same channel as the video that was just played.

fbcdn An error occurred while processing your request

Some videos uploaded to facebook using iOS Facebook SDK give me the error "An error occurred while processing your request"
Checkout this fbcdn video
I'm trying to play that video on a MPMoviePlayerViewController. Some videos work fine, some videos just don't. The video plays just fine on Facebook, so it's not something related to its data.
Can't find any documentation about what this error is related to.
I came across this error page too, on the iOS on an iPhone 4 when using the Facebook app.
To play the video even if it comes up expired, locate the post you want and instead of tapping on the embedded video, choose the post date. If the post reads:
John Doe shared Jane Doe's video: December 1, 2012 at 9:30pm.
...then you tap the date & time on the post -the "December 1, 2012 at 9:30pm" part- and it will take you to the video without using the expired link. The video should play that way.
Good luck.
This means the link to the video is expired, usually it works for a 2 days period then it gets expired and you have to query the facebook graph API again to get a new link.
I replaced 'v' with 'embed' in url. It worked.
VideoUrl = VideoUrl.replace("/v/", "/embed/")

Resources