Just noticed a spike of visitors following a t.co/LINKHERE a link re-written by twitter. Is there a way to track back to the twitter message that contained the link, if you know the link?
You can do this using twitter API 1.1. The easiest way is to use the api is through the twitter API console. Here are the steps:
Goto https://dev.twitter.com/rest/tools/console
Select https://api.twitter.com/1.1 from the Service dropdown menu.
Select OAuth 1 from the Authentication dropdown menu and authorize with your twitter account.
Choose GET /search/tweets.json api.
Type the t.co link (e.g. https://t.co/w6iqrcuZMA) in q query parameter (Try both http and https links. In my case the http link returned no record while https link returned some records). All the search results will be returned in json format.
Now to open the actual tweet use this link (fill the placeholders of course): https://twitter.com/{user.screen_name}/status/{id_str}
The standard twitter search will work for a few days.
For older t.co links, you could try searching with
find-tco.appspot.com.
Here’s the quick and easy way:
Go to: http://dev.twitter.com/rest/tools/console
Service: “api.twitter.com/1.1”
Authentication: OAuth 1, then log in if you need to
Make sure GET is selected and paste https://api.twitter.com/1.1/search/tweets.json?q=http%3A%2F%2Ft.co%2F{**SUFFIX**} into the Request URL box.
Replace **SUFFIX** with the t.co URL suffix. So if the URL you’re searching for is t.co/**N2ul8FFCxu**, the link you pasted should look like this:
https://api.twitter.com/1.1/search/tweets.json?q=http%3A%2F%2Ft.co%2F{**N2ul8FFCxu**}
Click Send
Open a new tab and paste twitter.com/**SCREEN_NAME**/status/**ID_STR** into the address bar
Replace **SCREEN_NAME** and **ID_STR** with info from Response. Like this:
twitter.com/**twitter**/status/**526534593826938881**
t.co links do show up in search, so if you're curious, you have about a week to find them before they get dropped from the search index.
For example:
http://search.twitter.com/search.json?q=https:%2F%2Ft.co%2FGJMsIcM6
Returns:
{
"completed_in": 0.019,
"max_id": 178215431251828740,
"max_id_str": "178215431251828736",
"page": 1,
"query": "https%3A%2F%2Ft.co%2FGJMsIcM6",
"refresh_url": "?since_id=178215431251828736&q=https%3A%2F%2Ft.co%2FGJMsIcM6",
"results": [
{
"created_at": "Fri, 09 Mar 2012 20:27:24 +0000",
"from_user": "kurrik",
"from_user_id": 7588892,
"from_user_id_str": "7588892",
"from_user_name": "Arne Roomann-Kurrik",
"geo": null,
"id": 178215431251828740,
"id_str": "178215431251828736",
"iso_language_code": "en",
"metadata": {
"result_type": "recent"
},
"profile_image_url": "http://a0.twimg.com/profile_images/24229162/arne001_normal.jpg",
"profile_image_url_https": "https://si0.twimg.com/profile_images/24229162/arne001_normal.jpg",
"source": "<a href="http://twitter.com/tweetbutton" rel="nofollow">Tweet Button</a>",
"text": "RT #raffi: “Twitter Catches the 'SPDY' Train” from #wired → http://t.co/suCbWWEl (& they reference my tweet! → https://t.co/GJMsIcM6)",
"to_user": null,
"to_user_id": null,
"to_user_id_str": null,
"to_user_name": null
},
{
"created_at": "Fri, 09 Mar 2012 20:26:26 +0000",
"from_user": "raffi",
"from_user_id": 8285392,
"from_user_id_str": "8285392",
"from_user_name": "Raffi Krikorian",
"geo": null,
"id": 178215186921033730,
"id_str": "178215186921033730",
"iso_language_code": "en",
"metadata": {
"result_type": "recent"
},
"profile_image_url": "http://a0.twimg.com/profile_images/1270234259/raffi-headshot-casual_normal.png",
"profile_image_url_https": "https://si0.twimg.com/profile_images/1270234259/raffi-headshot-casual_normal.png",
"source": "<a href="http://twitter.com/tweetbutton" rel="nofollow">Tweet Button</a>",
"text": "“Twitter Catches the 'SPDY' Train” from #wired → http://t.co/suCbWWEl (& they reference my tweet! → https://t.co/GJMsIcM6)",
"to_user": null,
"to_user_id": null,
"to_user_id_str": null,
"to_user_name": null
}
],
"results_per_page": 15,
"since_id": 0,
"since_id_str": "0"
}
You'll see that search returns retweets as well.
Related
I have embedded a OneNote notebook into a Microsoft Teams Tab. I am trying to get the Notebook Id using Graphi API
I can get the tab id from channels/{{ChannelId}}/messages/delta end point.
Using tabId, I can get tab details from channels/{{ChannelId}}/tabs/{{tabid}} end point.
Tab details end point gives configuration details that has contentUrl and websiteURL.
{
"id": "tabId",
"displayName": "My Contoso Tab - updated",
"configuration": {
"entityId": "2DCA2E6C7A10415CAF6B8AB6661B3154",
"contentUrl": "",
"websiteUrl": "",
"removeUrl": ""
},
"teamsApp": {
"id": "0d820ecd-def2-4297-adad-78056cde7c78",
"externalId": null,
"displayName": "Contoso",
"distributionMethod": "store"
},
"sortOrderIndex": "20",
"webUrl": ""
}
How can I get notebook Id or Section Id or Page Id that is embedded into the tab?
Formally the OneNote tab explicitly has no public documentation regarding its configuration as per :
https://learn.microsoft.com/en-us/graph/teams-configuring-builtin-tabs#onenote-tabs.
You can indeed try to reverse engineer the content or web URLs, and you may very well succeed today.
But you need to understand , and accept responsibility and the associated integration testing potential downtime as that URL format can/will change with no notification whatsoever.
If you can accept that risk & responsibility, using the oneNoteWebUrl= QSP from the contentUrl json node seems to be a decent key.
"configuration": {
"entityId": "00727f3d-df18-43ac-8cc9-698774312f5e",
"contentUrl": "https://www.onenote.com/teams/TabContent?notebookSource=Pick¬ebookSelfUrl=https%3A%2F%2Fwww.onenote.com%2Fapi%2Fv1.0%2FmyOrganization%2Fgroups%0076777f1c-3e3d-44ad-8206-53ba08a44cec%2Fnotes%2Fnotebooks%007-ce5c7935-0960-41f0-a5ce-e82a6d365f45&oneNoteWebUrl=https%3A%2F%2Fm365x432007.sharepoint.com%2Fsites%2FTaaP%2FSiteAssets%2FTaaP%2520Notebook¬ebookName=TaaP%20Notebook&siteUrl=https%3A%2F%2Fm365x432007.sharepoint.com%2Fsites%2FTaaP&createdTeamType=Standard&oneNoteClientUrl=https%3A%2F%2Fm365x432007.sharepoint.com%2Fsites%2FTaaP%2FSiteAssets%2FTaaP%2520Notebook¬ebookIsDefault=true&ui={locale}&tenantId={tid}&upn={userPrincipalName}&groupId={groupId}&theme={theme}&entityId={entityId}&subEntityId={subEntityId}&sessionId={sessionId}&ringId={ringId}&teamSiteUrl={teamSiteUrl}&channelType={channelType}&trackingId={appSessionId}&hostClientType={hostClientType}",
"removeUrl": "https://www.onenote.com/teams/TabRemove?notebookSource=Pick¬ebookSelfUrl=https%3A%2F%2Fwww.onenote.com%2Fapi%2Fv1.0%2FmyOrganization%2Fgroups%2F46777f1c-3e3d-44ad-8206-53ba08a44cec%2Fnotes%2Fnotebooks%2F1-ce5c7935-0960-41f0-a5ce-e82a6d365f45&oneNoteWebUrl=https%3A%2F%2Fm365x432007.sharepoint.com%2Fsites%2FTaaP%2FSiteAssets%2FTaaP%2520Notebook¬ebookName=TaaP%20Notebook&siteUrl=https%3A%2F%2Fm365x432007.sharepoint.com%2Fsites%2FTaaP&createdTeamType=Standard&oneNoteClientUrl=https%3A%2F%2Fm365x432007.sharepoint.com%2Fsites%2FTaaP%2FSiteAssets%2FTaaP%2520Notebook¬ebookIsDefault=true&ui={locale}&tenantId={tid}&upn={userPrincipalName}&groupId={groupId}&theme={theme}&entityId={entityId}&subEntityId={subEntityId}&sessionId={sessionId}&ringId={ringId}&teamSiteUrl={teamSiteUrl}&channelType={channelType}&trackingId={appSessionId}&hostClientType={hostClientType}",
"websiteUrl": "https://www.onenote.com/teams/TabRedirect?redirectUrl=https%3A%2F%2Fm365x432007.sharepoint.com%2Fsites%2FTaaP%2FSiteAssets%2FTaaP%2520Notebook",
--> `oneNoteWebUrl=https%3A%2F%2Fm365x432007.sharepoint.com%2Fsites%2FTaaP%2FSiteAssets%2FTaaP%2520Notebook'
--> urldecode
https://m365x432007.sharepoint.com/sites/TaaP/SiteAssets/TaaP%20Notebook
The response of channels/{{ChannelId}}/tabs/{{tabid}} will contain details for tab and will not return details for the embedded onenote notebooks and pages. However you can get details for onenote notebooks and pages using https://graph.microsoft.com/v1.0/me/onenote/notebooks
You can refer below document for more information
https://learn.microsoft.com/en-us/graph/integrate-with-onenote
https://learn.microsoft.com/en-us/graph/api/resources/onenote-api-overview?view=graph-rest-1.0
Thanks
I'm using Facebook graph API by calling https://graph.facebook.com/v2.10/me?access_token=xxxxxxxxxxxxxxxxxx&fields=id,email,name,first_name,last_name,gender,age_range,picture.width(512).height(512),locale,link,timezone,updated_time which returns the json response I was expecting. Something like this:
{
"id": "1234567890987654321",
"email": "xxxxxx\u0040example.com",
"name": "xxxx xxxx",
"first_name": "xxxx",
"last_name": "xxxx",
"gender": "xxxxx",
"age_range": {
"min": 21
},
"picture": {
"data": {
"height": 720,
"is_silhouette": false,
"url": "https://scontent.fna.fbcdn.net/v/t1.0-1/p720x720/xxx.jpg?oh=xxx",
"width": 720
}
},
"locale": "en_US",
"link": "https://www.facebook.com/app_scoped_user_id/1234567890987654321/",
"timezone": xx,
"updated_time": "2017-05-24T14:00:01+0000"
}
However, on calling the url child node of the picture, nothing was returned. I copied the actual link and paste it in Google Chrome browser and DNS_PROBE_FINISHED_NXDOMAIN error is returned.
I checked the image used by the Facebook website, I noticed that it's pointing to a different base url: https://scontent.fjnb2-1.fna.fbcdn.net, while mine is pointing to https://scontent.fna.fbcdn.net. The returned url on graph is missing .fjnb2-1 and it works when I added it.
Is this a known bug on Facebook Graph API?
Is it ok to change the base url to include the missing part?
Any other way to fix this issue without running into another issue later when Facebook decided to change the return url?
This is a known bug which has already been reported by many developers on https://developers.facebook.com/bugs and I believe the Facebook team is working on resolving this.
Edit:
I can confirm that this issue has been resolved by Facebook Dev Team now.
I am working on an iOS app that loads peoples' profile pictures into an instance of FBProfilePictureView, which has a property of profileID. Is there a way to easily find someone's profileID?
I'm conflicted as to whether this should be in the comments or an answer, but here's how:
You use the Open Graph API found here
A call of http://graph.facebook.com/username returns you a bunch of Json which you can get the id value from.
So, http://graph.facebook.com/facebook returns:
{
"id": "20531316728",
"about": "The Facebook Page celebrates how our friends inspire us, support us, and help us discover the world when we connect.",
"can_post": false,
"category": "Product/service",
"checkins": 348,
"cover": {
"cover_id": "10152513030211729",
"offset_x": 0,
"offset_y": 62,
"source": "https://scontent-b.xx.fbcdn.net/hphotos-xfp1/t31.0-8/q71/s720x720/1553497_10152513030211729_1664524928_o.jpg"
},
"founded": "February 4, 2004",
"has_added_app": false,
"is_community_page": false,
"is_published": true,
"likes": 152791404,
"link": "https://www.facebook.com/facebook",
"mission": "Founded in 2004, Facebook\u2019s mission is to give people the power to share and make the world more open and connected. People use Facebook to stay connected with friends and family, to discover what\u2019s going on in the world, and to share and express what matters to them.",
"name": "Facebook",
"parking": {
"lot": 0,
"street": 0,
"valet": 0
},
"talking_about_count": 2149385,
"username": "facebook",
"website": "http://www.facebook.com",
"were_here_count": 0
}
Why not using the Facebook Tool ? You can have ID and some other information (In JSon format) about people with only replacing their username in the URL.
I'm trying to find a way to just get tweets to all users. The JSON code indicates these as "to_user" null. For example the tweet below edent tweets to everyone, thus the to_user=null.
I tried a few alternatives without success:
http://search.twitter.com/search.json?q=to:null%20from:edent&result_type=mixed
http://search.twitter.com/search.json?q=to:0%20from:edent&result_type=mixed
http://search.twitter.com/search.json?q=to:%20from:edent&result_type=mixed
{
"created_at": "Thu, 28 Jun 2012 06:55:58 +0000",
"from_user": "edent",
"from_user_id": 14054507,
"from_user_id_str": "14054507",
"from_user_name": "Terence Eden",
"geo": null,
"id": 218236278402068480,
"id_str": "218236278402068480",
"iso_language_code": "en",
"metadata": {
"result_type": "recent"
},
"profile_image_url": "http://a0.twimg.com/profile_images/2318692719/7182974111_ec8e1fb46f_s_normal.jpg",
"profile_image_url_https": "https://si0.twimg.com/profile_images/2318692719/7182974111_ec8e1fb46f_s_normal.jpg",
"source": "<a href="http://twitter.com/">web</a>",
"text": "RT #straczynski: #edent Clearly the man was ahead of his time.",
"to_user": null,
"to_user_id": 0,
"to_user_id_str": "0",
"to_user_name": null,
"in_reply_to_status_id": 218075066452287500,
"in_reply_to_status_id_str": "218075066452287488"
},
If you're just looking to get tweets from a particular user that aren't to anyone, use the /get/statuses/user_timeline REST API endpoint instead of the Search API. /get/statuses/user_timeline has an exclude_replies parameter that should do what you're looking for.
The Search API doesn't have any way to exclude replies. Your only option is to get tweets matching whatever other parameters you pass, and process them on your end to remove any whose text starts with "#".
I'm using the Google Contacts API to get back formatted JSON, hopefully containing ALL of a user's contacts' email addresses. I use this information to search my database for the user's friends.
Neither of these results occur.
Here's the URI that's called (broken up by paramater for slightly better readability:
http://www-opensocial.googleusercontent.com/api/people/#me/#all/?
filterby=emails&max_results=1000
&oauth_consumer_key=XXXXXXX
&oauth_nonce=h7ZEI
&oauth_signature=6U2ywoPRFu8iJdQhjMRk%2FZlf%2FBg%3D
&oauth_signature_method=HMAC-SHA1
&oauth_timestamp=1283979209
&oauth_token=1%2Fwv9OYV4LuffVLv6OqlFJLOtTlBo5sYYQkHbZznlLrNk
&oauth_version=1.0
&orderby=starttime
Here's some truncated and anonymized JSON I have returned.
{
"startIndex": 0,
"totalResults": 615,
"entry": [
{
"id": "XXXXXXXXXXXXXXXXXXX",
"name": {
"formatted": "XXXXX XXXXXX",
"familyName": "XXXXXXX",
"givenName": "XXXXXX"
},
"displayName": "XXXXX XXXXXX"
},
],
"itemsPerPage": 20
}
Any thoughts on what's going wrong here would be great.
Hate to answer my own question so soon, but I was using the wrong initial scope. I was using Google's Open Social feed rather than the Google Contacts feed.