Solved

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

Posted on 2013-12-05
6
323 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
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

Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
CSS Question.. 3 85
Error handling in PHP 5 65
Compare site how does it work 4 77
Windows Tool to Build Android and iOS App 3 76
Article by: Swadhin
Introduction of Lists in Python: There are six built-in types of sequences. Lists and tuples are the most common one. In this article we will see how to use Lists in python and how we can utilize it while doing our own program. In general we can al…
These days, all we hear about hacktivists took down so and so websites and retrieved thousands of user’s data. One of the techniques to get unauthorized access to database is by performing SQL injection. This article is quite lengthy which gives bas…
Learn how to set-up custom confirmation messages to users who complete your Wufoo form. Include inputs from fields in your form, webpage redirects, and more with Wufoo’s confirmation options.
Learn how to set-up PayPal payment integration in your Wufoo form. Allow your users to remit payment through PayPal upon completion of your online form. This is helpful for collecting membership payments, customer payments, donations, and more.

776 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