Uber API : Book job via API - php

can anyone confirm either way whether it's possible to book an Uber job via the API?
I see no mention of it in the docs, so I would assume it's not possible, but still, I'd quite like to know!

The ride request API is now launched. Please see https://devblog.uber.com/take-your-users-for-a-spin/ for more information.

A blog post quite clearly states that it's implemented, but not yet available to all.
http://blog.uber.com/api
What about requesting a ride? Yes, we’ve implemented that endpoint as well, but because calling it immediately dispatches a real driver in the real world, we’re releasing it in a more controlled fashion, starting with a small set of partners. Stay tuned for more on that, and please let us know if you’re interested in being added to the whitelist.

Related

Read Context Information Asynchronously with Fiware Context Broker

I am using Context Broker in order to read measures from my sensors.
Until now, I have to refresh my application's web page in order to read the latest measures.
How could I update the measures on my page without refreshing it?
Is there any way to use curl get request with polling or websockets?
Or is there an operation that Context Broker provides in order to update asynchronously the new measures that my sensor sends?
Sadly I think that there is not such a thing in Fiware Community and. However I think that you could implement that behavior without pain starting from this:
Orion and Suscription Mechanisim
Orion Context Broker use a subscription mechanism that is well explained in this section of official documentation.
Starting from that you could subscribe your App to specific changes on your device's contexts and then receive new data each time a devices send a new measure.
However this is not enough to receive notifications in your Web Application from client side. To do so you must suscribe your application backend and then implement an asynchronously mechanism to notify the client from your backend using for example Websockets as you correctly said.
NGSI Proxy
In the other hand there is this component from FIWARE community called NGSI Proxy that implements a similar logic for you and could be of some help for you. I confess that I only use it in the past indirectly using a Wirecloud Widgets and I am not sure if it is the answer for your problem.
I'm sorry if it could not be enough help.
It seems pretty easy to implement what you are asking for ...
How do you get the data from Orion in the first place?
With a GET /v2/entities perhaps.
Just program a call to Orion in a javascript function (a bit of Ajax) triggered by a setInterval and then change the values of your fields of your web page. Right?
Orion implemented websocket support time ago (see this question) but it was as an experimental proof-of-concept that at the end hasn't landed in the master repository branch (at least up to the present moment ;)
You could have a look in order to see if it suits your problem. However, an Ajax-based alternative, as #kzangeli is points out in his anwers, seems to be a priori more feasible.

Sending a notification of a Paypal transaction to an IRC Bot, either directly or via intermediary webpage

Firstly this is my first question so I apologize if it not up to standards.
TL:DR -
I need to be able to get a notification of a Paypal transaction with the amount, and message, if any to an IRC bot. I am thinking about a webpage to take the transaction and notify the bot. I was hoping to use PHP for the webpage and this for the IRC bot: willie.dftba.net - An open source Python IRC Bot.
Long Format -
Context:
I am attempting to create a webpage that will take a Paypal transaction, then send a notification containing the amount and the message the user left(if any) to the IRC Bot.
The reasoning behind using a webpage over having the bot query the Paypal API directly is to avoid spamming Paypal while at the same time reducing the communication to a notification only when an event occurs.
The webpage will likely be running on a hosted webserver that I have little control over. I am familiar with PHP, my Javascript is not so great though.
The IRC bot has not yet been created, I was hoping to utilize willie.dftba.net for the bot, it's Open source and in Python. The bot will be running on a Windows machine most likely. Other options for IRC bots should probably be left to the comments. The bot will be doing other things outside the scope of this question. Though this is a critical function for the bot.
Answers I'm looking for:
What sort of technologies or libraries for the languages I am trying to use can help me achieve this as simply as possible? Please state why.
Suggestions that are within the scope of this question:
Using different technologies, languages, or APIs than I mentioned if it will make the job easier/faster. Please state why.
Why am I asking?
I am asking this question because there seems to many possible technologies or APIs I could utilize but I am not experienced enough to ascertain which route I should head down. I am honestly at a loss right now.
Background on my Knowledge & Experience:
For web technologies, I am familiar with HTML, PHP CSS, & a little Javascript.
For programming languages I have taken a few classes covering basic C++, Visual Basic .NET, and some Java.
I have messed around with Python a little over a decade ago when modding a game.
I have created, or helped to create a dozen or so smaller websites. I have used things like Jquery before but in an extremely limited fashion, my PHP is much stronger than my Javascript.
I have made a few simple command line C++ & Java programs as learning exercises.
I have made many simple VB.NET applications and 3 practical use, but small applications.
Research I have conducted:
I have searched Google, and here for possibilities, and have several links that I have looked through. While I must admit I have not read every single word on every single link, I have read a fair portion and skimmed a lot of the rest. And clicked on many links within the pages I am about to reference here. For the sake of not posting the entire internet, I am only posting the starting links.
After typing this all up, I discovered it will not let me post more than two links so I have had to alter these links.
willie.dftba.net
php.net/manual/en/book.sockets.php
socket.io
www.npmjs.com/package/socket.io
stackoverflow.com/questions/6398887/using-php-with-socket-io
www.htmlgoodies.com/html5/other/create-a-bi-directional-connection-to-a-php-server-using-html5-websockets.html#fbid=XmAMX7ESMm7
stackoverflow.com/questions/14418950/broadcast-notification-to-multiple-users-at-the-same-time-php-mysql-ajax
cometdaily.com/maturity.html
stackoverflow.com/questions/12284565/how-to-communicate-between-a-php-and-a-c-application-through-a-socket
davidwalsh.name/nodejs-irc
sourceforge.net/projects/phpsmartirc/
Final Thoughts:
Thank for reading this question and devoting some of your time and energy to this question, it is highly appreciated! I really hope I have been thorough & specific enough.
You've been pretty broad with your questions, so I'll be broad with my answer.
I would recommend sticking with PHP and setting up an Instant Payment Notification (IPN) solution for your PayPal account.
That will send POST data about any transaction that hits in your PayPal account in real-time. You can use it to automate tasks based on payments, refunds, disputes, cleared payments when they're pending, etc.
There are lots of good IPN packages for PHP available on GitHub/Packagist. If you happen to be working with WordPress, take a look at my PayPal IPN for WordPress plugin, and on that note, if you are using WordPress I'll assume you're using WooCommerce, so I'd also take a look at my PayPal for WooCommerce plugin.
For API calls, I would recommend taking a look at my class library for PayPal. It will make any API call you need to make with PayPal very quick and easy, and it is also available on GitHub and Packagist.
Those tools should give you everything you need to get any PayPal task you need done.

How does Facebook notify and instantly shows new comments or how does Stackoverflow do it?

I am a PHP developer and the title basically says it all. However I was hoping on some more in-depth information as I am starting to get confused about how the flow for the project I work on should go.
For an (web) application I need to implement a feature like Facebook does it with notifying users about replies/comments and instantly showing these.
I figured I could use long-polling with ajax requests but this does not seem to be a nice solution as the notifications never really are instant and it is resource heavy.
So I should use some form of sockets if I understand correctly, and Node.Js would be a good choice. So based on the last assumption I now get confused about the work flow.
I thought about two possible solutions:
1) It seems to me, that if I would use Node.Js I could skip using PHP at all and base the application on Node.js only.
2) Or I could use PHP as a base and only use Node.js for notifying users and instantly showing messages but saving the data using PHP and Mysql.
These two possibilities confuse me and I can't make up my mind about what would be the "best" and cleanest way.
I do not have much experience in Node.js, played with it for a while. But managing and saving data seems to be hard in Node.js so that is why I came up with option 2.
I know Facebook is build on PHP so I am assuming that they save the data via PHP and notify / instantly show replies and comments via Node.
Could someone help me out on this?
Thanks in advance!
EDIT:
I just noticed, Stackoverflow does something similar. I get a notification in the upper left, and below my question a box with "new answer to this question". I am really interested in the technologie(s) used.
Well you could use node.js for the notifications and PHP for your app.
By googling I found this about real-time-notifications.
You could also just use node.js with socket.io, but this means that you have to learn new technologies as you mention that you have no experience with node.
I haven't used it but you could check this project, for websockets in PHP.
When you have an update that you want to notify users you can use the publish subscriber pattern to notify the intrested in this update.
Take a look in Gearman too.
Personally, I've built a notification system using the pubsub mechanism of redis, with node.js+socket.io. Everytime that there is an update on a record then there is a publish on the appropriate channel. If the channel has listeners then they will be notified. I also store the last 20 notifications in a Redis list.
The appplication is built in PHP. The notification system is built in node.js. They are different applications that see the same data. The communication occurs via redis. For example in the Facebook context:
1) A user updates his status.
2) PHP stores this to the database and Redis
3) Redis knows that this update must publish to the status channel of the specific user and it does.
4) All the friends of the specific user are listening to his status channel (here comes node.js)
5) Node.js pushes the notification in the browser with socket.io
As for facebook, I have read in an article that is using long polling for supporting older browsers. Not sure for this though, needs citation...
AFAIK It would be via two simple methods :
First one that could be very simple is adding a Boolean column to each record that determines if it has been notified or not.
The second method is creating a table to insert all notifications.
However, I'm not sure if there are alternative methods for better performance, But first method is what I do commonly myself. But I think Facebook is using 2nd method, because it has to notify each one to a lot of users.
Your question maybe dublicate of:
Facebook like notifications tracking (DB Design)
Database design to store notifications to users
You could use Server Side Events it involves a bit of JavaScript but nothing overly complicated I think.
The main bulk of this method is PHP though, so you would just use the PHP to query your DB for notifications and SSE will push them to the user.
It does have some limitations though, most notably it's not supported by IE (huge surprise) thought i'd mention it anyway to let you know of other possibilities.
Hope this helps

China Post EMS API / CSV download

I'm building a courier tracking application for a client. It's the second I've done, so far having worked with UPS, TNT, AAE and BPost. All have APIs or CSV downloads which can be used.
I'm working in Codeigniter.
I just wondered if anyone has experience of automating tracking with China Post EMS service? The only way to get tracking data it seems is by entering a tracking code / captcha either singly or in batches of 10. Not very practical for my client who deals with 500-1000 consignments per month.
I've searched for about 4 hours this morning on how to do this, I tried calling China Post (but don't speak Chinese so didn't get anywhere with that), have emailed (no reply yet) also.
Now my client is talking about abandoning the project if we can't get this to work - problem is unless I can find a method of retrieving data, I don't see how this can be achieved.
If you have come across this issue before (and looking at Google I can see I'm not the only developer who has come across this problem) please let me know your solution.
I know this is an old question, but I've been looking for a solution to the same issue, now, what I found as a potential solution is this:
I found a Python GUI script that uses track-chinapost.com and a captcha breaker in order to get the tracking information
Another potential solution is using the AfterShip API which supports china post among many other couriers, but it is pretty expensive and I don't think it suits your context...
If you have found other solutions, please let me know...

Real time activity feed - code / platform implementation?

I am defining out specs for a live activity feed on my website. I have the backend of the data model done but the open area is the actual code development where my development team is lost on the best way to make the feeds work. Is this purely done by writing custom code or do we need to use existing frameworks to make the feeds work in real time? Some suggestions thrown to me were to use reverse AJAX for this. Some one mentioned having the client poll the server every x seconds but i dont like this because it is unwanted server traffic if there are no updates. I was also mentioned a push engine like light streamer to push from server to browser.
So in the end: What is the way to go? Is it code related, purely pushing SQL quires, using frameworks, using platforms, etc.
My platform is written in PHP codeignitor and DB is MySQL.
The activity stream will have lots of activities. There are 42 components on the social networking I am developing, each component has approx 30ish unique activities that can be streamed.
Check out http://www.stream-hub.com/
I have been using superfeedr.com with Rails and I can tell you it works really well. Here are a few facts about it:
Pros
Julien, the lead developer is very helpful when you encounter a problem.
Immediate push of new feed entries which support PubSubHubHub.
JSon response which is perfect for parsing whoever you'd like.
Retrieve API in case the update callback fails and you need to retrieve the latest entries for a given feed.
Cons
Documentation is not up to the standards I would like, so you'll likely end up searching the web to find obscure implementation details.
You can't control how often superfeedr fetches each feed, they user a secret algorithm to determine that.
The web interface allows you to manage your feeds but becomes difficult to use when you subscribe to a loot of them
Subscription verification mechanism works synchronous so you need to make sure the object URL is ready for the superfeedr callback to hit it (they do provide an async option which does not seem to work well).
Overall I would recommend superfeedr as a good solution for what you need.

Categories