Threaded View

  1. #1
    Sencha User
    Join Date
    Nov 2010
    Posts
    5
    Answers
    1
    Vote Rating
    0
    topquark is on a distinguished road

      0  

    Default Answered: Twitter Links Broken

    Answered: Twitter Links Broken


    Hi there,

    I'm building an app based on the O'Reilly Conference app example shipped with Sencha Touch. The Tweet Store is loading properly, but the links to the tweets within twitter.com are broken.

    The behaviour can be seen in the O'Reilly Conference App example. Load it, and go to the Twitter panel. Now click one of the tweets. It asks if you want to open it in twitter.com. Click yes, and you will (most likely) be taken to a "Sorry, that page doesn't exist" page.

    As far as I can tell, it's because the tweet id is getting rounded when it goes into the store. For example, a tweet id that comes in from the twitter feed as 103551456984051712 gets stored as 103551456984051710 (note the least significant digit).

    I'm baffled and don't know where to start. Has anyone else seen/solved this issue?

    Thanks,
    Trevor Mills

  2. I still don't know why it appears that the ID gets rounded, but I've figured out a workaround. The Twitter API actually sends back both an `id` and an `id_str` parameter. They contain the same value. Sencha seems to mangle `id`, but thankfully `id_str` is left unchanged. The workaround then involves two simple things:

    1) Add `id_str` to the Tweet Model
    2) Update how the window.location string gets built when opening the tweet in a new window

    Working from the O'Reilly Conference App sample app, I had to modify two files:

    I modified examples/oreilly/src/Models.js, changing line 28 from:

    Code:
    fields: ['id', 'text', 'to_user_id', 'from_user', 'created_at', 'profile_image_url']
    ...to:

    Code:
    fields: ['id', 'id_str', 'text', 'to_user_id', 'from_user', 'created_at', 'profile_image_url']
    Then, I modified examples/oreilly/src/TweetList.js, changing line 71 from:

    Code:
    window.location = 'http://twitter.com/' + records[0].data.from_user + '/status/' + records[0].data.id
    ...to:

    Code:
    window.location = 'http://twitter.com/' + records[0].data.from_user + '/status/' + records[0].data.id_str
    Hope someone else finds this helpful.

Turkiyenin en sevilen filmlerinin yer aldigi xnxx internet sitemiz olan ve porn sex tarzi bir site olan mobil porno izle sitemiz gercekten dillere destan bir durumda herkesin sevdigi bir site olarak tarihe gececege benziyor. Sitenin en belirgin ozelliklerinden birisi de Turkiyede gercekten kaliteli ve muntazam, duzenli porno izle siteleri olmamasidir. Bu yuzden iste. Ayrica en net goruntu kalitesine sahip adresinde yayinlanmaktadir. Mesela diğer sitelerimizden bahsedecek olursak, en iyi hd porno video arşivine sahip bir siteyiz. "The Best anal porn videos and slut anus, big asses movies set..." hd porno faketaxi