Search Results

Search found 3742 results on 150 pages for 'twitter'.

Page 23/150 | < Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >

  • Trying to parse twitter trends

    - by timothy5216
    Im trying to parse twitter trends but i keep getting a parser error at "as_of". anyone know why this is happening? EDIT: Here is the code im using NSMutableArray *tweets; tweets = [[NSMutableArray alloc] init]; NSURL *url = [NSURL URLWithString:@"http://search.twitter.com/trends/current.json"]; trendsArray = [[NSMutableArray alloc] initWithArray:[CCJSONParser objectFromJSON:[NSString stringWithContentsOfURL:url encoding:4 error:nil]]]; NSMutableDictionary *dict = [[NSMutableDictionary alloc] init]; for (int i = 0; i < [trendsArray count]; i++) { dict = [[NSMutableDictionary alloc] init]; //[post setObject: [[currentArray objectAtIndex:i] objectForKey:@"query"]]; [dict setObject:[trendsArray objectAtIndex:i] forKey:@"trends"]; //[dict setObject:[trendsArray objectAtIndex:i] forKey:@"query"]; //[post setObject:[trendsArray objectAtIndex:i] forKey:@"as_of"]; [tweets addObject:dict]; //post = nil; }

    Read the article

  • Profile Image Update Twitter API

    - by jshollax
    I am trying to upload a profile image to twitter using their API. I found some good examples on the web on how to format the URLRequest, however I just can't seem to get this to work. Any help would be appreciated. The URL that I am using from Twitter API is http://twitter.com/account/update_profile_image.json -(void)uploadImageForAccount:(NSURL *)theURL intUserName:(NSString *)_userName initPassWord:(NSString *)_passWord image:(NSData *)image{ userName = [_userName retain]; passWord = [_passWord retain]; UIApplication *app = [UIApplication sharedApplication]; app.networkActivityIndicatorVisible = YES; requestedData = [[NSMutableData alloc] initWithLength:0]; NSMutableURLRequest *theRequest = [NSMutableURLRequest requestWithURL:theURL cachePolicy:NSURLRequestReloadIgnoringLocalCacheData timeoutInterval:60]; [theRequest setHTTPMethod:@"POST"]; NSString *stringBoundary = [NSString stringWithString:@"0xKhTmLbOuNdArY"]; NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", stringBoundary]; [theRequest addValue:contentType forHTTPHeaderField:@"Content-Type"]; // Credentials NSString *creds = [NSString stringWithFormat:@"%@:%@", userName, passWord]; [theRequest addValue:[NSString stringWithFormat:@"Basic %@",[self base64encode:creds]] forHTTPHeaderField:@"Authorization"]; NSMutableData *postBody = [NSMutableData data]; [postBody appendData:[[NSString stringWithFormat:@"\r\n\r\n--%@\r\n", stringBoundary] dataUsingEncoding:NSUTF8StringEncoding]]; [postBody appendData:[[NSString stringWithString:@"Content-Disposition: form-data; name=\"source\"\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]]; [postBody appendData:[[NSString stringWithString:@"canary"] dataUsingEncoding:NSUTF8StringEncoding]]; NSString *mimeType = mimeType = @"image/jpeg"; [postBody appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",stringBoundary] dataUsingEncoding:NSUTF8StringEncoding]]; [postBody appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"media\"; filename=\"%@\"\r\n", @"TNImage.jpeg"] dataUsingEncoding:NSUTF8StringEncoding]]; [postBody appendData:[[NSString stringWithFormat:@"Content-Type: %@\r\n", mimeType] dataUsingEncoding:NSUTF8StringEncoding]]; [postBody appendData:[[NSString stringWithString:@"Content-Transfer-Encoding: binary\r\n\r\n"] dataUsingEncoding:NSUTF8StringEncoding]]; [postBody appendData:image]; [postBody appendData:[[NSString stringWithFormat:@"\r\n--%@\r\n",stringBoundary] dataUsingEncoding:NSUTF8StringEncoding]]; [theRequest setHTTPBody:postBody]; NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:theRequest delegate:self startImmediately:YES]; if(DEBUG) NSLog(@"Connection = %@",[connection description]); if (connection == nil) { if(DEBUG) NSLog(@"Connection was Nil"); } }

    Read the article

  • Asp.net mvc 2 and twitter authenticaton

    - by arinte
    I am using OAuth (linq2twitter and DotNetOpenAuth) to allow a user to post comments via their twitter account. So when you do the authorization twitter does a callback, so the way linq2twitter does it is to set the callback to the page that did the req. So if the req came from blah.com\twit it will redirect to blah.com\twit. This leads me to have code like this: public ActionResult Twit(){ var qString = Request.QueryString; if (qString.Count <= 0){ //do authorization } else{ //do authentication } } So I would like to split it to this(seemingly both of these calls are done via GET): public ActionResult Twit(){} public ActionResult Twit(string token1, string token2){} When I have this currently I get the .net yellow screen complaining about ambiguous action methods. How do I route this?

    Read the article

  • Add a new member to a Twitter List

    - by yc10
    I'm trying to add a user (by variable $id) to a Twitter List using PHP CURL, and I can't get it to work. $curl_handle = curl_init(); curl_setopt($curl_handle, CURLOPT_URL, "http://twitter.com/username/list/members.xml"); curl_setopt($curl_handle, CURLOPT_POST, 1); curl_setopt($curl_handle, CURLOPT_POSTFIELDS, "id=$id"); curl_setopt($curl_handle, CURLOPT_CONNECTTIMEOUT, 2); curl_setopt($curl_handle, CURLOPT_RETURNTRANSFER, 1); curl_setopt($curl_handle, CURLOPT_USERPWD, "username:password"); curl_setopt($curl_handle, CURLOPT_HTTP_VERSION, CURL_HTTP_VERSION_1_1); curl_setopt($curl_handle, CURLOPT_VERBOSE, 1); $result = curl_exec($curl_handle); // Look at the returned header $resultArray = curl_getinfo($curl_handle); curl_close($curl_handle); if($resultArray['http_code'] == "200"){ echo 'Success'; } else { echo var_dump($resultArray); } The var_dump reveals that the http_code of the return is 403.

    Read the article

  • PHP fetch all Twitter Followers and compare them to friends

    - by ArneRie
    Hi, iam looking for performant way to do the following: User login Fetch all Friends from Twitter Fetch all Followers from Twitter Display all Friends wich aren't Followers The Problem: How to do this in a performant way? An user can have up to 2 Million Friends or Followers. In the moment im Storing both inside an sqllite table an compare them through an loop. When the user comes back the table is cleared and process starts again. This works finde on 100 - 1000 Friends.. but will be tricky with 500000 Friends. I cant cache the lists because they can change every moment.. Does someone knows a good way to handle such big amount of data?

    Read the article

  • Twitter Answering System with Php

    - by 1342
    I'm working on a project which gives information to students, online and instantly on Twitter ( for my university, I'm also student in Computer Engineering - first year ) I'm fetching mentions which comes to this account - https://twitter.com/BahcesehirBilgi I'm trying to search these in order to filters which i created in my panel. http://imgim.com/2107incia8023554.jpg - This is panel screenshot ( filter add ) I'm splitting filter words and searching them in mydatabase coloumn which get information about users tweet ( using mysql like, %word1%%word2% etc ). http://imgim.com/3792incis3008867.jpg - Example of filter, and answers http://imgim.com/1424incit5317319.jpg - random dashboard screenshot Here is the question, how can i search this filters more accurately and more human friendly in my database ? Please dont forget this is my first project, and new in Php and working alone :)

    Read the article

  • JTwitter OAuth signpost example

    - by RenegadeAndy
    Hey. I believe JTwitter supports OAuth to authenticate against a developer account , however i cannot get any of them working. The JTwitter docs say signpost is the supported method - yet I cannot seem to find the OAuthSignpostClient class they use even after adding the signpost libs: OAuthSignpostClient client = new OAuthSignpostClient(JTWITTER_OAUTH_KEY, JTWITTER_OAUTH_SECRET, "oob"); Twitter jtwit = new Twitter("yourtwittername", client); // open the authorisation page in the user's browser client.authorizeDesktop(); // get the pin String v = client.askUser("Please enter the verification PIN from Twitter"); client.setAuthorizationCode(v); // Optional: store the authorisation token details Object accessToken = client.getAccessToken(); // use the API! jtwit.setStatus("Messing about in Java"); Has anybody code that code segment working? Please help Andy

    Read the article

  • How to crawl retweets of a certain user?

    - by Xiong
    I studied the Twitter API Documentation today. Only find that we could use "Twitter REST API Method: statuses user_timeline" to acquire statuses of a certain user. Retweets are stripped out of the user_timeline for backwards compatibility reasons. If I want retweets included, API Documentation recommend "statuses retweeted_by_me", but retweeted_by_me cannot return the retweets by other users. I think maybe we can analyse the twitter webpage of a certain user to get his retweets. However is there any elegant way to crawl retweets of a certain user? Thanks in advance!

    Read the article

  • Wrap link around links in tweets with php preg_replace

    - by Ben Paton
    Hello I'm trying to display the latest tweet using the code below. This preg_replace works great for wrapping a link round twitter @usernames but doesn't work for web addresses in tweets. How do I get this code to wrap links around urls in tweets. <?php /** Script to pull in the latest tweet */ $username='fairgroceruk'; $format = 'json'; $tweet = json_decode(file_get_contents("http://api.twitter.com/1/statuses/user_timeline/{$username}.{$format}")); $latestTweet = htmlentities($tweet[0]->text, ENT_QUOTES); $latestTweet = preg_replace('/@([a-z0-9_]+)/i', '<a href="http://twitter.com/$1" target="_blank">@$1</a>', $latestTweet); $latestTweet = preg_replace('/http://([a-z0-9_]+)/i', '<a href="http://$1" target="_blank">http://$1</a>', $latestTweet); echo $latestTweet; ?> Thanks for the help, Ben

    Read the article

  • How to include css in a hmvc setup in codeigniter

    - by tariq
    I have setup the combination Codeigniter + HMVC + Twitter Bootstrap using this tutorial. I have created two modules named app and session. The app module contains the twitter bootstrap sample. When I click on About link, a new login page is displayed which is the session module configured using <?php echo Modules::run('session/session/index'); ?> The problem I am facing is that when I include the twitter bootstrap in both the views, the app module gets realigned and corousal doesnt work. How do I get the CSS to work with the session module ?

    Read the article

  • Error in executing

    - by Saranya.R
    Hi........ I am interested in sending tweets using Java program.I wrote the following prgram.It doen't show any error in compiling.But while executing it shows "Exception in thread "main" java.lang.NoClassDefFoundError: hi Caused by: java.lang.ClassNotFoundException: hi at java.net.URLClassLoader$1.run(URLClassLoader.java:200) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:188) at java.lang.ClassLoader.loadClass(ClassLoader.java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang.ClassLoader.loadClass(ClassLoader.java:252) at java.lang.ClassLoader.loadClassInternal(ClassLoader.java:320) Could not find the main class: hi. Program will exit." This is my code.. package twitter; //import java.lang.object; import net.unto.twitter.*; import net.unto.twitter.TwitterProtos.Status; public class hi { public static void main(String args[]) { Api api = Api.builder().username("usename").password("password").build(); api.updateStatus("This is a test message.").build().post(); } } Can anybody help me ..Pls

    Read the article

  • http authenitcation in xcode

    - by user313100
    I am trying to make twitter work in my app and everything works fine except the code does not seem to recognize an error from twitter. If the username/password are not valid, I get an error message through this function: - (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data { NSString* strData = [[[NSString alloc] initWithBytes:[data bytes] length:[data length] encoding:NSASCIIStringEncoding] autorelease]; NSLog(@"Received data: %@", strData ) ; return ; } It prints: Received data: Could not authenticate you. . However, the app continues to the post a tweet view I have and ignores the error. Obviously, I do not have something setup right to detect such an error from twitter so my question is how do I get xcode to recognize an error like this? This uses basic http auth btw and don't mention anything about OAuth...just trying to get this to work for now.

    Read the article

  • Is there a better acts_as_commentable for Rails?

    - by levi rosol
    Here's what I'm looking to do. I have a site where I want the user to be able to leave comments on various Models. acts_as_commentable is the obvious starting point for this, but I'm curious if there is a gem / plug-in with a more robust feature-set. For example: Pre-built partial(s) (w/ or w/o Twitter / FB buttons) Partial(s) that utilize jQuery Twitter and / or FB tunnels (push to the users twitter / FB when they comment) Pre-built mechanism for pushing other users comments to users viewing that Model I can see how some of this functionality could be app specific, however, a generic implementation seems like it would be useful. I'm curious if something like this exists or not.

    Read the article

  • high tweet status IDs causing failed to open stream errors?

    - by escarp
    Erg. Starting in the past few days high tweet IDs (at least, it appears it's ID related, but I suppose it could be some recent change in the api returns) are breaking my code. At first I tried passing the ID as a string instead of an integer to this function, and I thought this worked, but in reality it was just the process of uploading the file from my end. In short, a php script generates these function calls, and when it does so, they fail. If I download the php file the call is generated into, delete the server copy and re-upload the exact same file without changing it, it works fine. Does anyone know what could be causing this behavior? Below is what I suspect to be the most important part of the individual files that are pulling the errors. Each of the files is named for a status ID (e.g. the below file is named 12058543656.php) <?php require "singlePost.php"; SinglePost(12058543656) ?> Here's the code that writes the above files: $postFileName = $single_post_id.".php"; if(!file_exists($postFileName)){ $created_at_full = date("l, F jS, Y", strtotime($postRow[postdate])-(18000)); $postFileHandle = fopen($postFileName, 'w+'); fwrite($postFileHandle, '<html> <head> <title><?php $thisTITLE = "escarp | A brief poem or short story by '.$authorname.' on '.$created_at_full.'"; echo $thisTITLE;?></title><META NAME="Description" CONTENT="This brief poem or short story, by '.$authorname.', was published on '.$created_at_full.'"> <?php include("head.php");?> To receive other poems or short stories like this one from <a href=http://twitter.com/escarp>escarp</a> on your cellphone, <a href=http://twitter.com/signup>create</a> and/or <a href=http://twitter.com/devices>associate</a> a Twitter account with your cellphone</a>, follow <a href=http://twitter.com/escarp>us</a>, and turn device updates on. <pre><?php require "singlePost.php"; SinglePost("'.$single_post_id.'") ?> </div></div></pre><?php include("foot.php");?> </body> </html>'); fclose($postFileHandle);} $postcounter++; } I can post more if you don't see anything here, but there are several files involved and I'm trying to avoid dumping tons of irrelevant code. Error: Warning: include(head.php) [function.include]: failed to open stream: No such file or directory in /f2/escarp/public/12177797583.php on line 4 Warning: include(head.php) [function.include]: failed to open stream: No such file or directory in /f2/escarp/public/12177797583.php on line 4 Warning: include() [function.include]: Failed opening 'head.php' for inclusion (include_path='.:/nfsn/apps/php5/lib/php/:/nfsn/apps/php/lib/php/') in /f2/escarp/public/12177797583.php on line 4 To receive other poems or short stories like this one from escarp on your cellphone, create and/or associate a Twitter account with your cellphone, follow us, and turn device updates on. Warning: require(singlePost.php) [function.require]: failed to open stream: No such file or directory in /f2/escarp/public/12177797583.php on line 7 Warning: require(singlePost.php) [function.require]: failed to open stream: No such file or directory in /f2/escarp/public/12177797583.php on line 7 Fatal error: require() [function.require]: Failed opening required 'singlePost.php' (include_path='.:/nfsn/apps/php5/lib/php/:/nfsn/apps/php/lib/php/') in /f2/escarp/public/12177797583.php on line 7 <?php function SinglePost($statusID) { require "nicetime.php"; $db = sqlite_open("db.escarp"); $updates = sqlite_query($db, "SELECT * FROM posts WHERE postID = '$statusID'"); $row = sqlite_fetch_array($updates, SQLITE_ASSOC); $id = $row[authorID]; $result = sqlite_query($db, "SELECT * FROM authors WHERE authorID = '$id'"); $row5 = sqlite_fetch_array($result, SQLITE_ASSOC); $created_at_full = date("l, F jS, Y", strtotime($row[postdate])-(18000)); $created_at = nicetime($row[postdate]); if($row5[url]==""){ $authorurl = ''; } else{ /*I'm omitting a few pages of output code and associated regex*/ return; } ?>

    Read the article

  • "Tweet this" extension for BlogEngine.net [closed]

    - by unknown (yahoo)
    I have a blog that uses BlogEngine.net I am looking for an extension that automatically adds a "Tweet this" link for every post. When a user clicks on the "Tweet this" link, it would take them to their Twitter account with the "What are you doing" textarea prepopulated with the link of my blog post. Are there any out there that let me do this?

    Read the article

  • Returned JSON from Twitter and displaying tweets using FlexSlider

    - by Trey Copeland
    After sending a request to the Twitter API using geocode, I'm getting back a json response with a list of tweets. I then that into a php array using json_decode() and use a foreach loop to output what I need. I'm using flex slider to show the tweets in a vertical fashion after wrapping them in a list. So what I want is for it to only show 10 tweets at a time and scroll through them infinitely like an escalator. Here's my loop to output the tweets: foreach ($tweets["results"] as $result) { $str = preg_replace('/[^\00-\255]+/u', '', $result["text"]); echo '<ul class="slides">'; echo '<li><a href="http://twitter.com/' . $result["from_user"] . '"><img src=' . $result["profile_image_url"] . '></a>' . $str . '</li><br /><br />'; echo '</ul>'; } My jQuery looks like this as of right now as I'm trying to play around with things: $(window).load(function() { $('.flexslider').flexslider({ slideDirection: "vertical", start: function(slider) { //$('.flexslider .slides > li gt(10)').hide(); }, after: function(slider) { // current.sl } }); }); Non-Working demo here - http://macklabmedia.com/tweet/

    Read the article

  • TouchXML to read in twitter feed for iphone app

    - by Fiona
    Hello there, So I've managed to get the feed from twitter and am attempting to parse it... I only require the following fields from the feed: name, description, time_zone and created_at I am successfully pulling out name and description.. however time_zone and created_at always are nil... The following is the code... Anyone see why this might not be working? -(void) friends_timeline_callback:(NSData *)data{ NSString *string = [[NSString alloc] initWithData:data encoding:NSASCIIStringEncoding]; NSLog(@"Data from twitter: %@", string); NSMutableArray *res = [[NSMutableArray alloc] init]; CXMLDocument *doc = [[[CXMLDocument alloc] initWithData:data options:0 error:nil] autorelease]; NSArray *nodes = nil; //! searching for item nodes nodes = [doc nodesForXPath:@"/statuses/status/user" error:nil]; for (CXMLElement *node in nodes) { int counter; Contact *contact = [[Contact alloc] init]; for (counter = 0; counter < [node childCount]; counter++) { //pulling out name and description only for the minute!!! if ([[[node childAtIndex:counter] name] isEqual:@"name"]){ contact.name = [[node childAtIndex:counter] stringValue]; }else if ([[[node childAtIndex:counter] name] isEqual:@"description"]) { // common procedure: dictionary with keys/values from XML node if ([[node childAtIndex:counter] stringValue] == NULL){ contact.nextAction = @"No description"; }else{ contact.nextAction = [[node childAtIndex:counter] stringValue]; } }else if ([[[node childAtIndex:counter] name] isEqual:@"created_at"]){ contact.date == [[node childAtIndex:counter] stringValue]; }else if([[[node childAtIndex:counter] name] isEqual:@"time_zone"]){ contact.status == [[node childAtIndex:counter] stringValue]; [res addObject:contact]; [contact release]; } } } self.contactsArray = res; [res release]; [self.tableView reloadData]; } Thanks in advance for your help!! Fiona

    Read the article

  • What is the best way to mock a 3rd party object in ruby?

    - by spinlock
    I'm writing a test app using the twitter gem and I'd like to write an integration test but I can't figure out how to mock the objects in the Twitter namespace. Here's the function that I want to test: def build_twitter(omniauth) Twitter.configure do |config| config.consumer_key = TWITTER_KEY config.consumer_secret = TWITTER_SECRET config.oauth_token = omniauth['credentials']['token'] config.oauth_token_secret = omniauth['credentials']['secret'] end client = Twitter::Client.new user = client.current_user self.name = user.name end and here's the rspec test that I'm trying to write: feature 'testing oauth' do before(:each) do @twitter = double("Twitter") @twitter.stub!(:configure).and_return true @client = double("Twitter::Client") @client.stub!(:current_user).and_return(@user) @user = double("Twitter::User") @user.stub!(:name).and_return("Tester") end scenario 'twitter' do visit root_path login_with_oauth page.should have_content("Pages#home") end end But, I'm getting this error: 1) testing oauth twitter Failure/Error: login_with_oauth Twitter::Error::Unauthorized: GET https://api.twitter.com/1/account/verify_credentials.json: 401: Invalid / expired Token # ./app/models/user.rb:40:in `build_twitter' # ./app/models/user.rb:16:in `build_authentication' # ./app/controllers/authentications_controller.rb:47:in `create' # ./spec/support/integration_spec_helper.rb:3:in `login_with_oauth' # ./spec/integration/twit_test.rb:16:in `block (2 levels) in <top (required)>' The mocks above are using rspec but I'm open to trying mocha too. Any help would be greatly appreciated.

    Read the article

  • Mysql - wondering about scaling a twitter-like application ?

    - by user246114
    Hi, I'm developing an app that is vaguely similar to twitter, in that it allows users to follow one another. I wanted to do this using google app engine, for its scalability promises, but it's proving kind of difficult to get running for a few different reasons. I'd basically like to have a _users table, and a _followers table. Users go into the users table, follower relationships go into _followers. The problem is that each row in the users table will probably have like 100 corresponding records in the _followers table as users start following one another. So the number of rows is going to explode quickly. Using app engine, the volume [shouldn't] be a problem. If I go with mysql, and I do actually start to get some traction, how do I scale this up? Am I going to just end up moving to a distributed database in the end anyway? Should I fight it out with google app engine? I read that Twitter was using mysql, and they've run into this problem, and are now switching to cassandra. Thanks

    Read the article

  • Proxy Authentication in .NET - for external API

    - by n0vic3c0d3r
    I'm developing a twitter messaging utility using Twitter API (twitterizer). But since I'm within a corporate proxy, I'm getting the error '407 Proxy Authentication Required'. Is there any way to authenticate the user before calling the API or use the default proxy settings? P.S Internally the API is using HttpWebRequest.

    Read the article

  • Using oauth with wordpress

    - by Andrew
    I am creating a twitter plugin for wordpress and I was told that when using oauth you can't really make the plugin act natively because each time the user installs the plugin they have to add their own twitter api credentials because of the callback url. Is this correct? Or is there a workaround for this? Thanks for your help in advance!

    Read the article

< Previous Page | 19 20 21 22 23 24 25 26 27 28 29 30  | Next Page >