How to send a message from website to moodle? - javascript

I'm developing a website and I have to type a text in a box and send it as a message to moodle with some button. I have already made it with sending messages to linkedin, twitter and email but I don't know how to send to moodle and I'd be grateful if you help me.

Sounds like you need to use web services
Follow the instructions to set up Moodle as a web service
http://docs.moodle.org/26/en/Using_web_services
Then have a look through the list of functions available for web services - in your moodle site go to site admin -> plugins -> web services -> api documentation
or go direct to the url yourwebsite.com/admin/webservice/documentation.php
In the documentation there is a function to send instant messages to users :
core_message_send_instant_messages()

You can also set up social media so that they work within Moodle. Perhaps the easiest approach is to use a theme (in Moodle 2.6). I would recommend Essential. It has a form that lets you enter in social media. It is a responsive theme.
http://www.packtpub.com/designing-moodle-themes/video

Related

Twitter API on JS Web View - Create a Twitter Clients that tweets on behalf of users

I need to make a very simple Twitter Client in JavaScript (Web View - not Node) like https://hootsuite.com/dashboard#/publisher, that will send users to authenticate on twitter and then, be able to fetch their tweets (and the tweets of the people they follow) and enable them to tweet a simple message.
I created a Twitter app (without a website config because I need it for Web View), and I'm having serious issues while trying to implement all the oAuth 1.0 procedure, and also the other parts (maybe because I don't understand how to use the oAuth).
So, my questions are:
is there any library that can help me to achieve this?
Is there any way I can implement this by myself easily?
Is there any option, thanks to Web View, to make this flow simpler by maybe using some native code? (Need it for both Android & IOS)
Any help will be appreciated.

Query regarding post comments using Facebook Javascript API

As per the Facebook Javascript API documentation, I need an APP Id to post comments on facebook wall. But when I log in to my Facebook account it always shows me “All Campaigns" page and I am not able to access “Apps” section to create new application and get APP Id which can be used in JavaScript API.
Can you please suggest how can I create an APP Id in my account and post comment on my facebook wall from external web pages using Facebook Javascript API.
You can view/create apps on Facebook for this purpose in the developers section. It sounds like you want to look at 'Build for Websites'. When you have made an app, it will appear in the apps section, where you can find your App ID and App Secret keys, as well as manage/edit the app.
I am not able to access “Apps” section to create new application
What exactly does „not being able” mean?
Is your account verified with Facebook (via text to mobile, credit card info)? That’s a basic requirement for becoming a developer on the FB platform.

Check user authentication from "website a" on "website b"

I have a 'little' problem.
I am working on a project for school in Ruby on Rails: a platform where people can share things with eachother. I recently started working on widgets which people can place on their website.
In the widget you see this 'thing' and how much it is shared. But now when someone loads the widget I want to check if he is logged in on my website and then show him which friends of him/her also shared that thing. I've Been thinking and trying a few hours now but haven't figured something out yet.
I have tried to use the Facebook SDK but could not get it to work because this is domain limited. Altough Facebook would not have been the best option I think because then it is only available for people who have their Facebook account linked to their account on my website.
Probably I have to create something by my own. But I have no clue how to do it right now. I hope someone can point me in the right direction.
If A and b are on the same domain as a subdomains you can use cookies to store authentication token and in that case that will work.
If not, you can use OAuth for example http://en.wikipedia.org/wiki/OAuth.
Ruby has a bunch of gems to support that. Devise has OAuth integration as well as authlogic.
Twitter uses that widely.
Also there are CAS and WebAUTH those do quite the same.
You can list both domains (A and B) on application settings under Basic section in App Domain field. This will allow you to use Facebook JS-SDK on both sites with same application id.
You should understand that this will allow both sites to access personal info of your users and this should be done only if you have control on those sites since you are responsible for application who uses JS-SDK

Facebook Credits on an external website

I tryed the sample code found here:
https://developers.facebook.com/docs/creditsapi/
Even if i added my company address & payment, i still get this error:
API Error Code: 1151 API Error Description: Sorry, but this app may
not be eligible to accept Facebook Credits. If this app has accepted
credits before, please try again. Error Message: Invalid Application
I think the credits api best work on iframe apps. Is possible to integrate credits in my website?
Best
Matteo
credits only work in facebook canvas apps:
The Facebook Credits API enables a user to use credits as a method for
purchasing digital and virtual goods within a Facebook canvas
application. Please note: the credits api is not yet available for use
by external websites but only on canvas iframe applications.
The error is because you do not have a valid application id. You are going to have to create an application for your website. This can be done by going to https://developers.facebook.com/apps . If you have an application made for your website still go to the website and grab the App ID/API Key and put after
FB.init({appId:
What I do is redirect the user into the iFrame canvas for payment and then back out to my web site when done.
Not sure this breaks any Facebook agreement.

Is it possible to post to Facebook application Wall via JavaScript?

I have a Canvas Facebook app embedded via an iframe. I would like to include a feedback link which would encourage the user to leave a comment that would be added to the Application wall - this comment would open like a standard FB modal window. Is there anyway to post to to the Application Wall directly via JS? Everything I have found such as FB.Connect.StreamPublish(), only publishes to the users stream, I need to publish to the application stream. Thanks!
Apparently not, according to stream.publish - Facebook developers, section on target_id parameter:
Note: You cannot publish to an application profile page's Wall.

Categories