Get only tweets with Pictures using twitter search api - twitter

This question has already been asked there : Get Tweets with Pictures using twitter search api
But it's obsolete now : the new Twitter API doesn't allow the answer provided.
In a nutshell : I'm trying, in Ajax, to retrieve tweets with a particular hashtag that contains a media (image).

It rather depends on the source of the images that you want to find. You are best of searching for the URL of the image directly.
If you're looking for images uploaded directly to Twitter with the hashtag "#nice", do a search for twimg%20%26%20%23nice (that's "twimg & #nice").
You could also include flickr or any other image sharing service.

Related

Twitter API, get Tweet as Image

I understand you can get the specific url of a tweet using the Twitter API by creating a url like this
https://twitter.com/username/status/tweet-id
However, is it possible to get an image of a tweet?
I can get media images, but those are just images that people posted in the tweet. I want to know if it is possible to get an image of the tweet itself.
Twitter's API includes the ability to do this with oembed.
https://dev.twitter.com/rest/reference/get/statuses/oembed
See https://opensourcelibs.com/lib/tweets-as-an-image
This project provides an API for downloading tweets as images: https://tweets-as-an-image.herokuapp.com/tweet?twitterHandle={your_twitter_handle}&id={your_tweet_id}&theme={light_or_dark}&maxwidth={max_width_of_your_tweet_image}&height={height_of_the_image}&lang={language}
Fast forward to 2023 - none of the one above seems to be available anymore.
This library worked flawlessly for me. It is not an web API but works well and has good options:
https://github.com/Xacnio/tweetcapture
You can now get images or screenshots of tweets using the #aissistant handle on twitter.
Retweet any tweet with the comment "#aissistant #image" to get an image.
Retweet any tweet with the comment "#aissistant #screenshot" to get a screenshot.
For other options like converting to memes and jokes check out the handle.
Full disclosure: I am creator of the bot behind the handle.

Change tiny urls to expanded url inside tweet

I am getting Twitter tweets in my website using v1.1 user timeline API, but the problem is the URLs tweeted are displaying in short form like t.co... format.
Now I want to display expanded URL instead of tiny URLs, so how can I can do this? Please give me a solution.
Note: I referred Simplest PHP example for retrieving user_timeline with Twitter API version 1.1, this questions in stackoverflow for getting tweets.

Twitter media search

Is it possible to search through Twitter's media for specific tags?
I know you can access the media via this url:
https://twitter.com/#!/therealpaddock/media/grid
Appending media/grid to the end of a user's ID, I was wondering if there is a way to search through all the twitter media photos via a tag???
https://dev.twitter.com/docs/streaming-api/user-streams
http://dev.twitpic.com/docs/
I have been searching through the API and googling, and I can't find anything out there that does this.
I have been looking at Twitpic's API but can't seem to find anywhere that lets you search and display images.
Tag? I'm not sure you understand Twitter. A photo is simply attached to a tweet. A tweet may have a hashtag. If you want to search by hashtags, simply use the normal tweet search, then filter the photos.
Not sure why you linked to Twitpic, as what you're looking for is the normal Twitter search. https://dev.twitter.com/docs/api/1/get/search
You can look at the Twicsy API.
It allows you to search all Twitter pictures using a search term (which is what I think you mean by tag).
http://api.twicsy.com/search/foo
http://api.twicsy.com/search?q=foo
They also provide ways to filter results, by number of results and date. (Go to the API docs for more details).
Another solution would be to use the Twitter search API to make the query and parse out the images manually. This blog post explains how.

Is there a website that will allow me to filter tweets from my Twitter feed?

I need to approve/reject tweets from my Twitter feed, and display on our website. Any websites out there that will provide this functionality?
I've looked into TidyTweet.com, but I can't tell if they support the kind of "feed" we have (it's actually a json search, not an RSS feed).
For example, this is our "feed":
http://search.twitter.com/search.json?q=Downtown+Chicago
Twitterfeed already provides an interface for that. Click on edit->advanced you should see filter tweets.
Another alternative is filtering from the feed itself, you can do this from Yahoo Pipes

How to add Twitter Expanded Tweets? (was: twitter media preview card for my site?)

I googled a lot about how to make twitter media preview for my website entities if they are linked in a tweet like images below:
Any idea where can I find some documentation about it? Or a tutorial? Is this possible or these media/site previews are hardcoded in twitter?
EDIT:
so, what I need:
If someone links my site on twitter, my widget appear under the tweet, like below:
UPDATE 2012-06-13
It appears this is an Expanded Tweet - -what the requirements are to integrate these expansions into Twitter are do not appear to be displayed - but this sure is interesting.
Nope your in luck. They're not hardcoded into Twitter, they're available in the JSON response. You actually have in your post the word you need to google for entities.
You can add include_entities=1 to the end of most REST api calls and it will give you expanded information about the URL's contained within the JSON. It will split out all the URL's where you can parse out the Youtube links for example. The JSON also includes a special media_url entity but it only works for pictures. In any case, you can still parse out the media easily like youtube with a regex match because you get the URL's split out nicely with this include_entities=1 parameter.
example call :
http://api.twitter.com/1/statuses/user_timeline.json?screen_name=twitterapi&include_entities=1
more documentation : https://dev.twitter.com/docs/tweet-entities
answer edited below based on clarification:
Editing Twitter itself with previews is impossible and it's also ineffective. 75% of traffic to Twitter happens outside of Twitter.com. However the most probable solution to achieving this request would be to download a browser extension.
This extension for example enbales previews of webpages directly in the users stream content preview pane on Twitter.com
https://chrome.google.com/webstore/detail/oijgblonhcagdhfbgjilnpjipmijimmn

Resources