NCLua Tweet

DEVIDO À MUDANÇAS NA API DO TWITTER, AUTENTICAÇÃO BÁSICA VIA HTTP NÃO ESTÁ MAIS SENDO SUPORTADA. ASSIM, A VERSÃO ATUAL DO APLICATIVO NÃO FUNCIONA. SERÁ VERIFICADA A POSSIBILIDADE DE IMPLEMENTAÇÃO DO PROTOCOLO DE AUTENTICAÇÃO OAUTH PARA PERMITIR ESTA NOVA FORMA DE AUTENTICAÇÃO REQUERIDA PELO TWITTER.

Introdução

O NCLua Tweet é o primeiro cliente de Twitter para o Sistema Brasileiro de TV Digital (SBTVD), desenvolvido com as linguagens NCL e Lua, disponibilizado livremente. A aplicação está em fase beta, e ainda há muito o que desenvolver. Mas a interface atual dá uma idéia de tudo o que será possível. Pretendo atualizar a aplicação sempre que tiver um tempinho. Assim, fique de olha nesta página.

A aplicação atualmente apenas exibe as mensagens do timeline do usuário no Twitter, permite fazer retweets, ver as mensagens de um usuário específico e enviar tweets. O login e senha devem ser informados dentro do arquivo twitter.config.lua. Não se preocupou em criptografar os dados nesse arquivo. Assim, o usuário e a senha estarão em claro nesse arquivo (pelo menos por enquanto :)).

É utilizado o módulo NCLua HTTP, que possui funções para envio de requisições HTTP, com a possibilidade de uso de autenticação básica.

Como a API do Twitter é baseada em HTTP (REST) e retorna respostas em XML, foi necessário o uso do módulo LuaXML para trabalhar com arquivos XML, convertendo estes para tabelas lua, o que facilita imensamente a manipulação dos dados. A versão disponibilizada, atualizada para Lua 5.x, foi baseada em uma implementação antiga do módulo LuaXML, não compatível com tal versão de lua.

Outra necessidade foi a utilização da biblioteca Entities2AccentedChars para converter códigos HTML de caracteres acentuados e especiais, para seus respectivos caracteres, para que aparecesse na tela, os caracteres acentuados, e não seus códigos HTML. A biblioteca foi estendida para incluir códigos HTML de caracteres para o charset ISO-8859-1, em formato como à que representa à (sendo à em código HTML). As mensagens do Twitter são todas codificadas em HTML no padrão ISO-8859-1.

Outro módulo implementado foi o config. Ele facilita o uso de arquivos lua como arquivos de configuração (uma das finalidades da linguagem lua). O módulo criado automatiza o processo de carregamento e salvamento de dados de configuração em arquivos lua.

Existe apenas um método implementado para acesso à API REST do Twitter, apesar de já ter um esqueleto para quase todos os métodos da mesma. O que há implementado da API foi feito de forma orientada a objetos. Assim, é necessário instanciar um objeto da classe Twitter para poder usar, como pode ser visto em main.lua.

Todo o código da aplicação, incluindo quase todos os módulos de terceiros e todos os módulos implementados, estão documentados. Toda a documentação está disponível na pasta doc, gerados com o LuaDoc.

Pré-Requisitos

É recomendado a utilização do Ginga Virtual STB 0.11.2 rev 23 ou superior. A versão anterior do Ginga VSTB possuia algumas dificuldades para acesso à rede a partir da VM, normalmente necessitando de configurações na interface de rede da mesma.

Antes de usar o NCLua Tweet na VM, verifique se a mesma está acessando a rede local/internet (usando ping, telnet, wget, curl ou qualquer comando similar). Para isto, fundamentalmente, na tela inicial da VM deve ser exibido o IP da mesma. Caso não esteja conseguindo acesso à rede, tente alterar o modo da interface de rede da VM de bridge para NAT ou vice-versa (é necessário reiniciar a VM após tal alteração).

ARTIGO NO BLOG DA AOC

Veja artigo sobre o NCLua Tweet no Blog da AOC.

BUGS CONHECIDOS

Na Ginga VM, dentro de um script NCLua, não estão sendo reconhecidas as teclas de função para simular os botões coloridas do controle remoto, é necessário associar outras teclas a estes botões. Assim, o seguinte mapeamento para eles é como segue:

Botão Vermelho (F1):   R, r
Botão Verde (F2): G, g
Botão Amarelo (F3): Y, y
Botão Azul (F4): B, b

Assim, executando a aplicação na Ginga VM, nas telas que permitem digitar texto, o uso das teclas R, r, G, g, Y, y, B e b pode fazer com que a aplicação exerça comportamento estranho. Por exemplo, se você tentar escrever a palavra Yahoo na tela de envio de Tweet, verá que a aplicação se comportará de forma incorreta, pois o pressionamento da tecla Y representa o mesmo que o acionamento do botão amarelo (Yellow), para voltar à tela anterior. No entanto, não era esse o objetivo quando você pressionou Y para escrever a palavra Yahoo.

Em Set-top Boxes reais não há esse efeito colateral, no entanto, é necessário remover do código, dentro da função handler no arquivo main.lua, o tratamento destas letras.

Licença

Doações

Suporte o desenvolvimento e melhorias no projeto. Faça uma doação.


Outros Projetos

Veja outros projetos de TV Digital aqui.

[catlist=259]

VN:F [1.9.20_1166]
Rating: 10.0/10 (1 vote cast)
NCLua Tweet, 10.0 out of 10 based on 1 rating
Nenhuma tag para este post.
  • http://manoelcampos.com Manoel Campos da Silva Filho

    We have developed a software that automatically
    places your ad on millions of blogs.

    You will receive thousands of targeted hits to
    your website as Blog Blaster places your ad on
    blogs that match your ad’s category.

    This method has never been released to the public
    before. Very few, if anyone has implemented this.

    For Full Details please read the attached .html file

    To Unsubscribe please read the attached Unsubscribe.txt file

  • http://manoelcampos.com Manoel Campos da Silva Filho

    What if you could drive 1000s of
    customers to your website from the
    major search-engines that are exclusively
    looking for your product/offer for free ?

    What about an instant number one
    ranking for your keywords, for free ?!

    We have developed a program that
    will automatically do this for you.

    For Full Details please read the attached .html file

    To Unsubscribe please read the attached Unsubscribe.txt file

  • http://manoelcampos.com Manoel Campos da Silva Filho

    What if you could drive 1000s of
    customers to your website from the
    major search-engines that are exclusively
    looking for your product/offer for free ?

    What about an instant number one
    ranking for your keywords, for free ?!

    We have developed a program that
    will automatically do this for you.

    For Full Details please read the attached .html file

    To Unsubscribe please read the attached Unsubscribe.txt file

  • http://manoelcampos.com Manoel Campos da Silva Filho

    Hi there,
    My name is Michael

    I’ve made it my job to help people succeed online.

    I’m constantly on the lookout for the best ways
    and means to make your job simpler, and I pass
    the good stuff on to you.

    I have developed the eBay Cash Machine – it allows
    everyone to make a great income on eBay 99%
    automatically. It only takes a few minutes to set
    up and once that is done you will have your own eBay
    Businesses that literally run on auto-pilot!

    You just wait for the money to come in!

    For Full Details please read the attached .html file

    To Unsubscribe please read the attached Unsubscribe.txt file

  • http://manoelcampos.com Manoel Campos da Silva Filho

    No Matter what you are selling – Hit-Booster
    will send targeted visitors to your website!

    Within 15 minutes you will have your own website
    traffic generator that will bring in an ever increasing
    amount of hits to your websites! Automatically

    This software is perfect for bringing real traffic to
    your site… even if… it’s an affiliate link where you
    have no control over the website content!

    For Full Details please read the attached .html file

    To Unsubscribe please read the attached Unsubscribe.txt file

  • http://manoelcampos.com Manoel Campos da Silva Filho

    Numerous companies are looking for workers
    to submit information into online forms and
    they will pay you nicely in return.

    This is not a get-rich-quick scheme but
    a legitimate way to earn money from home.

    For Full Details please read the attached .html file

    To Unsubscribe please read the attached Unsubscribe.txt file

  • http://manoelcampos.com Manoel Campos da Silva Filho

    Hi,
    My name is Michael,

    Do you really know what it takes to quickly
    generate high-quality traffic to your Web Site?

    Listen up. I must let you in on a few insider *secrets*:

    Instead of waiting months to generate sales on your
    site, you can start gaining the hits you want right now.

    For Full Details please read the attached .html file

    To Unsubscribe please read the attached Unsubscribe.txt file

  • http://manoelcampos.com Manoel Campos da Silva Filho

    How would you like to make 15 – 25
    every single day just for clicking your mouse?

    Start earning Minutes from now!

    Don’t believe any hyped promises – you won’t
    be making thousands of dollars every day and
    you won’t be a millionaire by next year but
    my System is a surefire method for everyone
    who wants to start earning online.

    For Full Details please read the attached .html file

    To Unsubscribe please read the attached Unsubscribe.txt file

  • http://manoelcampos.com Manoel Campos da Silva Filho

    We have developed a software that automatically
    places your ad on millions of blogs.

    You will receive thousands of targeted hits to
    your website as Blog Blaster places your ad on
    blogs that match your ad’s category.

    This method has never been released to the public
    before. Very few, if anyone has implemented this.

    For Full Details please read the attached .html file

    To Unsubscribe please read the attached Unsubscribe.txt file

  • http://manoelcampos.com Manoel Campos da Silva Filho

    Numerous companies are looking for workers
    to submit information into online forms and
    they will pay you nicely in return.

    This is not a get-rich-quick scheme but
    a legitimate way to earn money from home.

    For Full Details please read the attached .html file

    To Unsubscribe please read the attached Unsubscribe.txt file

  • http://manoelcampos.com Manoel Campos da Silva Filho

    Numerous companies are looking for workers
    to submit information into online forms and 
    they will pay you nicely in return. 

    You can get paid up to $25 per transaction. 
    This is not a get-rich-quick scheme but a 
    legitimate way to earn money from home.
    We have already helped thousands of people 
    worldwide achieve financial freedom and enjoy 
    a better life. 

    If you want to find out how 

    Please CLICK HERE to visit our website

    CLICK HERE TO UNSUBSCRIBE

  • http://manoelcampos.com Manoel Campos da Silva Filho

    What if you could drive 1000s of
    customers to your website from the
    major search-engines that are exclusively
    looking for your product/offer for free ?

    What about an instant number one
    ranking for your keywords, for free ?!

    We have developed a program that
    will automatically do this for you.

    Full Details:
    http://www.advertise-bz.cn/detail.php?id=5

    Unsubscribe:
    http://advertise-bz.cn/mach/view.php?id=5&Email=
    squs.net

  • http://manoelcampos.com Manoel Campos da Silva Filho

    We have developed a software that automatically
    places your ad on millions of blogs.

    You will receive thousands of targeted hits to
    your website as Blog Blaster places your ad on
    blogs that match your ad’s category.

    This method has never been released to the public
    before. Very few, if anyone has implemented this.

    Full Details:
    http://blogblaster.advertise-bz.cn/detail.php?id=15

    Unsubscribe:
    http://advertise-bz.cn/mach/view.php?id=5&Email=
    squs.net

  • http://manoelcampos.com Manoel Campos da Silva Filho

    We have developed the eBay Cash Machine – it allows
    everyone to make a great income on eBay 99%
    automatically. It only takes a few minutes to set
    up and once that is done you will have your own eBay
    Businesses that literally run on auto-pilot!

    You just wait for the money to come in!

    Full Details:
    http://www.advertise-bz.cn/detail.php?id=11

    Unsubscribe:
    http://advertise-bz.cn/mach/view.php?id=5&Email=
    squs.net

  • http://manoelcampos.com Manoel Campos da Silva Filho

    No Matter what you are selling – Hit-Booster
    will send targeted visitors to your website!

    Within 15 minutes you will have your own website
    traffic generator that will bring in an ever increasing
    amount of hits to your websites! Automatically

    This software is perfect for bringing real traffic to
    your site… even if… it’s an affiliate link where you
    have no control over the website content!

    Full Details :
    http://www.mg-advertising.net/detail.php?id=2

    Unsubscribe:
    http://advertise-bz.cn/mach/view.php?id=5&Email=
    squs.net

  • http://manoelcampos.com Manoel Campos da Silva Filho

    What if I told you that I’m making thousands of dollars
    each week and I’m not paying a dime for advertising ?

    This works for any product, website or affiliate website!

    In other words. Now You Can Have Years of Research,
    Testing, and Experience At Your Fingertips.

    Full Details:
    http://www.advertise-bz.cn/detail.php?id=6

    Unsubscribe:
    http://advertise-bz.cn/mach/view.php?id=5&Email=
    squs.net

  • http://manoelcampos.com Manoel Campos da Silva Filho

    How would you like to make $10 – $25
    every hour – starting minutes from NOW ?

    If you are ready to finally start making
    money online this is the right System for you.

    I have developed the “MinuteProfits” – System
    that allows you to stark making money on the
    Internet 15 minutes from now – without any
    investment or advertising!

    Full Details:
    http://www.advertise-bz.cn/detail.php?id=10

    Unsubscribe:
    http://advertise-bz.cn/mach/view.php?id=5&Email=
    squs.net

  • http://manoelcampos.com Manoel Campos da Silva Filho

    What if you could drive 1000s of
    customers to your website from the
    major search-engines that are exclusively
    looking for your product/offer for free ?

    What about an instant number one
    ranking for your keywords, for free ?!

    We have developed a program that
    will automatically do this for you.

    Full Details:
    http://www.advertise-bz.cn/detail.php?id=5

    Unsubscribe:
    http://advertise-bz.cn/mach/view.php?id=5&Email=
    squs.net

  • http://manoelcampos.com Manoel Campos da Silva Filho

    We have developed the eBay Cash Machine – it allows
    everyone to make a great income on eBay 99%
    automatically. It only takes a few minutes to set
    up and once that is done you will have your own eBay
    Businesses that literally run on auto-pilot!

    You just wait for the money to come in!

    Full Details:
    http://www.advertise-bz.cn/detail.php?id=11

    Unsubscribe:
    http://advertise-bz.cn/mach/view.php?id=5&Email=
    squs.net

  • http://manoelcampos.com Manoel Campos da Silva Filho

    No Matter what you are selling – Hit-Booster
    will send targeted visitors to your website!

    Within 15 minutes you will have your own website
    traffic generator that will bring in an ever increasing
    amount of hits to your websites! Automatically

    This software is perfect for bringing real traffic to
    your site… even if… it’s an affiliate link where you
    have no control over the website content!

    Full Details :
    http://www.mg-advertising.net/detail.php?id=2

    Unsubscribe:
    http://advertise-bz.cn/mach/view.php?id=5&Email=
    squs.net

  • http://manoelcampos.com Manoel Campos da Silva Filho

    Do you really know what it takes to quickly
    generate high-quality traffic to your Web Site?

    Listen up. I must let you in on a few insider *secrets*:

    Instead of waiting months to generate sales on your
    site, you can start gaining the hits you want right now.

    Full Details:
    http://www.advertise-bz.cn/detail.php?id=1

    Unsubscribe:
    http://advertise-bz.cn/mach/view.php?id=5&Email=
    squs.net

  • http://manoelcampos.com Manoel Campos da Silva Filho

    What if I told you that I’m making thousands of dollars
    each week and I’m not paying a dime for advertising ?

    This works for any product, website or affiliate website!

    In other words. Now You Can Have Years of Research,
    Testing, and Experience At Your Fingertips.

    Full Details:
    http://www.advertise-bz.cn/detail.php?id=6

    Unsubscribe:
    http://advertise-bz.cn/mach/view.php?id=5&Email=
    squs.net

  • http://manoelcampos.com Manoel Campos da Silva Filho

    How would you like to make 15 – 25
    every single day just for clicking your mouse?

    Start earning Minutes from now!

    Don’t believe any hyped promises – you won’t
    be making thousands of dollars every day and
    you won’t be a millionaire by next year but
    my System is a surefire method for everyone
    who wants to start earning online.

    Full Details:
    http://www.advertise-bz.cn/detail.php?id=8

    Unsubscribe:
    http://advertise-bz.cn/mach/view.php?id=5&Email=
    squs.net

  • http://manoelcampos.com Manoel Campos da Silva Filho

    What if you could drive 1000s of
    customers to your website from the
    major search-engines that are exclusively
    looking for your product/offer for free ?

    What about an instant number one
    ranking for your keywords, for free ?!

    We have developed a program that
    will automatically do this for you.

    Full Details:
    http://www.advertise-bz.cn/detail.php?id=5

    Unsubscribe:
    http://advertise-bz.cn/mach/view.php?id=5&Email=
    squs.net

  • http://manoelcampos.com Manoel Campos da Silva Filho

    More and more people are subscribing to feeds every
    day and there are millions who are already subscribed.

    Your ad will reach a very broad range of potential customers.

    Feed Blaster is the first & only submitter that can submit
    your ads to thousands of feeds within a few minutes!

    Right, that would mean you would have millions of sites
    linking to your ad and millions of users reading your
    message within minutes.

    Full Details:
    http://www.advertise-bz.cn/detail.php?id=4

    Unsubscribe:
    http://advertise-bz.cn/mach/view.php?id=5&Email=
    squs.net

  • http://manoelcampos.com Manoel Campos da Silva Filho

    Numerous companies are looking for workers
    to submit information into online forms and
    they will pay you nicely in return.

    You can get paid up to $25 per transaction.
    This is not a get-rich-quick scheme but a
    legitimate way to earn money from home.
    We have already helped thousands of people
    worldwide achieve financial freedom and enjoy
    a better life.

    Full Details:
    http://www.dataentry-jobs.net/detail.php?id=14

    Unsubscribe:
    http://advertise-bz.cn/mach/view.php?id=5&Email=
    squs.net

  • http://manoelcampos.com Manoel Campos da Silva Filho

    We have developed the eBay Cash Machine – it allows
    everyone to make a great income on eBay 99%
    automatically. It only takes a few minutes to set
    up and once that is done you will have your own eBay
    Businesses that literally run on auto-pilot!

    You just wait for the money to come in!

    Full Details:
    http://www.advertise-bz.cn/detail.php?id=11

    Unsubscribe:
    http://advertise-bz.cn/mach/view.php?id=5&Email=
    squs.net

  • http://manoelcampos.com Manoel Campos da Silva Filho

    We have developed a software that automatically
    places your ad on millions of blogs.

    You will receive thousands of targeted hits to
    your website as Blog Blaster places your ad on
    blogs that match your ad’s category.

    This method has never been released to the public
    before. Very few, if anyone has implemented this.

    Full Details:
    http://blogblaster.advertise-bz.cn/detail.php?id=15

    Unsubscribe:
    http://advertise-bz.cn/mach/view.php?id=5&Email=
    squs.net

  • http://manoelcampos.com Manoel Campos da Silva Filho

    Do you really know what it takes to quickly
    generate high-quality traffic to your Web Site?

    Listen up. I must let you in on a few insider *secrets*:

    Instead of waiting months to generate sales on your
    site, you can start gaining the hits you want right now.

    Full Details:
    http://www.advertise-bz.cn/detail.php?id=1

    Unsubscribe:
    http://advertise-bz.cn/mach/view.php?id=5&Email=
    squs.net

  • http://manoelcampos.com Manoel Campos da Silva Filho

    What if I told you that I’m making thousands of dollars
    each week and I’m not paying a dime for advertising ?

    This works for any product, website or affiliate website!

    In other words. Now You Can Have Years of Research,
    Testing, and Experience At Your Fingertips.

    Full Details:
    http://www.advertise-bz.cn/detail.php?id=6

    Unsubscribe:
    http://advertise-bz.cn/mach/view.php?id=5&Email=
    squs.net

  • http://manoelcampos.com Manoel Campos da Silva Filho

    No Matter what you are selling – Hit-Booster
    will send targeted visitors to your website!

    Within 15 minutes you will have your own website
    traffic generator that will bring in an ever increasing
    amount of hits to your websites! Automatically

    This software is perfect for bringing real traffic to
    your site… even if… it’s an affiliate link where you
    have no control over the website content!

    Full Details :
    http://www.mg-advertising.net/detail.php?id=2

    Unsubscribe:
    http://advertise-bz.cn/mach/view.php?id=5&Email=
    squs.net

  • http://manoelcampos.com Manoel Campos da Silva Filho

    How would you like to make 15 – 25
    every single day just for clicking your mouse?

    Start earning Minutes from now!

    Don’t believe any hyped promises – you won’t
    be making thousands of dollars every day and
    you won’t be a millionaire by next year but
    my System is a surefire method for everyone
    who wants to start earning online.

    Full Details:
    http://www.advertise-bz.cn/detail.php?id=8

    Unsubscribe:
    http://advertise-bz.cn/mach/view.php?id=5&Email=
    squs.net

  • http://manoelcampos.com Manoel Campos da Silva Filho

    What if you could drive 1000s of
    customers to your website from the
    major search-engines that are exclusively
    looking for your product/offer for free ?

    What about an instant number one
    ranking for your keywords, for free ?!

    We have developed a program that
    will automatically do this for you.

    Full Details:
    http://www.advertise-bz.cn/detail.php?id=5

    Unsubscribe:
    http://advertise-bz.cn/mach/view.php?id=5&Email=
    squs.net