I am working on a discord bot that posts rss messages to channels. I currently have this:
New item gets posted in the rss feed
Zapier gets notified by the rss feed
Zapier sends out a webhook to my java application
My application receives the message
Application does some processing and sends it to discord
However, I'm now stuck at step 4. I am guessing I should make my java listen to the webhook url of zappier but I could not find out how to make this endpoint.
I was hoping someone could help me out.
P.S. If my idea is stupid or someone knows another way for getting the rss messages to my application please let me know.
To be honest, I haven't use Zapier yet until now but based on the comments, I believe this answer will help you get to the point and write the app for sure because they are conceptually the same.
Recently I developed a telegram bot that have the same behavior. It had webhook pointing to a url that I defined and then it pushed all updates as a json to my URL.
For fetching these kind of data and use them in our app, we should follow these procedures:
Create a web-app with a url endpoint that can receive json object
set your zapier webhook to point exactly to that URL
If you're using java as your web-app, you should have a library like Jackson,GSon to convert your data to a corresponding Java Bean/POJO which you have made.
use that object inside your application
To create POJO object, you should consider the json structure and based on that you should create Java Bean class for binding. refer to this example for that -> How to convert Java object to / from JSON (Jackson)
Take note some frameworks like Spring-MVC they have integrated with
libraries like Jackson and they do all of the binding work for you
automatically.
David here, from the Zapier Platform team.
I just wanted to mention that if all you want to do is send messages from RSS -> Discord, you don't need to develop your own app for that (unless you want to, in which case, power to you!).
You can find a blueprint for that Zap here: https://zapier.com/apps/discord/integrations/rss/25366/post-new-rss-items-to-a-discord-channel
Let me know if you've got any other questions!
Related
I've a requirement to develop a custom sonarqube plugin that will act as a proxy service.
I'm thinking of creating a simple Java application which:
Application will keep on listening for request
Receives a REST api URL (some 3rd party address) from caller as request
Hits REST api and receives JSON response back
Forward the response back to original caller
My question is, is it possible within sonarqube?
Supposing, it is possible:
Second question - I’ve gone thru sonarqube documentation, but I’m not able to pinpoint which plugin class to use. Should I use PageDefinition only?
Please suggest.
Thanks
P.S. - Similar question was posted on sonarqube community, posting it here for broader audience.
I'm thinking of creating a simple Java application which:
Application will keep on listening for request
Receives a REST api URL (some 3rd party address) from caller as request
Hits REST api and receives JSON response back
Forward the response back to original caller
My question is, is it possible within sonarqube?
It is possible to add third party library into a Custom SonarQube Plugin. You can create tasks in which you can do whatever you implement.
Supposing, it is possible: Second question - I’ve gone thru sonarqube
documentation, but I’m not able to pinpoint which plugin class to use.
Should I use PageDefinition only?
You should implement WebService Extension Point which allow you to extend SonarQube web API and add new bahaviours on requests.
PageDefinition is a way to add some web pages on the WebUI.
Background: I am creating an Android app that will get data from a web page (that will be created by me) and parse it. This data can be in XML or JSON format. I would personally prefer JSON but if there is an easy way to achieve it with XML, I would most certainly use it. The app is a Live Score app. So, my page would have XML or JSON with the current score, the current time and minute by minute commentary.
Progress so far: My app is able to read and parse JSON data using the HttpGet and HttpResponse methods alongwith the JSONObject. My concern however is that I am unable to create a dynamic web page. I tried to create and host a page using Google App Engine and Python. The problem was that everytime I'd make changes to the JSON file, I would need to re-deploy the program from the Google App Engine to ensure that the changes are reflected on the URL. I felt this was relatively time consuming.
My Questions:
1.) Is there any way to host a dynamic web page? Preferably with Eclipse and Java. One that I can add the commentary to, as and when an event occurs and it is reflected on the page.
2.) I am not good with Web Services but would GET and POST be a better alternative as opposed to deploying my JSON file with the GAE? If so, how can I go about with that?
3.) Is GCM a good alternative for all this? I tried reading up some of the documentation but it seemed really complex to me.
Thanks.
Sure, it's called AJAX. It requires client-side (browser) javascript code making a request and server-side java code making a response. See: How to use Servlets and Ajax?
Yes, you should use POST and GET to create/retrieve data on server. Your server-side java code should receive data on POST, save it to datastore, and then serve it back on GET. I'd suggest using objectify library for storing data, and GSON for converting java objects to JSON.
GCM is an asynchronous way to notify Android apps (aka notifications) when apps are not running. While with GCM it's possible to send data both ways, it's more complex then plain POST/GET and also only works on Android devices with Google Play.
I have a java listener for working with Docusign connect. Checking out the logs for the connect calls I see the XML as I expected with form fields populated. However, for some reason when the object gets deserialized in the form data section is null. I think it may be related to the below SO question
Why is my WCF web service presenting this object in a different namespace with different field names?
I'm using apache CXF and Maven to download the API objects from
https://www.docusign.net/api/3.0/api.asmx?wsdl
However, the deserialized object looks to be different to the XML sent from connect. Has anyone come across this before or have gotten a listener working in java which can access the forms fields?
Thanks,
Derm
I've never built a Java DocuSign Connect listener application, but I have built one with C#, and I did so by starting with the sample code on GitHub. The Java code is here -- https://github.com/docusign/DocuSign-eSignature-SDK/tree/master/Java/Connect -- if nothing else, perhaps comparing it with what you've got may help you identify the issue(s). Or, you might choose to start over by using the GitHub sample app as the basis for building your listener app -- the C# listener app was plug-and-play, I'd expect the Java version to be the same.
Which is the way to create a JavaFX client-server app using Json packets for the communication? I should interact in real time between two different remote JavaFX instances (like in a chat) sending from one side to the other messages Json formatted.
Any example for doing that?
Thanks!
If you need a high level overview of how this could be done, then you need a library for http (You want to send JSON over http, right?) and some library to work with JSON. I think JavaFX2 is not the case in this problem, you can do this in any Java app.
There is a nice thing called Apache HttpComponents to work with http. Tutorials on their site should provide you with some tips of how to implement both server and client functionality.
To work with JSON you can use, for example, Google's GSON library. Some discussion of JSON libraries can be found here.
At first look you need to form a Java object, representing JSON, convert in to String and pack it up into an http POST request.
Hope this will be some help.
first poster :)
As the title says, I am looking to create a desktop app which will notify me of changes on facebook and new emails, and the facebook part (the first part I've tried) is baffling me. I've never worked with an api before, and have no idea how to integrate facebook's api with this desktop helper I want to create. I will be using java to create this desktop helper.
Thanks in advance!
Here are few pointers for you to get started. Please feel free to ask for clarifications and I will edit my answer accordingly:
For facebook, you can actually pull all those info via their API. There are a lot of types for API, but Facebook specifically use REST API over http.
To simplify, think of it as making an http call with specific parameters and you will be getting an output back.
In order to use facebook API you need to understand their protocol including authentication/login and how to request for things that you want. This would require some reading to their documentation which is pretty complete and available at http://developers.facebook.com/docs/.
For the description of their API URL and the input/output documentation, you could directly jump to Graph API Documentation http://developers.facebook.com/docs/reference/api/.
In order to call their API via HTTP from Java, you could leverage HttpClient library from Apache Http Components project http://hc.apache.org/. They have plenty of tutorial and examples for how to make http call using HttpClient
For combining with all other emails accounts (per your question), you need to deal with SMTP or IMAP (whichever email protocol that you are planning to combine with Facebook). This is already built-in to Java via their Java Mail API collection
You then can poll this data on interval basis to get an update from Facebook and your mails
Once you have figured out how to get the data, the rest is just following a good MVC framework. That means separating out your presentation, data and controller (application logic). Make sure that you are separating the classes for #1 and #2 and each of them put their data to normalized data format that then get feed to your View (presentation layer)