Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2013-12-05
6
Medium Priority
?
348 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
  • 2
6 Comments
 
LVL 51

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
Looking for a new Web Host?

Lunarpages' assortment of hosting products and solutions ensure a perfect fit for anyone looking to get their vision or products to market. Our award winning customer support and 30-day money back guarantee show the pride we take in being the industry's premier MSP.

 
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 51

Accepted Solution

by:
Steve Bink earned 2000 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

Foolproof security solutions has become one of the key necessities of every e-commerce or Internet banking website. If you too own an online shopping site then its vital for you to equip your web portal with customer security features that can allow…
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
Learn the basics of strings in Python: declaration, operations, indices, and slicing. Strings are declared with quotations; for example: s = "string": Strings are immutable.: Strings may be concatenated or multiplied using the addition and multiplic…
Use Wufoo, an online form creation tool, to make powerful forms. Learn how to choose which pages of your form are visible to your users based on their inputs. The page rules feature provides you with an opportunity to create if:then statements for y…

705 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