Solved

need help with twitter API and finding a front-end for the results

Posted on 2013-12-05
6
326 Views
Last Modified: 2013-12-13
Is there a way to create a twitter feed that does not include tweets that have links in them? Not sure what UI I could use for this...maybe make a feed for hootsuite.

I already port tweets with link in them to my feedly using a api.

I would like to somehow consume the other tweets but avoid the tweets with links in this view.

I was told I could use this -
I am assuming that requires mastering the API?? How do I get an application that can do this for me in a real-time basis and I can consume it via an interface?

If no answer, where can I find people to help me?
0
Comment
Question by:finnstone
  • 2
  • 2
  • 2
6 Comments
 
LVL 50

Expert Comment

by:Steve Bink
ID: 39701284
It doesn't look like the Twitter API handles filtering by link inclusion, but you can certainly set up the process yourself.  When you call /search/tweets, run the return through another function that examines the content of each return.  Remove the ones that contain links.
0
 
LVL 16

Expert Comment

by:Walter Ritzel
ID: 39716953
You'll need to do whar routiner said: call the twitter api, and then process the return of the api through a routine to clean up tweets with links inside...
0
 

Author Comment

by:finnstone
ID: 39716968
I was hoping for a little more how-to on this one...he just restated the goal.
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 16

Expert Comment

by:Walter Ritzel
ID: 39717525
What exactly you do expect? The twitter api does not provide a method to filter our tweets that contain links. So, this means that logically, you should receive the feed and apply the filter and deliver the feed clean of the tweets with link. How to do it, you are asking? That could be in many different ways, depending on the language you are using and your knowledge of the language libraries: you can use the most basic string functions, you can use regular expressions, you can have a specific library for that.

Now if you want collaboration on your code, you may start sharing it and ask more specific questions.
0
 
LVL 50

Accepted Solution

by:
Steve Bink earned 500 total points
ID: 39718297
To be more specific:

You call the API with an HTTP call.  The standard Python library urllib2 is a popular way to accomplish that task.  How you build that call will depend on which API you're using.  It sounds like you want the Search API.

The return is going to be a JSON data set.  You can use the Python standard JSON library to turn that into an object or otherwise access the hierarchy.  

Find the section for tweets.  Iterate through each item in that section to discover if there is a link in the content.  You could use the Python standard RegEx library to find, for example '<a[^>]*href="[^"]+"[^>]*>', or maybe 'https?:\/\/'.  If your regex is not matched, add the item to a list of tweets that have no links.

That could all fit into a single class that knows how to call the API, parse the return properly, and allow for accessing your filtered list.

The reason it sounds like I'm just restating the goal is that the path to your goal is simply that straight-forward.  Call the API, filter the return, profit.
0
 

Author Comment

by:finnstone
ID: 39718308
This is awesome! Thanks
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Video and audio capture on Windows 7 3 101
Python Regex Problem 24 140
Edit linux file using python 4 58
Writing and Selling Web App Based on Google Sheets 2 82
Flask is a microframework for Python based on Werkzeug and Jinja 2. This requires you to have a good understanding of Python 2.7. Lets install Flask! To install Flask you can use a python repository for libraries tool called pip. Download this f…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
This video teaches viewers how to create their own website using cPanel and Wordpress. Tutorial walks users through how to set up their own domain name from tools like Domain Registrar, Hosting Account, and Wordpress. More specifically, the order in…
Wufoo.com provides powerful tools for surveying targeted groups, and utilizing data from completed surveys to find trends, discover areas of demand or customer expectation, and make business decisions on products or services.

820 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question